You can subscribe to this list here.
2010 |
Jan
|
Feb
|
Mar
(16) |
Apr
(25) |
May
(8) |
Jun
(22) |
Jul
(71) |
Aug
(36) |
Sep
(22) |
Oct
(31) |
Nov
(88) |
Dec
(40) |
---|---|---|---|---|---|---|---|---|---|---|---|---|
2011 |
Jan
(128) |
Feb
(35) |
Mar
(28) |
Apr
(33) |
May
(18) |
Jun
(8) |
Jul
(21) |
Aug
(18) |
Sep
(6) |
Oct
(19) |
Nov
(12) |
Dec
(44) |
2012 |
Jan
(31) |
Feb
(48) |
Mar
(31) |
Apr
(11) |
May
(13) |
Jun
(15) |
Jul
(13) |
Aug
(18) |
Sep
(7) |
Oct
(25) |
Nov
(21) |
Dec
(13) |
2013 |
Jan
(17) |
Feb
(18) |
Mar
(21) |
Apr
(35) |
May
(30) |
Jun
(4) |
Jul
|
Aug
(1) |
Sep
(8) |
Oct
(30) |
Nov
(13) |
Dec
|
From: Cyril H. <su...@li...> - 2013-03-21 12:21:40
|
The branch, master, has been updated via 575f9932699347440201d5ca6814cbe16cf35ac5 (commit) via 01a03c55969200579f34c665de0f2714b95af2ff (commit) via 84888fa983161bbbfbb5e09949fc0cc9ee47e6f4 (commit) via e60833733240c71facaaea2b984d053ee427cd72 (commit) via 723c8eb95f69ac13ff0cd0100746e3c8e9e4c98e (commit) from 4b3e904aadb7536585e7595ad01c070467851f35 (commit) - Log ----------------------------------------------------------------- commit 575f9932699347440201d5ca6814cbe16cf35ac5 Author: Cyril Hrubis <ch...@su...> Date: Thu Mar 21 13:01:39 2013 +0100 open_posix_testsuite/.../pthread_cond_timedwait/4-2.c Flush the stdout before fork(). Signed-off-by: Cyril Hrubis <ch...@su...> commit 01a03c55969200579f34c665de0f2714b95af2ff Author: Cyril Hrubis <ch...@su...> Date: Thu Mar 21 12:57:20 2013 +0100 runtest/ltp-aiodio.part3: fsx-linux turn off debug Turn off debug mode for FSX tests otherwise these will generate several megabytes of useless logs. Signed-off-by: Cyril Hrubis <ch...@su...> commit 84888fa983161bbbfbb5e09949fc0cc9ee47e6f4 Author: Cyril Hrubis <ch...@su...> Date: Thu Mar 21 12:48:32 2013 +0100 open_posix_testsuite/.../pthread_exit/6-1.c Flush the stdout before fork(). Signed-off-by: Cyril Hrubis <ch...@su...> commit e60833733240c71facaaea2b984d053ee427cd72 Author: Cyril Hrubis <ch...@su...> Date: Thu Mar 21 12:46:15 2013 +0100 open_posix_testsuite/.../pthread_create/3-2.c Flush the stdout before fork(). Signed-off-by: Cyril Hrubis <ch...@su...> commit 723c8eb95f69ac13ff0cd0100746e3c8e9e4c98e Author: Cyril Hrubis <ch...@su...> Date: Thu Mar 21 12:32:26 2013 +0100 open_posix_testsuite/.../pthread_cond_broadcast: Fix. Flush the stdout before we fork, otherwise each children will flush the buffer resulting in quater of megabyte of logs. Signed-off-by: Cyril Hrubis <ch...@su...> ----------------------------------------------------------------------- Summary of changes: runtest/ltp-aiodio.part3 | 16 ++++++++-------- .../interfaces/pthread_cond_broadcast/1-2.c | 1 + .../interfaces/pthread_cond_timedwait/4-2.c | 1 + .../conformance/interfaces/pthread_create/3-2.c | 4 ++++ .../conformance/interfaces/pthread_exit/6-1.c | 4 ++++ 5 files changed, 18 insertions(+), 8 deletions(-) diff --git a/runtest/ltp-aiodio.part3 b/runtest/ltp-aiodio.part3 index c9b2b81..d53e836 100644 --- a/runtest/ltp-aiodio.part3 +++ b/runtest/ltp-aiodio.part3 @@ -1,14 +1,14 @@ # fname: this filename is Required (no default) # # -FSX032 fsx-linux -d -l 500000 -r 4096 -t 4096 -w 4096 -N 10000 $TMPDIR/aiodio.$$/junkfile -FSX033 fsx-linux -d -l 500000 -r 4096 -t 2048 -w 2048 -N 10000 $TMPDIR/aiodio.$$/junkfile -FSX034 fsx-linux -d -l 500000 -r 4096 -N 10000 $TMPDIR/aiodio.$$/junkfile -FSX035 fsx-linux -d -N 10000 $TMPDIR/aiodio.$$/junkfile -FSX036 fsx-linux -d -N 10000 $TMPDIR/aiodio.$$/junkfile -FSX037 fsx-linux -d -N 10000 $TMPDIR/aiodio.$$/junkfile -FSX038 fsx-linux -d -N 10000 $TMPDIR/aiodio.$$/junkfile -FSX039 fsx-linux -d -N 10000 $TMPDIR/aiodio.$$/junkfile +FSX032 fsx-linux -l 500000 -r 4096 -t 4096 -w 4096 -N 10000 $TMPDIR/aiodio.$$/junkfile +FSX033 fsx-linux -l 500000 -r 4096 -t 2048 -w 2048 -N 10000 $TMPDIR/aiodio.$$/junkfile +FSX034 fsx-linux -l 500000 -r 4096 -N 10000 $TMPDIR/aiodio.$$/junkfile +FSX035 fsx-linux -N 10000 $TMPDIR/aiodio.$$/junkfile +FSX036 fsx-linux -N 10000 $TMPDIR/aiodio.$$/junkfile +FSX037 fsx-linux -N 10000 $TMPDIR/aiodio.$$/junkfile +FSX038 fsx-linux -N 10000 $TMPDIR/aiodio.$$/junkfile +FSX039 fsx-linux -N 10000 $TMPDIR/aiodio.$$/junkfile FSX040 fsx-linux -N 10000 -o 1024 $TMPDIR/aiodio.$$/junkfile FSX041 fsx-linux -N 10000 -o 2048 $TMPDIR/aiodio.$$/junkfile FSX042 fsx-linux -N 10000 -o 4096 $TMPDIR/aiodio.$$/junkfile diff --git a/testcases/open_posix_testsuite/conformance/interfaces/pthread_cond_broadcast/1-2.c b/testcases/open_posix_testsuite/conformance/interfaces/pthread_cond_broadcast/1-2.c index 7a568ad..f95f914 100644 --- a/testcases/open_posix_testsuite/conformance/interfaces/pthread_cond_broadcast/1-2.c +++ b/testcases/open_posix_testsuite/conformance/interfaces/pthread_cond_broadcast/1-2.c @@ -340,6 +340,7 @@ int main(int argc, char *argv[]) output("Process-shared attributes won't be tested\n"); if ((cs < 0) || (monotonic < 0)) output("Alternative clock won't be tested\n"); + fflush(stdout); #endif if (monotonic < 0) diff --git a/testcases/open_posix_testsuite/conformance/interfaces/pthread_cond_timedwait/4-2.c b/testcases/open_posix_testsuite/conformance/interfaces/pthread_cond_timedwait/4-2.c index 2a87489..46d0b90 100644 --- a/testcases/open_posix_testsuite/conformance/interfaces/pthread_cond_timedwait/4-2.c +++ b/testcases/open_posix_testsuite/conformance/interfaces/pthread_cond_timedwait/4-2.c @@ -261,6 +261,7 @@ int main(int argc, char *argv[]) output("Process-shared attributes won't be tested\n"); if ((cs < 0) || (monotonic < 0)) output("Alternative clock won't be tested\n"); + fflush(stdout); #endif /* We are not interested in testing the clock if we have no other clock available.. */ diff --git a/testcases/open_posix_testsuite/conformance/interfaces/pthread_create/3-2.c b/testcases/open_posix_testsuite/conformance/interfaces/pthread_create/3-2.c index 78f5181..fa6f665 100644 --- a/testcases/open_posix_testsuite/conformance/interfaces/pthread_create/3-2.c +++ b/testcases/open_posix_testsuite/conformance/interfaces/pthread_create/3-2.c @@ -186,6 +186,10 @@ int test_stack(pthread_attr_t * ta, size_t newsize) int status; int ret; +#ifdef VERBOSE > 0 + fflush(stdout); +#endif + child = fork(); /* We'll test the feature in another process as this test may segfault */ if (child == -1) { diff --git a/testcases/open_posix_testsuite/conformance/interfaces/pthread_exit/6-1.c b/testcases/open_posix_testsuite/conformance/interfaces/pthread_exit/6-1.c index f961a9e..dfedcf2 100644 --- a/testcases/open_posix_testsuite/conformance/interfaces/pthread_exit/6-1.c +++ b/testcases/open_posix_testsuite/conformance/interfaces/pthread_exit/6-1.c @@ -123,6 +123,10 @@ void *threaded(void *arg) if (mf > 0) *ctl = 0; +#ifdef VERBOSE > 0 + fflush(stdout); +#endif + pid = fork(); if (pid == (pid_t) - 1) { UNRESOLVED(errno, "Failed to fork()"); hooks/post-receive -- ltp |
From: Cyril H. <su...@li...> - 2013-03-21 11:21:42
|
The branch, master, has been updated via 4b3e904aadb7536585e7595ad01c070467851f35 (commit) from cb7c6910056e2cda9c29e3d2435ccbad7feeb96c (commit) - Log ----------------------------------------------------------------- commit 4b3e904aadb7536585e7595ad01c070467851f35 Author: Cyril Hrubis <ch...@su...> Date: Thu Mar 21 12:11:18 2013 +0100 testcases/.../process_stress: Silence the output. The testcase was priting "Test exiting with SUCCESS" from each child which generated hundreds of useless lines in the log. This moves the printf into the main process and the message is printed only once on the test exit. Signed-off-by: Cyril Hrubis <ch...@su...> ----------------------------------------------------------------------- Summary of changes: testcases/kernel/sched/process_stress/process.c | 2 +- 1 files changed, 1 insertions(+), 1 deletions(-) diff --git a/testcases/kernel/sched/process_stress/process.c b/testcases/kernel/sched/process_stress/process.c index 4c91425..c8def97 100644 --- a/testcases/kernel/sched/process_stress/process.c +++ b/testcases/kernel/sched/process_stress/process.c @@ -1132,6 +1132,7 @@ void messenger(void) prtln(); if (discrim) { prtln(); + printf("Test exiting with SUCCESS\n"); exit(0); } exit(1); @@ -1204,7 +1205,6 @@ void doit(void) } } - printf("Test exiting with SUCCESS\n"); exit(0); } #ifdef __64LDT__ hooks/post-receive -- ltp |
From: Cyril H. <su...@li...> - 2013-03-21 01:21:35
|
The branch, master, has been updated via cb7c6910056e2cda9c29e3d2435ccbad7feeb96c (commit) via 6d427a961bd3daaa7e8a7ff19ec03b1e5b6b81ea (commit) via 4ac1b8e96afd219cf584462948e9efe85701d425 (commit) via d990c3e692b54fa09dc7c535c884d7d9dd304abe (commit) via a9619f500cd751e0afbba228be37b27c60f2d5b7 (commit) via 4849bb30bc72fcc86be60fedaa9700cedc116edf (commit) via 798adcd32a33324c65b4cdc5cd8a624b72bb0d31 (commit) via 62d50b74687979b7188c213f6e40721ea7a01c5b (commit) via 448c1ee54a0e15dcb6b0a70032ee647f3025af7f (commit) from a312759a16639791ed9e82ccaecccb4fd02b9405 (commit) - Log ----------------------------------------------------------------- commit cb7c6910056e2cda9c29e3d2435ccbad7feeb96c Author: Jan Stancek <jst...@re...> Date: Wed Mar 20 10:44:33 2013 +0100 inode01: remove "slash" array and replace strcats with snprintf. Signed-off-by: Jan Stancek <jst...@re...> Reviewed-by: Wanlong Gao <gao...@cn...> Reviewed-by: Caspar Zhang <ca...@ca...> Signed-off-by: Wanlong Gao <gao...@cn...> commit 6d427a961bd3daaa7e8a7ff19ec03b1e5b6b81ea Author: Jan Stancek <jst...@re...> Date: Wed Mar 20 10:44:32 2013 +0100 inode02: fix "slash" array overrun Remove "slash" array and convert strcat to snprintf. Signed-off-by: Jan Stancek <jst...@re...> Reviewed-by: Wanlong Gao <gao...@cn...> Reviewed-by: Caspar Zhang <ca...@ca...> Signed-off-by: Wanlong Gao <gao...@cn...> commit 4ac1b8e96afd219cf584462948e9efe85701d425 Author: Zhouping Liu <zl...@re...> Date: Tue Mar 19 11:40:55 2013 +0800 lib/mem: removed the prefix underscore '_' of the internal function name as chrubis' suggestion, the prefix that start with _ or __ are reserved for compiler/libc implementation, inside this patch, I removed all the prefix '_' of the internal function name. Signed-off-by: Zhouping Liu <zl...@re...> Acked-by: Wanlong Gao <gao...@cn...> Reviewed-by: Caspar Zhang <ca...@ca...> Signed-off-by: Wanlong Gao <gao...@cn...> commit d990c3e692b54fa09dc7c535c884d7d9dd304abe Author: Zhouping Liu <zl...@re...> Date: Tue Mar 19 11:40:54 2013 +0800 mm/oom05: new testcase added a new case to test OOM under the combination of MEMCG and CPUSET. Signed-off-by: Zhouping Liu <zl...@re...> Acked-by: Wanlong Gao <gao...@cn...> Reviewed-by: Caspar Zhang <ca...@ca...> Signed-off-by: Wanlong Gao <gao...@cn...> commit a9619f500cd751e0afbba228be37b27c60f2d5b7 Author: Zhouping Liu <zl...@re...> Date: Tue Mar 19 11:40:53 2013 +0800 lib/mem: updated testoom() and oom() funcs the 'numa' parameter inside testoom() and 'mempolicy' inside oom() were useless, so removed them. Signed-off-by: Zhouping Liu <zl...@re...> Acked-by: Wanlong Gao <gao...@cn...> Reviewed-by: Caspar Zhang <ca...@ca...> Signed-off-by: Wanlong Gao <gao...@cn...> commit 4849bb30bc72fcc86be60fedaa9700cedc116edf Author: Zhouping Liu <zl...@re...> Date: Tue Mar 19 11:40:52 2013 +0800 mm/oom0[3|4]: added 'OOM for CPUSET' and moved 'OOM with MEMCG & numa' to oom03 OOM with the combination of memcg & numa was moved to oom03, and oom04 is re-design to be used to test 'OOM with CPUSET'. also used is_numa() instead of the old method. Signed-off-by: Zhouping Liu <zl...@re...> Acked-by: Wanlong Gao <gao...@cn...> Reviewed-by: Caspar Zhang <ca...@ca...> Signed-off-by: Wanlong Gao <gao...@cn...> commit 798adcd32a33324c65b4cdc5cd8a624b72bb0d31 Author: Zhouping Liu <zl...@re...> Date: Tue Mar 19 11:40:51 2013 +0800 numa_helper: added a new function is_numa() Added a new function is_numa(), which is desinged to judge whether a system contains more than 1 available numa nodes or not, and lots of cases need it. Signed-off-by: Zhouping Liu <zl...@re...> Acked-by: Wanlong Gao <gao...@cn...> Reviewed-by: Caspar Zhang <ca...@ca...> Signed-off-by: Wanlong Gao <gao...@cn...> commit 62d50b74687979b7188c213f6e40721ea7a01c5b Author: Zhouping Liu <zl...@re...> Date: Tue Mar 19 11:40:50 2013 +0800 mm/oom02: modified 'OOM for NUMA' as 'OOM for mempolicy' NUMA mechanism can be interpreted as 'memory policy', there are several mempolicys, such as MPOL_BIND, MPOL_INTERLEAVE, MPOL_PREFERRED etc, not only MPOL_BIND, so the patch extended OOM on NUMA system, added MPOL_INTERLEAVE and MPOL_PREFERRED mempolicy. And the patch also moved 'set_mempolicy()' from child process, and made it executed inside testoom() func, which is easy to control. Signed-off-by: Zhouping Liu <zl...@re...> Acked-by: Wanlong Gao <gao...@cn...> Reviewed-by: Caspar Zhang <ca...@ca...> Signed-off-by: Wanlong Gao <gao...@cn...> commit 448c1ee54a0e15dcb6b0a70032ee647f3025af7f Author: Zhouping Liu <zl...@re...> Date: Tue Mar 19 11:40:49 2013 +0800 lib/mem: modified _gather_cpus() as _gather_node_cpus() The previous _gather_cpus() tried to collect all the specified node's cpus, but it didn't pay attention to the offline cpus, if one cpu in the specified node were offline, it can't write the cpu number to cgroups/*.cpus, and return -EINVAL. The patch fixed it, and modified the function name, as the new name make more sense. Signed-off-by: Zhouping Liu <zl...@re...> Acked-by: Wanlong Gao <gao...@cn...> Reviewed-by: Caspar Zhang <ca...@ca...> Signed-off-by: Wanlong Gao <gao...@cn...> ----------------------------------------------------------------------- Summary of changes: runtest/mm | 1 + testcases/kernel/fs/inode/inode01.c | 26 +++-- testcases/kernel/fs/inode/inode02.c | 26 +++-- testcases/kernel/include/numa_helper.h | 1 + testcases/kernel/lib/numa_helper.c | 24 ++++ testcases/kernel/mem/include/mem.h | 4 +- testcases/kernel/mem/lib/mem.c | 149 ++++++++++++++++--------- testcases/kernel/mem/oom/oom01.c | 6 +- testcases/kernel/mem/oom/oom02.c | 20 ++- testcases/kernel/mem/oom/oom03.c | 23 ++++- testcases/kernel/mem/oom/oom04.c | 60 ++++------ testcases/kernel/mem/oom/{oom04.c => oom05.c} | 68 +++++++----- 12 files changed, 256 insertions(+), 152 deletions(-) copy testcases/kernel/mem/oom/{oom04.c => oom05.c} (72%) diff --git a/runtest/mm b/runtest/mm index a8bd605..56b83f8 100644 --- a/runtest/mm +++ b/runtest/mm @@ -77,6 +77,7 @@ oom01 oom01 oom02 oom02 oom03 oom03 oom04 oom04 +oom05 oom05 swapping01 swapping01 -i 5 diff --git a/testcases/kernel/fs/inode/inode01.c b/testcases/kernel/fs/inode/inode01.c index 9643651..b3a9a0b 100644 --- a/testcases/kernel/fs/inode/inode01.c +++ b/testcases/kernel/fs/inode/inode01.c @@ -96,7 +96,6 @@ char rm_string[200]; FILE *list_stream = NULL; int file_id; int list_id; -char slash[2]; int increment_name(), get_next_name(), mode(), escrivez(); @@ -110,9 +109,7 @@ int main() int status; int len; int term(); - - slash[0] = '/'; - slash[1] = '\0'; + int snp_ret; strcpy(path_string, "inode"); sprintf(root, "A%d", getpid()); @@ -160,9 +157,13 @@ int main() /* */ /****************************************/ - strcpy(path_list_string, path_string); - strcat(path_list_string, slash); - strcat(path_list_string, "path_list"); + snp_ret = snprintf(path_list_string, sizeof(path_list_string), + "%s/path_list", path_string); + if (snp_ret < 0 || snp_ret >= sizeof(path_list_string)) { + tst_resm(TBROK, "snprintf(path_list_string,..) returned %d", + snp_ret); + fail_exit(); + } list_id = creat(path_list_string, FILE_MODE); if (list_id == -1) { fprintf(temp, @@ -308,6 +309,7 @@ int level; /* the tree depth variable */ char new_string[PATH_STRING_LENGTH + 1]; int new_level; int i, j; /* iteration counters */ + int snp_ret; switch_flag = level & TRUE; if (strlen(string) >= MAX_PATH_STRING_LENGTH) { @@ -324,9 +326,13 @@ int level; /* the tree depth variable */ } else if (level < MAX_DEPTH) { for (i = 0; i <= MAX_BREADTH; i++) { get_next_name(); - strcpy(new_string, string); - strcat(new_string, slash); - strcat(new_string, name); + snp_ret = snprintf(new_string, sizeof(new_string), + "%s/%s", string, name); + if (snp_ret < 0 || snp_ret >= sizeof(new_string)) { + tst_resm(TBROK, "snprintf(new_string,..) " + "returned %d", snp_ret); + fail_exit(); + } /****************************************/ /* */ diff --git a/testcases/kernel/fs/inode/inode02.c b/testcases/kernel/fs/inode/inode02.c index 783edf8..54e3927 100644 --- a/testcases/kernel/fs/inode/inode02.c +++ b/testcases/kernel/fs/inode/inode02.c @@ -80,7 +80,6 @@ int nchild; FILE *list_stream = NULL; int list_id; int file_id; -char slash[1]; int increment_name(), get_next_name(), mode(), escrivez(), massmurder(); int max_depth, max_breadth, file_length; @@ -249,9 +248,7 @@ int tree() char path_list_string[PATH_STRING_LENGTH + 10]; int len; int status; - - slash[0] = '/'; - slash[1] = '\0'; + int snp_ret; /********************************/ /* */ @@ -287,9 +284,13 @@ int tree() /* */ /****************************************/ - strcpy(path_list_string, path_string); - strcat(path_list_string, slash); - strcat(path_list_string, "path_list"); + snp_ret = snprintf(path_list_string, sizeof(path_list_string), + "%s/path_list", path_string); + if (snp_ret < 0 || snp_ret >= sizeof(path_list_string)) { + tst_resm(TBROK, "snprintf(path_list_string,..) returned %d", + snp_ret); + exit(-1); + } list_id = creat(path_list_string, FILE_MODE); if (list_id == -1) { fprintf(temp, @@ -411,6 +412,7 @@ int level; /* the tree depth variable */ char new_string[PATH_STRING_LENGTH + 1]; int new_level; int i, j; /* iteration counters */ + int snp_ret; switch_flag = level & TRUE; if (strlen(string) >= MAX_PATH_STRING_LENGTH) { @@ -427,9 +429,13 @@ int level; /* the tree depth variable */ } else if (level < max_depth) { for (i = 0; i <= max_breadth; i++) { get_next_name(); - strcpy(new_string, string); - strcat(new_string, slash); - strcat(new_string, name); + snp_ret = snprintf(new_string, sizeof(new_string), + "%s/%s", string, name); + if (snp_ret < 0 || snp_ret >= sizeof(new_string)) { + tst_resm(TBROK, "snprintf(new_string,..) " + "returned %d", snp_ret); + exit(-1); + } /****************************************/ /* */ diff --git a/testcases/kernel/include/numa_helper.h b/testcases/kernel/include/numa_helper.h index 8e82d7b..251fd54 100644 --- a/testcases/kernel/include/numa_helper.h +++ b/testcases/kernel/include/numa_helper.h @@ -34,5 +34,6 @@ unsigned long get_max_node(void); int get_allowed_nodes_arr(int flag, int *num_nodes, int **nodes); int get_allowed_nodes(int flag, int count, ...); void nh_dump_nodes(); +int is_numa(void (*cleanup_fn)(void)); #endif diff --git a/testcases/kernel/lib/numa_helper.c b/testcases/kernel/lib/numa_helper.c index 4ab8e3c..4157816 100644 --- a/testcases/kernel/lib/numa_helper.c +++ b/testcases/kernel/lib/numa_helper.c @@ -265,3 +265,27 @@ void nh_dump_nodes() print_node_info(NH_CPUS); print_node_info(NH_MEMS | NH_CPUS); } + +/* + * is_numa - judge a system is NUMA system or not + * NOTE: the function is designed to try to find more than + * 1 available node, at least each node contains memory. + * WARN: Don't use this func in child, as it calls tst_brkm() + * RETURNS: + * 0 - it's not a NUMA system + * 1 - it's a NUMA system + */ +int is_numa(void (*cleanup_fn)(void)) +{ + int ret; + int numa_nodes = 0; + + ret = get_allowed_nodes_arr(NH_MEMS, &numa_nodes, NULL); + if (ret < 0) + tst_brkm(TBROK | TERRNO, cleanup_fn, "get_allowed_nodes_arr"); + + if (numa_nodes > 1) + return 1; + else + return 0; +} diff --git a/testcases/kernel/mem/include/mem.h b/testcases/kernel/mem/include/mem.h index 1233493..fdf558e 100644 --- a/testcases/kernel/mem/include/mem.h +++ b/testcases/kernel/mem/include/mem.h @@ -25,8 +25,8 @@ #define KSM 4 long overcommit; -void oom(int testcase, int mempolicy, int lite); -void testoom(int mempolicy, int lite, int numa); +void oom(int testcase, int lite); +void testoom(int mempolicy, int lite); /* KSM */ diff --git a/testcases/kernel/mem/lib/mem.c b/testcases/kernel/mem/lib/mem.c index a827b25..c9525e5 100644 --- a/testcases/kernel/mem/lib/mem.c +++ b/testcases/kernel/mem/lib/mem.c @@ -20,13 +20,14 @@ #include "test.h" #include "usctest.h" #include "safe_macros.h" +#include "safe_file_ops.h" #include "_private.h" #include "mem.h" #include "numa_helper.h" /* OOM */ -static int _alloc_mem(long int length, int testcase) +static int alloc_mem(long int length, int testcase) { void *s; @@ -50,46 +51,31 @@ static int _alloc_mem(long int length, int testcase) return 0; } -static void _test_alloc(int testcase, int lite) +static void test_alloc(int testcase, int lite) { if (lite) - _alloc_mem(TESTMEM + MB, testcase); + alloc_mem(TESTMEM + MB, testcase); else while (1) - if (_alloc_mem(LENGTH, testcase)) + if (alloc_mem(LENGTH, testcase)) return; } -void oom(int testcase, int mempolicy, int lite) +void oom(int testcase, int lite) { pid_t pid; int status; -#if HAVE_NUMA_H && HAVE_LINUX_MEMPOLICY_H && HAVE_NUMAIF_H \ - && HAVE_MPOL_CONSTANTS - unsigned long nmask = 0; - unsigned int node; - - if (mempolicy) - node = get_a_numa_node(cleanup); - nmask += 1 << node; -#endif switch (pid = fork()) { case -1: tst_brkm(TBROK | TERRNO, cleanup, "fork"); case 0: -#if HAVE_NUMA_H && HAVE_LINUX_MEMPOLICY_H && HAVE_NUMAIF_H \ - && HAVE_MPOL_CONSTANTS - if (mempolicy) - if (set_mempolicy(MPOL_BIND, &nmask, MAXNODES) == -1) - tst_brkm(TBROK | TERRNO, cleanup, - "set_mempolicy"); -#endif - _test_alloc(testcase, lite); + test_alloc(testcase, lite); exit(0); default: break; } + tst_resm(TINFO, "expected victim is %d.", pid); if (waitpid(-1, &status, 0) == -1) tst_brkm(TBROK | TERRNO, cleanup, "waitpid"); @@ -105,29 +91,65 @@ void oom(int testcase, int mempolicy, int lite) } } -void testoom(int mempolicy, int lite, int numa) +void testoom(int mempolicy, int lite) { - long nodes[MAXNODES]; +#if HAVE_NUMA_H && HAVE_LINUX_MEMPOLICY_H && HAVE_NUMAIF_H \ + && HAVE_MPOL_CONSTANTS + unsigned long nmask = 0; + unsigned int num_nodes, *nodes; + int ret; - if (numa && !mempolicy) - write_cpusets(get_a_numa_node(cleanup)); + if (mempolicy) { + ret = get_allowed_nodes_arr(NH_MEMS|NH_CPUS, &num_nodes, &nodes); + if (ret != 0) + tst_brkm(TBROK|TERRNO, cleanup, + "get_allowed_nodes_arr"); + if (num_nodes < 2) { + tst_resm(TINFO, "mempolicy need NUMA system support"); + free(nodes); + return; + } + switch(mempolicy) { + case MPOL_BIND: + /* bind the second node */ + nmask = 1 << nodes[1]; + break; + case MPOL_INTERLEAVE: + case MPOL_PREFERRED: + if (num_nodes == 2) { + tst_resm(TINFO, "The mempolicy need " + "more than 2 numa nodes"); + free(nodes); + return; + } else { + /* Using the 2nd,3rd node */ + nmask = (1 << nodes[1]) | (1 << nodes[2]); + } + break; + default: + tst_brkm(TBROK|TERRNO, cleanup, "Bad mempolicy mode"); + } + if (set_mempolicy(mempolicy, &nmask, MAXNODES) == -1) + tst_brkm(TBROK|TERRNO, cleanup, "set_mempolicy"); + } +#endif tst_resm(TINFO, "start normal OOM testing."); - oom(NORMAL, mempolicy, lite); + oom(NORMAL, lite); tst_resm(TINFO, "start OOM testing for mlocked pages."); - oom(MLOCK, mempolicy, lite); + oom(MLOCK, lite); if (access(PATH_KSM, F_OK) == -1) tst_brkm(TCONF, NULL, "KSM configuration is not enabled"); tst_resm(TINFO, "start OOM testing for KSM pages."); - oom(KSM, mempolicy, lite); + oom(KSM, lite); } /* KSM */ -static void _check(char *path, long int value) +static void check(char *path, long int value) { FILE *fp; char buf[BUFSIZ], fullpath[BUFSIZ]; @@ -142,7 +164,7 @@ static void _check(char *path, long int value) tst_resm(TFAIL, "%s is not %ld.", path, value); } -static void _wait_ksmd_done(void) +static void wait_ksmd_done(void) { char buf[BUFSIZ]; long pages_shared, pages_sharing, pages_volatile, pages_unshared; @@ -183,24 +205,24 @@ static void _wait_ksmd_done(void) count * 10); } -static void _group_check(int run, int pages_shared, int pages_sharing, +static void group_check(int run, int pages_shared, int pages_sharing, int pages_volatile, int pages_unshared, int sleep_millisecs, int pages_to_scan) { /* wait for ksm daemon to scan all mergeable pages. */ - _wait_ksmd_done(); + wait_ksmd_done(); tst_resm(TINFO, "check!"); - _check("run", run); - _check("pages_shared", pages_shared); - _check("pages_sharing", pages_sharing); - _check("pages_volatile", pages_volatile); - _check("pages_unshared", pages_unshared); - _check("sleep_millisecs", sleep_millisecs); - _check("pages_to_scan", pages_to_scan); + check("run", run); + check("pages_shared", pages_shared); + check("pages_sharing", pages_sharing); + check("pages_volatile", pages_volatile); + check("pages_unshared", pages_unshared); + check("sleep_millisecs", sleep_millisecs); + check("pages_to_scan", pages_to_scan); } -static void _verify(char **memory, char value, int proc, +static void verify(char **memory, char value, int proc, int start, int end, int start2, int end2) { int i, j; @@ -309,12 +331,12 @@ static void create_ksm_child(int child_num, int size, int unit, tst_brkm(TBROK|TERRNO, tst_exit, "kill"); if (ksm_merge_data[j].mergeable_size < size * MB) { - _verify(memory, 'e', child_num, total_unit - 1, + verify(memory, 'e', child_num, total_unit - 1, total_unit, unit * MB - 1, unit * MB); - _verify(memory, ksm_merge_data[j].data, child_num, + verify(memory, ksm_merge_data[j].data, child_num, 0, total_unit, 0, unit * MB - 1); } else { - _verify(memory, ksm_merge_data[j].data, child_num, + verify(memory, ksm_merge_data[j].data, child_num, 0, total_unit, 0, unit * MB); } } @@ -415,19 +437,19 @@ void create_same_memory(int size, int num, int unit) write_file(PATH_KSM "sleep_millisecs", "0"); resume_ksm_children(child, num); - _group_check(1, 2, size * num * pages - 2, 0, 0, 0, size * pages * num); + group_check(1, 2, size * num * pages - 2, 0, 0, 0, size * pages * num); stop_ksm_children(child, num); resume_ksm_children(child, num); - _group_check(1, 3, size * num * pages - 3, 0, 0, 0, size * pages * num); + group_check(1, 3, size * num * pages - 3, 0, 0, 0, size * pages * num); stop_ksm_children(child, num); resume_ksm_children(child, num); - _group_check(1, 1, size * num * pages - 1, 0, 0, 0, size * pages * num); + group_check(1, 1, size * num * pages - 1, 0, 0, 0, size * pages * num); stop_ksm_children(child, num); resume_ksm_children(child, num); - _group_check(1, 1, size * num * pages - 2, 0, 1, 0, size * pages * num); + group_check(1, 1, size * num * pages - 2, 0, 1, 0, size * pages * num); stop_ksm_children(child, num); @@ -435,11 +457,11 @@ void create_same_memory(int size, int num, int unit) write_file(PATH_KSM "run", "2"); resume_ksm_children(child, num); - _group_check(2, 0, 0, 0, 0, 0, size * pages * num); + group_check(2, 0, 0, 0, 0, 0, size * pages * num); tst_resm(TINFO, "stop KSM."); write_file(PATH_KSM "run", "0"); - _group_check(0, 0, 0, 0, 0, 0, size * pages * num); + group_check(0, 0, 0, 0, 0, 0, size * pages * num); while (waitpid(-1, &status, WUNTRACED | WCONTINUED) > 0) if (WEXITSTATUS(status) != 0) @@ -481,20 +503,37 @@ void ksm_usage(void) /* cpuset/memcg */ -static void _gather_cpus(char *cpus, long nd) +static void gather_node_cpus(char *cpus, long nd) { int ncpus = 0; int i; + long online; char buf[BUFSIZ]; + char path[BUFSIZ], path1[BUFSIZ]; while (path_exist(PATH_SYS_SYSTEM "/cpu/cpu%d", ncpus)) ncpus++; - for (i = 0; i < ncpus; i++) - if (path_exist(PATH_SYS_SYSTEM "/node/node%ld/cpu%d", nd, i)) { + for (i = 0; i < ncpus; i++) { + snprintf(path, BUFSIZ, + PATH_SYS_SYSTEM "/node/node%ld/cpu%d", nd, i); + if (path_exist(path, nd, i)) { + snprintf(path1, BUFSIZ, "%s/online", path); + /* + * No cpu0/online knob, as it can't support to + * on/offline cpu0, so if the 'nd' node contains + * cpu0, it should skip to check cpu0/online's value. + */ + if (i == 0) + goto next; + SAFE_FILE_SCANF(cleanup, path1, "%ld", &online); + if (online == 0) + continue; +next: sprintf(buf, "%d,", i); strcat(cpus, buf); } + } /* Remove the trailing comma. */ cpus[strlen(cpus) - 1] = '\0'; } @@ -563,7 +602,7 @@ void write_cpusets(long nd) snprintf(buf, BUFSIZ, "%ld", nd); write_cpuset_files(CPATH_NEW, "mems", buf); - _gather_cpus(cpus, nd); + gather_node_cpus(cpus, nd); write_cpuset_files(CPATH_NEW, "cpus", cpus); snprintf(buf, BUFSIZ, "%d", getpid()); diff --git a/testcases/kernel/mem/oom/oom01.c b/testcases/kernel/mem/oom/oom01.c index 0401e31..43a5319 100644 --- a/testcases/kernel/mem/oom/oom01.c +++ b/testcases/kernel/mem/oom/oom01.c @@ -61,13 +61,13 @@ int main(int argc, char *argv[]) tst_count = 0; set_sys_tune("overcommit_memory", 2, 1); - oom(OVERCOMMIT, 0, 0); + oom(OVERCOMMIT, 0); set_sys_tune("overcommit_memory", 0, 1); - oom(OVERCOMMIT, 0, 0); + oom(OVERCOMMIT, 0); set_sys_tune("overcommit_memory", 1, 1); - testoom(0, 0, 0); + testoom(0, 0); } cleanup(); tst_exit(); diff --git a/testcases/kernel/mem/oom/oom02.c b/testcases/kernel/mem/oom/oom02.c index abd8aa2..1fd199b 100644 --- a/testcases/kernel/mem/oom/oom02.c +++ b/testcases/kernel/mem/oom/oom02.c @@ -1,5 +1,5 @@ /* - * Out Of Memory (OOM) for NUMA + * Out Of Memory (OOM) for mempolicy - need NUMA system support * * The program is designed to cope with unpredictable like amount and * system physical memory, swap size and other VMM technology like KSM, @@ -35,6 +35,7 @@ #include <errno.h> #include <fcntl.h> #include <stdio.h> +#include "numa_helper.h" #include "test.h" #include "usctest.h" #include "mem.h" @@ -44,6 +45,7 @@ int TST_TOTAL = 1; #if HAVE_NUMA_H && HAVE_LINUX_MEMPOLICY_H && HAVE_NUMAIF_H \ && HAVE_MPOL_CONSTANTS + int main(int argc, char *argv[]) { char *msg; @@ -62,11 +64,14 @@ int main(int argc, char *argv[]) for (lc = 0; TEST_LOOPING(lc); lc++) { tst_count = 0; - tst_resm(TINFO, "process mempolicy."); - testoom(1, 0, 1); + tst_resm(TINFO, "OOM on MPOL_BIND mempolicy..."); + testoom(MPOL_BIND, 0); + + tst_resm(TINFO, "OOM on MPOL_INTERLEAVE mempolicy..."); + testoom(MPOL_INTERLEAVE, 0); - tst_resm(TINFO, "process cpuset."); - testoom(0, 0, 1); + tst_resm(TINFO, "OOM on MPOL_PREFERRED mempolicy..."); + testoom(MPOL_PREFERRED, 0); } cleanup(); tst_exit(); @@ -78,15 +83,16 @@ void setup(void) tst_sig(FORK, DEF_HANDLER, cleanup); TEST_PAUSE; + if (!is_numa(NULL)) + tst_brkm(TCONF, NULL, "The case need a NUMA system."); + overcommit = get_sys_tune("overcommit_memory"); set_sys_tune("overcommit_memory", 1, 1); - mount_mem("cpuset", "cpuset", NULL, CPATH, CPATH_NEW); } void cleanup(void) { set_sys_tune("overcommit_memory", overcommit, 0); - umount_mem(CPATH, CPATH_NEW); TEST_CLEANUP; } diff --git a/testcases/kernel/mem/oom/oom03.c b/testcases/kernel/mem/oom/oom03.c index 95e34d5..124e95f 100644 --- a/testcases/kernel/mem/oom/oom03.c +++ b/testcases/kernel/mem/oom/oom03.c @@ -33,6 +33,7 @@ #include <errno.h> #include <fcntl.h> #include <stdio.h> +#include "numa_helper.h" #include "test.h" #include "usctest.h" #include "mem.h" @@ -40,6 +41,9 @@ char *TCID = "oom03"; int TST_TOTAL = 1; +#if HAVE_NUMA_H && HAVE_LINUX_MEMPOLICY_H && HAVE_NUMAIF_H \ + && HAVE_MPOL_CONSTANTS + int main(int argc, char *argv[]) { char *msg; @@ -64,7 +68,7 @@ int main(int argc, char *argv[]) snprintf(mem, BUFSIZ, "%ld", TESTMEM); write_file(MEMCG_PATH_NEW "/memory.limit_in_bytes", mem); - testoom(0, 0, 0); + testoom(0, 0); if (access(MEMCG_SW_LIMIT, F_OK) == -1) { if (errno == ENOENT) @@ -74,7 +78,15 @@ int main(int argc, char *argv[]) tst_brkm(TBROK | TERRNO, cleanup, "access"); } else { write_file(MEMCG_SW_LIMIT, mem); - testoom(0, 1, 0); + testoom(0, 1); + } + + /* OOM for MEMCG with mempolicy */ + if (is_numa(cleanup)) { + tst_resm(TINFO, "OOM on MEMCG & mempolicy..."); + testoom(MPOL_BIND, 0); + testoom(MPOL_INTERLEAVE, 0); + testoom(MPOL_PREFERRED, 0); } } cleanup(); @@ -99,3 +111,10 @@ void cleanup(void) TEST_CLEANUP; } + +#else +int main(void) +{ + tst_brkm(TCONF, NULL, "no NUMA development packages installed."); +} +#endif diff --git a/testcases/kernel/mem/oom/oom04.c b/testcases/kernel/mem/oom/oom04.c index bc51046..4d3f2f4 100644 --- a/testcases/kernel/mem/oom/oom04.c +++ b/testcases/kernel/mem/oom/oom04.c @@ -1,5 +1,5 @@ /* - * Out Of Memory (OOM) for Memory Resource Controller and NUMA + * Out Of Memory (OOM) for CPUSET * * The program is designed to cope with unpredictable like amount and * system physical memory, swap size and other VMM technology like KSM, @@ -35,6 +35,7 @@ #include <errno.h> #include <fcntl.h> #include <stdio.h> +#include "numa_helper.h" #include "test.h" #include "usctest.h" #include "mem.h" @@ -44,12 +45,11 @@ int TST_TOTAL = 1; #if HAVE_NUMA_H && HAVE_LINUX_MEMPOLICY_H && HAVE_NUMAIF_H \ && HAVE_MPOL_CONSTANTS + int main(int argc, char *argv[]) { char *msg; int lc; - int swap_acc_on = 1; - char buf[BUFSIZ], mem[BUFSIZ]; msg = parse_opts(argc, argv, NULL, NULL); if (msg != NULL) @@ -64,38 +64,19 @@ int main(int argc, char *argv[]) for (lc = 0; TEST_LOOPING(lc); lc++) { tst_count = 0; - snprintf(buf, BUFSIZ, "%d", getpid()); - write_file(MEMCG_PATH_NEW "/tasks", buf); - - snprintf(mem, BUFSIZ, "%ld", TESTMEM); - write_file(MEMCG_PATH_NEW "/memory.limit_in_bytes", mem); - - if (access(MEMCG_SW_LIMIT, F_OK) == -1) { - if (errno == ENOENT) { - tst_resm(TCONF, - "memcg swap accounting is disabled"); - swap_acc_on = 0; - } else - tst_brkm(TBROK | TERRNO, cleanup, "access"); - } - - tst_resm(TINFO, "process mempolicy."); - testoom(1, 0, 1); - - if (swap_acc_on) { - write_file(MEMCG_SW_LIMIT, mem); - testoom(1, 1, 1); - } - - tst_resm(TINFO, "process cpuset."); - - if (swap_acc_on) - write_file(MEMCG_SW_LIMIT, "-1"); - testoom(0, 0, 1); - - if (swap_acc_on) { - write_file(MEMCG_SW_LIMIT, mem); - testoom(0, 1, 1); + tst_resm(TINFO, "OOM on CPUSET..."); + testoom(0, 0); + + if (is_numa(cleanup)) { + /* + * Under NUMA system, the migration of cpuset's memory + * is in charge of cpuset.memory_migrate, we can write + * 1 to cpuset.memory_migrate to enable the migration. + */ + write_cpuset_files(CPATH_NEW, + "memory_migrate", "1"); + tst_resm(TINFO, "OOM on CPUSET with mem migrate:"); + testoom(0, 0); } } cleanup(); @@ -110,15 +91,20 @@ void setup(void) overcommit = get_sys_tune("overcommit_memory"); set_sys_tune("overcommit_memory", 1, 1); + mount_mem("cpuset", "cpuset", NULL, CPATH, CPATH_NEW); - mount_mem("memcg", "cgroup", "memory", MEMCG_PATH, MEMCG_PATH_NEW); + if (is_numa(cleanup) > 0) + /* For NUMA system, using the first node for cpuset.mems */ + write_cpusets(get_a_numa_node(cleanup)); + else + /* For nonNUMA system, using node0 for cpuset.mems */ + write_cpusets(0); } void cleanup(void) { set_sys_tune("overcommit_memory", overcommit, 0); umount_mem(CPATH, CPATH_NEW); - umount_mem(MEMCG_PATH, MEMCG_PATH_NEW); TEST_CLEANUP; } diff --git a/testcases/kernel/mem/oom/oom04.c b/testcases/kernel/mem/oom/oom05.c similarity index 72% copy from testcases/kernel/mem/oom/oom04.c copy to testcases/kernel/mem/oom/oom05.c index bc51046..cd45f08 100644 --- a/testcases/kernel/mem/oom/oom04.c +++ b/testcases/kernel/mem/oom/oom05.c @@ -1,5 +1,5 @@ /* - * Out Of Memory (OOM) for Memory Resource Controller and NUMA + * Out Of Memory (OOM) for MEMCG and CPUSET * * The program is designed to cope with unpredictable like amount and * system physical memory, swap size and other VMM technology like KSM, @@ -7,7 +7,7 @@ * behaviours. It simply increase the memory consumption 3G each time * until all the available memory is consumed and OOM is triggered. * - * Copyright (C) 2010 Red Hat, Inc. + * Copyright (C) 2013 Red Hat, Inc. * 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. @@ -35,21 +35,23 @@ #include <errno.h> #include <fcntl.h> #include <stdio.h> +#include "numa_helper.h" #include "test.h" #include "usctest.h" #include "mem.h" -char *TCID = "oom04"; +char *TCID = "oom05"; int TST_TOTAL = 1; #if HAVE_NUMA_H && HAVE_LINUX_MEMPOLICY_H && HAVE_NUMAIF_H \ && HAVE_MPOL_CONSTANTS + int main(int argc, char *argv[]) { char *msg; int lc; int swap_acc_on = 1; - char buf[BUFSIZ], mem[BUFSIZ]; + char mem[BUFSIZ]; msg = parse_opts(argc, argv, NULL, NULL); if (msg != NULL) @@ -64,11 +66,20 @@ int main(int argc, char *argv[]) for (lc = 0; TEST_LOOPING(lc); lc++) { tst_count = 0; - snprintf(buf, BUFSIZ, "%d", getpid()); - write_file(MEMCG_PATH_NEW "/tasks", buf); - - snprintf(mem, BUFSIZ, "%ld", TESTMEM); - write_file(MEMCG_PATH_NEW "/memory.limit_in_bytes", mem); + tst_resm(TINFO, "OOM on CPUSET & MEMCG..."); + testoom(0, 0); + + /* + * Under NUMA system, the migration of cpuset's memory + * is in charge of cpuset.memory_migrate, we can write + * 1 to cpuset.memory_migrate to enable the migration. + */ + if (is_numa(cleanup)) { + write_cpuset_files(CPATH_NEW, "memory_migrate", "1"); + tst_resm(TINFO, "OOM on CPUSET & MEMCG with " + "cpuset.memory_migrate=1"); + testoom(0, 0); + } if (access(MEMCG_SW_LIMIT, F_OK) == -1) { if (errno == ENOENT) { @@ -76,28 +87,23 @@ int main(int argc, char *argv[]) "memcg swap accounting is disabled"); swap_acc_on = 0; } else - tst_brkm(TBROK | TERRNO, cleanup, "access"); + tst_brkm(TBROK|TERRNO, cleanup, "access"); } - tst_resm(TINFO, "process mempolicy."); - testoom(1, 0, 1); - if (swap_acc_on) { + tst_resm(TINFO, "OOM on CPUSET & MEMCG with " + "special memswap limitation:"); + snprintf(mem, BUFSIZ, "%ld", TESTMEM); write_file(MEMCG_SW_LIMIT, mem); - testoom(1, 1, 1); - } + testoom(0, 0); - tst_resm(TINFO, "process cpuset."); - - if (swap_acc_on) + tst_resm(TINFO, "OOM on CPUSET & MEMCG with " + "disabled memswap limitation:"); write_file(MEMCG_SW_LIMIT, "-1"); - testoom(0, 0, 1); - - if (swap_acc_on) { - write_file(MEMCG_SW_LIMIT, mem); - testoom(0, 1, 1); + testoom(0, 0); } } + cleanup(); tst_exit(); } @@ -108,10 +114,20 @@ void setup(void) tst_sig(FORK, DEF_HANDLER, cleanup); TEST_PAUSE; - overcommit = get_sys_tune("overcommit_memory"); - set_sys_tune("overcommit_memory", 1, 1); - mount_mem("cpuset", "cpuset", NULL, CPATH, CPATH_NEW); mount_mem("memcg", "cgroup", "memory", MEMCG_PATH, MEMCG_PATH_NEW); + mount_mem("cpuset", "cpuset", NULL, CPATH, CPATH_NEW); + write_memcg(); + + set_sys_tune("overcommit_memory", 1, 1); + + if (is_numa(cleanup)) + /* For NUMA system, using the first node for cpuset.mems */ + write_cpusets(get_a_numa_node(cleanup)); + else + /* For nonNUMA system, using node0 for cpuset.mems */ + write_cpusets(0); + + overcommit = get_sys_tune("overcommit_memory"); } void cleanup(void) hooks/post-receive -- ltp |
From: Mike F. <su...@li...> - 2013-03-20 21:36:49
|
The branch, master, has been updated via a312759a16639791ed9e82ccaecccb4fd02b9405 (commit) from 6005e8529facd9b3236276c68b2551aebc8a7c44 (commit) - Log ----------------------------------------------------------------- commit a312759a16639791ed9e82ccaecccb4fd02b9405 Author: Mike Frysinger <va...@ge...> Date: Wed Mar 20 17:31:05 2013 -0400 getcwd: use TERRNO flag rather than manual errno=%d Signed-off-by: Mike Frysinger <va...@ge...> ----------------------------------------------------------------------- Summary of changes: testcases/kernel/syscalls/getcwd/getcwd02.c | 24 ++++++++---------------- testcases/kernel/syscalls/getcwd/getcwd03.c | 9 +++------ 2 files changed, 11 insertions(+), 22 deletions(-) diff --git a/testcases/kernel/syscalls/getcwd/getcwd02.c b/testcases/kernel/syscalls/getcwd/getcwd02.c index 335ae9d..0a3dfcd 100644 --- a/testcases/kernel/syscalls/getcwd/getcwd02.c +++ b/testcases/kernel/syscalls/getcwd/getcwd02.c @@ -86,7 +86,7 @@ char *cwd_ptr = NULL; //catches the return value from getcwd() when passing cwd int main(int ac, char **av) { FILE *fin; - char *cp, *cp_cur; + char *cp; int lc; char *msg; /* parse_opts() return message */ @@ -110,7 +110,6 @@ int main(int ac, char **av) tst_brkm(TBROK, cleanup, "pwd output too long"); } *cp = 0; - cp_cur = pwd_buf; } pclose(fin); @@ -132,8 +131,7 @@ void do_block1(void) //valid cwd[]: -> Should work fine tst_resm(TINFO, "Enter Block 1"); if ((cwd_ptr = getcwd(cwd, sizeof(cwd))) == NULL) { - tst_resm(TFAIL, "getcwd() failed unexpectedly: " - "errno = %d\n", errno); + tst_resm(TFAIL|TERRNO, "getcwd() failed unexpectedly"); flag = FAILED; } if ((flag != FAILED) && (strcmp(pwd_buf, cwd) != 0)) { @@ -156,8 +154,7 @@ void do_block2(void) //valid cwd[], size = 0: -> Should return NULL, errno = EI if (((cwd_ptr = getcwd(cwd, 0)) == NULL) && (errno != EINVAL)) { - tst_resm(TFAIL, "getcwd() failed unexpectedly: " - "errno = %d expected EINVAL(%d)\n", errno, EINVAL); + tst_resm(TFAIL|TERRNO, "getcwd() failed unexpectedly (wanted EINVAL)"); flag = FAILED; } tst_resm(TINFO, "Exit Block 2"); @@ -175,8 +172,7 @@ void do_block3(void) //valid cwd[], size = 1 -> Should return NULL, errno = ERA if (((cwd_ptr = getcwd(cwd, 1)) != NULL) || (errno != ERANGE)) { - tst_resm(TFAIL, "getcwd() failed unexpectedly: " - "errno = %d, expected ERANGE(%d)\n", errno, ERANGE); + tst_resm(TFAIL|TERRNO, "getcwd() failed unexpectedly (wanted ERANGE)"); flag = FAILED; } tst_resm(TINFO, "Exit Block 3"); @@ -196,8 +192,7 @@ void do_block4(void) //invalid cwd[] = -1, size = BUFSIZ: -> return NULL, errno if (((cwd_ptr = getcwd((char *)-1, sizeof(cwd))) != NULL) || (errno != EFAULT)) { - tst_resm(TFAIL, "getcwd() failed unexpectedly: " - "errno = %d, expected EFAULT(%d)\n", errno, EFAULT); + tst_resm(TFAIL|TERRNO, "getcwd() failed unexpectedly (wanted EFAULT)"); flag = FAILED; } tst_resm(TINFO, "Exit Block 4"); @@ -217,8 +212,7 @@ void do_block5(void) //buffer = NULL, and size = 0, should succeed tst_resm(TINFO, "Enter Block 5"); if ((buffer = getcwd(NULL, 0)) == NULL) { - tst_resm(TFAIL, "getcwd() failed unexpectedly: " - "errno = %d\n", errno); + tst_resm(TFAIL|TERRNO, "getcwd() failed unexpectedly"); flag = FAILED; } if ((flag != FAILED) && (strcmp(pwd_buf, buffer) != 0)) { @@ -243,8 +237,7 @@ void do_block6(void) //buffer = NULL, size = 1: -> return NULL, errno = ERANGE if (((buffer = getcwd(NULL, 1)) != NULL) || (errno != ERANGE)) { - tst_resm(TFAIL, "getcwd() failed unexpectedly: " - "errno = %d, expected ERANGE(%d)\n", errno, ERANGE); + tst_resm(TFAIL|TERRNO, "getcwd() failed unexpectedly (wanted ERANGE)"); flag = FAILED; } tst_resm(TINFO, "Exit Block 6"); @@ -261,8 +254,7 @@ void do_block7(void) //buffer = NULL, size = BUFSIZ: -> work fine, allocate buf tst_resm(TINFO, "Enter Block 7"); if ((buffer = getcwd(NULL, sizeof(cwd))) == NULL) { - tst_resm(TFAIL, "getcwd() failed unexpectedly: " - "errno = %d\n", errno); + tst_resm(TFAIL|TERRNO, "getcwd() failed unexpectedly"); flag = FAILED; } if ((flag != FAILED) && (strcmp(pwd_buf, buffer) != 0)) { diff --git a/testcases/kernel/syscalls/getcwd/getcwd03.c b/testcases/kernel/syscalls/getcwd/getcwd03.c index eecbd17..575ed39 100644 --- a/testcases/kernel/syscalls/getcwd/getcwd03.c +++ b/testcases/kernel/syscalls/getcwd/getcwd03.c @@ -109,8 +109,7 @@ int main(int ac, char **av) pwd1 = getpwd(); if (getcwd(cwd1, sizeof cwd1) == NULL) { - tst_resm(TFAIL, "getcwd() failed unexpectedly: " - "errno = %d\n", errno); + tst_resm(TFAIL|TERRNO, "getcwd() failed unexpectedly"); flag = FAILED; } if ((flag != FAILED) && (strcmp(pwd1, cwd1) != 0)) { @@ -142,8 +141,7 @@ int main(int ac, char **av) pwd2 = getpwd(); if (getcwd(cwd2, sizeof cwd2) == NULL) { - tst_resm(TFAIL, "getcwd() failed unexpectedly: " - "errno = %d\n", errno); + tst_resm(TFAIL|TERRNO, "getcwd() failed unexpectedly"); flag = FAILED; } @@ -227,7 +225,7 @@ char *getpwd(void) { FILE *fin; char *pwd = "/bin/pwd"; - char *cp, *cp_cur; + char *cp; char *buf; buf = (char *)malloc(BUFSIZ); @@ -240,7 +238,6 @@ char *getpwd(void) tst_brkm(TBROK, cleanup, "pwd output too long"); } *cp = 0; - cp_cur = buf; } pclose(fin); return buf; hooks/post-receive -- ltp |
From: Cyril H. <su...@li...> - 2013-03-20 15:22:23
|
The branch, master, has been updated via 6005e8529facd9b3236276c68b2551aebc8a7c44 (commit) via a96844a33d5e503ab7b1a0a54c854a590b8b3ede (commit) via 51d5409ac75a1ab05f11d762fbd7a7064ecc896b (commit) via 6999832824d0adc65035ad3f68a8cc4019b43df4 (commit) via 77172baeea872a24c56e774ddc7bbe48ab4ca27b (commit) via 875b62c7f30c91860f44c9858f64fd716edf0384 (commit) via 45043ce5febf22cb3273749bcf2d039b4ba4e5ec (commit) via 0dabe0a4520ac60f5ae9b7c22d98a45d80d31134 (commit) via 34d0e8b98cd31d8d5d1857ef8209c6cf6ff38012 (commit) via 9d87b92bf1aaff8b1b241742b3af96d3c5d290a8 (commit) via 9cfdedaa7deeeff1697de9deb1996d0b6e0bbb6b (commit) via 03dee2cd7eeadf35b2944787932aa657674e1226 (commit) via 9a80a134e68e152b9809dfaffd3afe890ff96ae1 (commit) via 95c6e6de49d9dd3f2be3bb7f3efc450956dd7cbe (commit) via 93c4a17cd925020e77bc164adeea549a4858a651 (commit) via 6551579d61e7fc3fd429659ba9207679e04173d7 (commit) from ff4e69314c1b1316b83b240248da49de63af7b39 (commit) - Log ----------------------------------------------------------------- commit 6005e8529facd9b3236276c68b2551aebc8a7c44 Author: Cyril Hrubis <ch...@su...> Date: Wed Mar 20 15:38:14 2013 +0100 open_posix_testsuite/.../mlockall: Fix. Include header for mkstemp(). Change main() to main(void). Signed-off-by: Cyril Hrubis <ch...@su...> commit a96844a33d5e503ab7b1a0a54c854a590b8b3ede Author: Cyril Hrubis <ch...@su...> Date: Wed Mar 20 15:36:28 2013 +0100 open_posix_testsuite/.../killpg: Fix. Silence unused sighandler warning. Remove unused sighandler. Use signal-async-safe _exit() instead of exit(). Signed-off-by: Cyril Hrubis <ch...@su...> commit 51d5409ac75a1ab05f11d762fbd7a7064ecc896b Author: Cyril Hrubis <ch...@su...> Date: Wed Mar 20 15:29:32 2013 +0100 open_posix_testsuite/.../kill: Fix. Silence unused sighandler warning. Use signal-async-safe _exit() instead of exit(). Unify tests passed output to "Test PASSED" Signed-off-by: Cyril Hrubis <ch...@su...> commit 6999832824d0adc65035ad3f68a8cc4019b43df4 Author: Cyril Hrubis <ch...@su...> Date: Wed Mar 20 15:26:50 2013 +0100 open_posix_testsuite/.../getpid: Cleanup. Remove useless comments. Signed-off-by: Cyril Hrubis <ch...@su...> commit 77172baeea872a24c56e774ddc7bbe48ab4ca27b Author: Cyril Hrubis <ch...@su...> Date: Wed Mar 20 15:25:29 2013 +0100 open_posix_testsuite/.../getpid: Fix. Remove unused variables argc and argv. Signed-off-by: Cyril Hrubis <ch...@su...> commit 875b62c7f30c91860f44c9858f64fd716edf0384 Author: Cyril Hrubis <ch...@su...> Date: Wed Mar 20 15:20:02 2013 +0100 open_posix_testsuite/.../fork: Cleanup. Remove useless comments. Signed-off-by: Cyril Hrubis <ch...@su...> commit 45043ce5febf22cb3273749bcf2d039b4ba4e5ec Author: Cyril Hrubis <ch...@su...> Date: Wed Mar 20 15:08:31 2013 +0100 open_posix_testsuite/.../fork: Fix. Remove unused variables argc and argv. Silence unused warning in thread function. Signed-off-by: Cyril Hrubis <ch...@su...> commit 0dabe0a4520ac60f5ae9b7c22d98a45d80d31134 Author: Cyril Hrubis <ch...@su...> Date: Wed Mar 20 15:07:46 2013 +0100 open_posix_testsuite: Fix warning in testfrmw.c Signed-off-by: Cyril Hrubis <ch...@su...> commit 34d0e8b98cd31d8d5d1857ef8209c6cf6ff38012 Author: Cyril Hrubis <ch...@su...> Date: Wed Mar 20 15:03:13 2013 +0100 open_posix_testsuite/.../clock_settime: Fix. Remove unused variables argc and argv. Include header for geteuid(). Silence unused warnings for sighandler. Signed-off-by: Cyril Hrubis <ch...@su...> commit 9d87b92bf1aaff8b1b241742b3af96d3c5d290a8 Author: Cyril Hrubis <ch...@su...> Date: Wed Mar 20 14:52:15 2013 +0100 open_posix_testsuite/.../clock_nanosleep: Fix. Remove unused variables argc and argv. Silence unused warnings for sighandler. Signed-off-by: Cyril Hrubis <ch...@su...> commit 9cfdedaa7deeeff1697de9deb1996d0b6e0bbb6b Author: Cyril Hrubis <ch...@su...> Date: Wed Mar 20 14:48:39 2013 +0100 open_posix_testsuite/.../clock_gettime: Fix. Remove unused variables argc and argv. Signed-off-by: Cyril Hrubis <ch...@su...> commit 03dee2cd7eeadf35b2944787932aa657674e1226 Author: Cyril Hrubis <ch...@su...> Date: Wed Mar 20 14:47:33 2013 +0100 open_posix_testsuite/.../clock_getres: Fix. Remove unused variables argc and argv. Signed-off-by: Cyril Hrubis <ch...@su...> commit 9a80a134e68e152b9809dfaffd3afe890ff96ae1 Author: Cyril Hrubis <ch...@su...> Date: Wed Mar 20 14:41:58 2013 +0100 open_posix_testsuite/.../clock_getcpuclockid: Fix. Remove unused variables. Signed-off-by: Cyril Hrubis <ch...@su...> commit 95c6e6de49d9dd3f2be3bb7f3efc450956dd7cbe Author: Cyril Hrubis <ch...@su...> Date: Wed Mar 20 14:38:52 2013 +0100 open_posix_testsuite/.../interfaces/clock: Fix. Remove unused variables argc and argv. Signed-off-by: Cyril Hrubis <ch...@su...> commit 93c4a17cd925020e77bc164adeea549a4858a651 Author: Cyril Hrubis <ch...@su...> Date: Wed Mar 20 14:36:15 2013 +0100 open_posix_testsuite/.../aio_write/4-1: Remove. Remove stub. Signed-off-by: Cyril Hrubis <ch...@su...> commit 6551579d61e7fc3fd429659ba9207679e04173d7 Author: Cyril Hrubis <ch...@su...> Date: Wed Mar 20 14:30:33 2013 +0100 open_posix_testsuite/.../behavior/timers: Fix. * Remove unused argc and argv. * Use return instead of exit. * Fix printf() missing arguments. Signed-off-by: Cyril Hrubis <ch...@su...> ----------------------------------------------------------------------- Summary of changes: .../conformance/behavior/timers/1-1.c | 8 ++-- .../conformance/behavior/timers/2-1.c | 2 +- .../conformance/interfaces/aio_write/4-1.c | 37 ---------------- .../conformance/interfaces/aio_write/coverage.txt | 2 +- .../conformance/interfaces/clock/1-1.c | 2 +- .../conformance/interfaces/clock/2-1.c | 2 +- .../interfaces/clock_getcpuclockid/1-1.c | 4 +- .../interfaces/clock_getcpuclockid/1-2.c | 2 +- .../interfaces/clock_getcpuclockid/2-1.c | 3 +- .../interfaces/clock_getcpuclockid/5-1.c | 3 +- .../interfaces/clock_getcpuclockid/6-1.c | 2 +- .../conformance/interfaces/clock_getres/1-1.c | 2 +- .../conformance/interfaces/clock_getres/3-1.c | 2 +- .../conformance/interfaces/clock_getres/5-1.c | 2 +- .../conformance/interfaces/clock_getres/6-1.c | 2 +- .../conformance/interfaces/clock_getres/6-2.c | 2 +- .../conformance/interfaces/clock_getres/7-1.c | 2 +- .../conformance/interfaces/clock_getres/8-1.c | 2 +- .../conformance/interfaces/clock_gettime/1-1.c | 2 +- .../conformance/interfaces/clock_gettime/1-2.c | 2 +- .../conformance/interfaces/clock_gettime/2-1.c | 2 +- .../conformance/interfaces/clock_gettime/3-1.c | 2 +- .../conformance/interfaces/clock_gettime/4-1.c | 2 +- .../conformance/interfaces/clock_gettime/7-1.c | 2 +- .../conformance/interfaces/clock_gettime/8-1.c | 2 +- .../conformance/interfaces/clock_gettime/8-2.c | 2 +- .../conformance/interfaces/clock_nanosleep/1-1.c | 2 +- .../conformance/interfaces/clock_nanosleep/1-3.c | 4 +- .../conformance/interfaces/clock_nanosleep/1-4.c | 2 +- .../conformance/interfaces/clock_nanosleep/1-5.c | 2 +- .../conformance/interfaces/clock_nanosleep/10-1.c | 4 +- .../conformance/interfaces/clock_nanosleep/11-1.c | 2 +- .../conformance/interfaces/clock_nanosleep/13-1.c | 2 +- .../conformance/interfaces/clock_nanosleep/2-1.c | 2 +- .../conformance/interfaces/clock_nanosleep/2-2.c | 4 +- .../conformance/interfaces/clock_nanosleep/2-3.c | 2 +- .../conformance/interfaces/clock_nanosleep/3-1.c | 2 +- .../conformance/interfaces/clock_nanosleep/9-1.c | 4 +- .../conformance/interfaces/clock_settime/1-1.c | 2 +- .../conformance/interfaces/clock_settime/17-1.c | 2 +- .../conformance/interfaces/clock_settime/17-2.c | 3 +- .../conformance/interfaces/clock_settime/19-1.c | 2 +- .../conformance/interfaces/clock_settime/20-1.c | 2 +- .../conformance/interfaces/clock_settime/4-1.c | 2 +- .../conformance/interfaces/clock_settime/4-2.c | 4 +- .../conformance/interfaces/clock_settime/5-1.c | 4 +- .../conformance/interfaces/clock_settime/5-2.c | 4 +- .../conformance/interfaces/clock_settime/6-1.c | 2 +- .../conformance/interfaces/clock_settime/7-1.c | 2 +- .../conformance/interfaces/clock_settime/7-2.c | 2 +- .../conformance/interfaces/clock_settime/8-1.c | 2 +- .../interfaces/clock_settime/speculative/4-3.c | 4 +- .../interfaces/clock_settime/speculative/4-4.c | 4 +- .../conformance/interfaces/fork/1-1.c | 23 +---------- .../conformance/interfaces/fork/11-1.c | 44 +++---------------- .../conformance/interfaces/fork/12-1.c | 37 +--------------- .../conformance/interfaces/fork/13-1.c | 41 ++---------------- .../conformance/interfaces/fork/14-1.c | 38 +---------------- .../conformance/interfaces/fork/16-1.c | 38 +--------------- .../conformance/interfaces/fork/17-1.c | 37 +--------------- .../conformance/interfaces/fork/17-2.c | 2 +- .../conformance/interfaces/fork/18-1.c | 45 ++------------------ .../conformance/interfaces/fork/2-1.c | 2 +- .../conformance/interfaces/fork/21-1.c | 43 ++----------------- .../conformance/interfaces/fork/22-1.c | 40 +---------------- .../conformance/interfaces/fork/3-1.c | 36 +--------------- .../conformance/interfaces/fork/4-1.c | 38 +---------------- .../conformance/interfaces/fork/6-1.c | 39 +---------------- .../conformance/interfaces/fork/7-1.c | 2 +- .../conformance/interfaces/fork/8-1.c | 20 +-------- .../conformance/interfaces/fork/9-1.c | 41 +----------------- .../conformance/interfaces/getpid/1-1.c | 45 +++----------------- .../conformance/interfaces/kill/1-1.c | 8 ++- .../conformance/interfaces/kill/1-2.c | 7 ++- .../conformance/interfaces/kill/2-1.c | 2 +- .../conformance/interfaces/kill/2-2.c | 8 ++- .../conformance/interfaces/kill/3-1.c | 7 ++- .../conformance/interfaces/killpg/1-1.c | 6 ++- .../conformance/interfaces/killpg/1-2.c | 5 +- .../conformance/interfaces/killpg/2-1.c | 2 +- .../conformance/interfaces/killpg/4-1.c | 2 +- .../conformance/interfaces/killpg/5-1.c | 9 +---- .../conformance/interfaces/killpg/6-1.c | 2 +- .../conformance/interfaces/killpg/8-1.c | 3 +- .../conformance/interfaces/mlockall/13-1.c | 2 +- .../conformance/interfaces/mlockall/13-2.c | 2 +- .../conformance/interfaces/mlockall/15-1.c | 2 +- .../conformance/interfaces/mlockall/3-6.c | 2 +- .../conformance/interfaces/mlockall/3-7.c | 3 +- .../conformance/interfaces/mlockall/8-1.c | 2 +- .../conformance/interfaces/testfrmw/testfrmw.c | 3 +- 91 files changed, 165 insertions(+), 693 deletions(-) delete mode 100644 testcases/open_posix_testsuite/conformance/interfaces/aio_write/4-1.c diff --git a/testcases/open_posix_testsuite/conformance/behavior/timers/1-1.c b/testcases/open_posix_testsuite/conformance/behavior/timers/1-1.c index 47fe7ed..460451c 100644 --- a/testcases/open_posix_testsuite/conformance/behavior/timers/1-1.c +++ b/testcases/open_posix_testsuite/conformance/behavior/timers/1-1.c @@ -19,7 +19,7 @@ #include <unistd.h> #include "posixtest.h" -int main(int argc, char *argv[]) +int main(void) { timer_t tid; int i; @@ -31,10 +31,10 @@ int main(int argc, char *argv[]) if (timer_create(CLOCK_REALTIME, NULL, &tid) == -1) { printf("[%d] timer_create() did not return success: " "%s\n", i, strerror(errno)); - exit(PTS_FAIL); + return PTS_FAIL; } } - printf("Successfully created %d timers\nTest PASSED\n"); - exit(PTS_PASS); + printf("Test PASSED\n"); + return PTS_PASS; } diff --git a/testcases/open_posix_testsuite/conformance/behavior/timers/2-1.c b/testcases/open_posix_testsuite/conformance/behavior/timers/2-1.c index 31cb50d..d77a140 100644 --- a/testcases/open_posix_testsuite/conformance/behavior/timers/2-1.c +++ b/testcases/open_posix_testsuite/conformance/behavior/timers/2-1.c @@ -14,7 +14,7 @@ #include <unistd.h> #include "posixtest.h" -int main(int argc, char *argv[]) +int main(void) { long scTIMER_MAX = 0; diff --git a/testcases/open_posix_testsuite/conformance/interfaces/aio_write/4-1.c b/testcases/open_posix_testsuite/conformance/interfaces/aio_write/4-1.c deleted file mode 100644 index 9176c23..0000000 --- a/testcases/open_posix_testsuite/conformance/interfaces/aio_write/4-1.c +++ /dev/null @@ -1,37 +0,0 @@ -/* - * Copyright (c) 2004, Bull SA. All rights reserved. - * Created by: Lau...@bu... - * This file is licensed under the GPL license. For the full content - * of this license, see the COPYING file at the top level of this - * source tree. - */ - -/* - * assertion: - * - * For regular files, no data transfer shall occur past the offset - * maximum established in the open file description associated with - * aio_fildes. - * - * method: - * - * UNTESTED - * - */ - -#define _XOPEN_SOURCE 600 -#include <stdio.h> -#include <unistd.h> -#include <aio.h> - -#include "posixtest.h" - -int main() -{ - -#if _POSIX_ASYNCHRONOUS_IO != 200112L - exit(PTS_UNSUPPORTED); -#endif - - return PTS_UNTESTED; -} diff --git a/testcases/open_posix_testsuite/conformance/interfaces/aio_write/coverage.txt b/testcases/open_posix_testsuite/conformance/interfaces/aio_write/coverage.txt index 6f0a6d2..bdc862a 100644 --- a/testcases/open_posix_testsuite/conformance/interfaces/aio_write/coverage.txt +++ b/testcases/open_posix_testsuite/conformance/interfaces/aio_write/coverage.txt @@ -4,7 +4,7 @@ Assertion Covered? 1 YES 2 YES 3 YES -4 YES +4 NO 5 YES 6 YES 7 YES diff --git a/testcases/open_posix_testsuite/conformance/interfaces/clock/1-1.c b/testcases/open_posix_testsuite/conformance/interfaces/clock/1-1.c index 586bd37..9c48cd9 100644 --- a/testcases/open_posix_testsuite/conformance/interfaces/clock/1-1.c +++ b/testcases/open_posix_testsuite/conformance/interfaces/clock/1-1.c @@ -20,7 +20,7 @@ #include "posixtest.h" #define LARGENUMBER 8000000 -int main(int argc, char *argv[]) +int main(void) { clock_t c1, c2; double sec1, sec2; diff --git a/testcases/open_posix_testsuite/conformance/interfaces/clock/2-1.c b/testcases/open_posix_testsuite/conformance/interfaces/clock/2-1.c index c172513..6bf1d37 100644 --- a/testcases/open_posix_testsuite/conformance/interfaces/clock/2-1.c +++ b/testcases/open_posix_testsuite/conformance/interfaces/clock/2-1.c @@ -21,7 +21,7 @@ #define EXPECTEDVALUE INTMAX_C(1000000) -int main(int argc, char *argv[]) +int main(void) { intmax_t clocks_per_sec = (intmax_t) CLOCKS_PER_SEC; diff --git a/testcases/open_posix_testsuite/conformance/interfaces/clock_getcpuclockid/1-1.c b/testcases/open_posix_testsuite/conformance/interfaces/clock_getcpuclockid/1-1.c index 31e3369..3069d56 100644 --- a/testcases/open_posix_testsuite/conformance/interfaces/clock_getcpuclockid/1-1.c +++ b/testcases/open_posix_testsuite/conformance/interfaces/clock_getcpuclockid/1-1.c @@ -22,7 +22,7 @@ #include "posixtest.h" #define LARGENUMBER 900000 -void dosomething() +void dosomething(void) { int i; for (i = 0; i < LARGENUMBER; i++) { @@ -30,7 +30,7 @@ void dosomething() } } -int main(int argc, char *argv[]) +int main(void) { #if !defined(_POSIX_CPUTIME) || _POSIX_CPUTIME == -1 printf("_POSIX_CPUTIME unsupported\n"); diff --git a/testcases/open_posix_testsuite/conformance/interfaces/clock_getcpuclockid/1-2.c b/testcases/open_posix_testsuite/conformance/interfaces/clock_getcpuclockid/1-2.c index 527a4d2..afbfa63 100644 --- a/testcases/open_posix_testsuite/conformance/interfaces/clock_getcpuclockid/1-2.c +++ b/testcases/open_posix_testsuite/conformance/interfaces/clock_getcpuclockid/1-2.c @@ -21,7 +21,7 @@ #include <unistd.h> #include "posixtest.h" -int main(int argc, char *argv[]) +int main(void) { #if !defined(_POSIX_CPUTIME) || _POSIX_CPUTIME == -1 printf("_POSIX_CPUTIME unsupported\n"); diff --git a/testcases/open_posix_testsuite/conformance/interfaces/clock_getcpuclockid/2-1.c b/testcases/open_posix_testsuite/conformance/interfaces/clock_getcpuclockid/2-1.c index 1d02fb1..6bad95d 100644 --- a/testcases/open_posix_testsuite/conformance/interfaces/clock_getcpuclockid/2-1.c +++ b/testcases/open_posix_testsuite/conformance/interfaces/clock_getcpuclockid/2-1.c @@ -20,13 +20,12 @@ #include "posixtest.h" #include "timespec.h" -int main(int argc, char *argv[]) +int main(void) { #if !defined(_POSIX_CPUTIME) || _POSIX_CPUTIME == -1 printf("_POSIX_CPUTIME unsupported\n"); return PTS_UNSUPPORTED; #else - unsigned long time_to_set; clockid_t clockid_1, clockid_2; struct timespec t1, t2, t3; diff --git a/testcases/open_posix_testsuite/conformance/interfaces/clock_getcpuclockid/5-1.c b/testcases/open_posix_testsuite/conformance/interfaces/clock_getcpuclockid/5-1.c index c05edd3..7d15a9d 100644 --- a/testcases/open_posix_testsuite/conformance/interfaces/clock_getcpuclockid/5-1.c +++ b/testcases/open_posix_testsuite/conformance/interfaces/clock_getcpuclockid/5-1.c @@ -18,7 +18,7 @@ #include <unistd.h> #include "posixtest.h" -int main(int argc, char *argv[]) +int main(void) { #if !defined(_POSIX_CPUTIME) || _POSIX_CPUTIME == -1 printf("_POSIX_CPUTIME unsupported\n"); @@ -32,7 +32,6 @@ int main(int argc, char *argv[]) * duration of the test. */ if (getuid() == 0) { - struct passwd *pwd; pwd = getpwnam("nobody"); diff --git a/testcases/open_posix_testsuite/conformance/interfaces/clock_getcpuclockid/6-1.c b/testcases/open_posix_testsuite/conformance/interfaces/clock_getcpuclockid/6-1.c index be5025b..ab3f397 100644 --- a/testcases/open_posix_testsuite/conformance/interfaces/clock_getcpuclockid/6-1.c +++ b/testcases/open_posix_testsuite/conformance/interfaces/clock_getcpuclockid/6-1.c @@ -16,7 +16,7 @@ #include <unistd.h> #include "posixtest.h" -int main(int argc, char *argv[]) +int main(void) { #if !defined(_POSIX_CPUTIME) || _POSIX_CPUTIME == -1 printf("_POSIX_CPUTIME unsupported\n"); diff --git a/testcases/open_posix_testsuite/conformance/interfaces/clock_getres/1-1.c b/testcases/open_posix_testsuite/conformance/interfaces/clock_getres/1-1.c index 8f4fa30..3b09cf4 100644 --- a/testcases/open_posix_testsuite/conformance/interfaces/clock_getres/1-1.c +++ b/testcases/open_posix_testsuite/conformance/interfaces/clock_getres/1-1.c @@ -14,7 +14,7 @@ #include "posixtest.h" #define LARGENUM 100000 -int main(int argc, char *argv[]) +int main(void) { struct timespec res; diff --git a/testcases/open_posix_testsuite/conformance/interfaces/clock_getres/3-1.c b/testcases/open_posix_testsuite/conformance/interfaces/clock_getres/3-1.c index ea0dc3a..235643f 100644 --- a/testcases/open_posix_testsuite/conformance/interfaces/clock_getres/3-1.c +++ b/testcases/open_posix_testsuite/conformance/interfaces/clock_getres/3-1.c @@ -15,7 +15,7 @@ #define LARGENUM 100000 -int main(int argc, char *argv[]) +int main(void) { #ifdef CLOCK_MONOTONIC struct timespec res; diff --git a/testcases/open_posix_testsuite/conformance/interfaces/clock_getres/5-1.c b/testcases/open_posix_testsuite/conformance/interfaces/clock_getres/5-1.c index 30eefe9..7547f33 100644 --- a/testcases/open_posix_testsuite/conformance/interfaces/clock_getres/5-1.c +++ b/testcases/open_posix_testsuite/conformance/interfaces/clock_getres/5-1.c @@ -13,7 +13,7 @@ #define INVALIDCLOCKID 99999 -int main(int argc, char *argv[]) +int main(void) { struct timespec res; diff --git a/testcases/open_posix_testsuite/conformance/interfaces/clock_getres/6-1.c b/testcases/open_posix_testsuite/conformance/interfaces/clock_getres/6-1.c index 7362f9b..019c4aa 100644 --- a/testcases/open_posix_testsuite/conformance/interfaces/clock_getres/6-1.c +++ b/testcases/open_posix_testsuite/conformance/interfaces/clock_getres/6-1.c @@ -15,7 +15,7 @@ #define INVALIDCLOCKID 99999 -int main(int argc, char *argv[]) +int main(void) { struct timespec res; diff --git a/testcases/open_posix_testsuite/conformance/interfaces/clock_getres/6-2.c b/testcases/open_posix_testsuite/conformance/interfaces/clock_getres/6-2.c index 210f1a9..11a2033 100644 --- a/testcases/open_posix_testsuite/conformance/interfaces/clock_getres/6-2.c +++ b/testcases/open_posix_testsuite/conformance/interfaces/clock_getres/6-2.c @@ -28,7 +28,7 @@ #define NUMINVALIDTESTS 8 -int main(int argc, char *argv[]) +int main(void) { struct timespec res; int invalid_tests[NUMINVALIDTESTS] = { diff --git a/testcases/open_posix_testsuite/conformance/interfaces/clock_getres/7-1.c b/testcases/open_posix_testsuite/conformance/interfaces/clock_getres/7-1.c index b024a76..48db3c9 100644 --- a/testcases/open_posix_testsuite/conformance/interfaces/clock_getres/7-1.c +++ b/testcases/open_posix_testsuite/conformance/interfaces/clock_getres/7-1.c @@ -16,7 +16,7 @@ #include "posixtest.h" #define LARGENUM 100000 -int main(int argc, char *argv[]) +int main(void) { #if _POSIX_CPUTIME != -1 struct timespec res; diff --git a/testcases/open_posix_testsuite/conformance/interfaces/clock_getres/8-1.c b/testcases/open_posix_testsuite/conformance/interfaces/clock_getres/8-1.c index b117925..ab693a3 100644 --- a/testcases/open_posix_testsuite/conformance/interfaces/clock_getres/8-1.c +++ b/testcases/open_posix_testsuite/conformance/interfaces/clock_getres/8-1.c @@ -16,7 +16,7 @@ #include "posixtest.h" #define LARGENUM 100000 -int main(int argc, char *argv[]) +int main(void) { #if _POSIX_THREAD_CPUTIME != -1 struct timespec res; diff --git a/testcases/open_posix_testsuite/conformance/interfaces/clock_gettime/1-1.c b/testcases/open_posix_testsuite/conformance/interfaces/clock_gettime/1-1.c index 302f0f9..5ab834f 100644 --- a/testcases/open_posix_testsuite/conformance/interfaces/clock_gettime/1-1.c +++ b/testcases/open_posix_testsuite/conformance/interfaces/clock_gettime/1-1.c @@ -12,7 +12,7 @@ #include <time.h> #include "posixtest.h" -int main(int argc, char *argv[]) +int main(void) { struct timespec tp; diff --git a/testcases/open_posix_testsuite/conformance/interfaces/clock_gettime/1-2.c b/testcases/open_posix_testsuite/conformance/interfaces/clock_gettime/1-2.c index 4240266..e8838a4 100644 --- a/testcases/open_posix_testsuite/conformance/interfaces/clock_gettime/1-2.c +++ b/testcases/open_posix_testsuite/conformance/interfaces/clock_gettime/1-2.c @@ -20,7 +20,7 @@ #define ACCEPTABLEDELTA 1 -int main(int argc, char *argv[]) +int main(void) { struct timespec tpundertest; struct timeval tvstandard; diff --git a/testcases/open_posix_testsuite/conformance/interfaces/clock_gettime/2-1.c b/testcases/open_posix_testsuite/conformance/interfaces/clock_gettime/2-1.c index be82875..1b056a2 100644 --- a/testcases/open_posix_testsuite/conformance/interfaces/clock_gettime/2-1.c +++ b/testcases/open_posix_testsuite/conformance/interfaces/clock_gettime/2-1.c @@ -20,7 +20,7 @@ #define ACCEPTABLEDELTA 1 -int main(int argc, char *argv[]) +int main(void) { struct timespec tpundertest; struct timeval tvstandard; diff --git a/testcases/open_posix_testsuite/conformance/interfaces/clock_gettime/3-1.c b/testcases/open_posix_testsuite/conformance/interfaces/clock_gettime/3-1.c index 3ee1c6d..5a82935 100644 --- a/testcases/open_posix_testsuite/conformance/interfaces/clock_gettime/3-1.c +++ b/testcases/open_posix_testsuite/conformance/interfaces/clock_gettime/3-1.c @@ -16,7 +16,7 @@ #include <unistd.h> #include "posixtest.h" -int main(int argc, char *argv[]) +int main(void) { #ifdef CLOCK_MONOTONIC diff --git a/testcases/open_posix_testsuite/conformance/interfaces/clock_gettime/4-1.c b/testcases/open_posix_testsuite/conformance/interfaces/clock_gettime/4-1.c index 1614e6f..f65a867 100644 --- a/testcases/open_posix_testsuite/conformance/interfaces/clock_gettime/4-1.c +++ b/testcases/open_posix_testsuite/conformance/interfaces/clock_gettime/4-1.c @@ -27,7 +27,7 @@ void dosomething() } } -int main(int argc, char *argv[]) +int main(void) { #if _POSIX_CPUTIME == -1 printf("_POSIX_CPUTIME unsupported\n"); diff --git a/testcases/open_posix_testsuite/conformance/interfaces/clock_gettime/7-1.c b/testcases/open_posix_testsuite/conformance/interfaces/clock_gettime/7-1.c index 95a50d9..8fbb867 100644 --- a/testcases/open_posix_testsuite/conformance/interfaces/clock_gettime/7-1.c +++ b/testcases/open_posix_testsuite/conformance/interfaces/clock_gettime/7-1.c @@ -12,7 +12,7 @@ #include "posixtest.h" #define INVALIDCLOCK 9999 -int main(int argc, char *argv[]) +int main(void) { struct timespec tp; diff --git a/testcases/open_posix_testsuite/conformance/interfaces/clock_gettime/8-1.c b/testcases/open_posix_testsuite/conformance/interfaces/clock_gettime/8-1.c index 9bbafee..c3d4520 100644 --- a/testcases/open_posix_testsuite/conformance/interfaces/clock_gettime/8-1.c +++ b/testcases/open_posix_testsuite/conformance/interfaces/clock_gettime/8-1.c @@ -14,7 +14,7 @@ #include "posixtest.h" #define INVALIDCLOCK 9999 -int main(int argc, char *argv[]) +int main(void) { struct timespec tp; diff --git a/testcases/open_posix_testsuite/conformance/interfaces/clock_gettime/8-2.c b/testcases/open_posix_testsuite/conformance/interfaces/clock_gettime/8-2.c index 77e92fc..1385916 100644 --- a/testcases/open_posix_testsuite/conformance/interfaces/clock_gettime/8-2.c +++ b/testcases/open_posix_testsuite/conformance/interfaces/clock_gettime/8-2.c @@ -30,7 +30,7 @@ static int invalid_tests[NUMINVALIDTESTS] = { 1073743192, -1, 17 }; -int main(int argc, char *argv[]) +int main(void) { struct timespec tp; int i; diff --git a/testcases/open_posix_testsuite/conformance/interfaces/clock_nanosleep/1-1.c b/testcases/open_posix_testsuite/conformance/interfaces/clock_nanosleep/1-1.c index 330a2bf..2b2bc78 100644 --- a/testcases/open_posix_testsuite/conformance/interfaces/clock_nanosleep/1-1.c +++ b/testcases/open_posix_testsuite/conformance/interfaces/clock_nanosleep/1-1.c @@ -15,7 +15,7 @@ #define SLEEPNSEC 3000000 -int main(int argc, char *argv[]) +int main(void) { struct timespec tssleep, tsbefore, tsafter; int slepts = 0, sleptns = 0; diff --git a/testcases/open_posix_testsuite/conformance/interfaces/clock_nanosleep/1-3.c b/testcases/open_posix_testsuite/conformance/interfaces/clock_nanosleep/1-3.c index 1378ecf..125407c 100644 --- a/testcases/open_posix_testsuite/conformance/interfaces/clock_nanosleep/1-3.c +++ b/testcases/open_posix_testsuite/conformance/interfaces/clock_nanosleep/1-3.c @@ -27,10 +27,12 @@ void handler(int signo) { + (void) signo; + printf("In handler\n"); } -int main(int argc, char *argv[]) +int main(void) { struct timespec tssleep, tsbefore, tsafter; int pid; diff --git a/testcases/open_posix_testsuite/conformance/interfaces/clock_nanosleep/1-4.c b/testcases/open_posix_testsuite/conformance/interfaces/clock_nanosleep/1-4.c index bd5dea7..9808c5c 100644 --- a/testcases/open_posix_testsuite/conformance/interfaces/clock_nanosleep/1-4.c +++ b/testcases/open_posix_testsuite/conformance/interfaces/clock_nanosleep/1-4.c @@ -17,7 +17,7 @@ #define SLEEPSEC 30 -int main(int argc, char *argv[]) +int main(void) { struct timespec tssleep, tsbefore, tsafter; int pid; diff --git a/testcases/open_posix_testsuite/conformance/interfaces/clock_nanosleep/1-5.c b/testcases/open_posix_testsuite/conformance/interfaces/clock_nanosleep/1-5.c index 02ce7be..46f2616 100644 --- a/testcases/open_posix_testsuite/conformance/interfaces/clock_nanosleep/1-5.c +++ b/testcases/open_posix_testsuite/conformance/interfaces/clock_nanosleep/1-5.c @@ -24,7 +24,7 @@ #define CHILDPASS 1 #define CHILDFAIL 0 -int main(int argc, char *argv[]) +int main(void) { int pid, slepts; struct timespec tsbefore, tsafter; diff --git a/testcases/open_posix_testsuite/conformance/interfaces/clock_nanosleep/10-1.c b/testcases/open_posix_testsuite/conformance/interfaces/clock_nanosleep/10-1.c index d6c9ec0..5dfc2ea 100644 --- a/testcases/open_posix_testsuite/conformance/interfaces/clock_nanosleep/10-1.c +++ b/testcases/open_posix_testsuite/conformance/interfaces/clock_nanosleep/10-1.c @@ -23,10 +23,12 @@ void handler(int signo) { + (void) signo; + printf("In handler\n"); } -int main(int argc, char *argv[]) +int main(void) { struct timespec tssleep; int pid; diff --git a/testcases/open_posix_testsuite/conformance/interfaces/clock_nanosleep/11-1.c b/testcases/open_posix_testsuite/conformance/interfaces/clock_nanosleep/11-1.c index b15c3df..334d170 100644 --- a/testcases/open_posix_testsuite/conformance/interfaces/clock_nanosleep/11-1.c +++ b/testcases/open_posix_testsuite/conformance/interfaces/clock_nanosleep/11-1.c @@ -28,7 +28,7 @@ static int invalid_tests[NUMINVALIDTESTS] = { 1000000001 }; -int main(int argc, char *argv[]) +int main(void) { struct timespec tssleep; int i; diff --git a/testcases/open_posix_testsuite/conformance/interfaces/clock_nanosleep/13-1.c b/testcases/open_posix_testsuite/conformance/interfaces/clock_nanosleep/13-1.c index 8b98cae..038f00a 100644 --- a/testcases/open_posix_testsuite/conformance/interfaces/clock_nanosleep/13-1.c +++ b/testcases/open_posix_testsuite/conformance/interfaces/clock_nanosleep/13-1.c @@ -17,7 +17,7 @@ #define BOGUSCLOCKID 99999 -int main(int argc, char *argv[]) +int main(void) { struct timespec tssleep; diff --git a/testcases/open_posix_testsuite/conformance/interfaces/clock_nanosleep/2-1.c b/testcases/open_posix_testsuite/conformance/interfaces/clock_nanosleep/2-1.c index 9fab5f0..a875e17 100644 --- a/testcases/open_posix_testsuite/conformance/interfaces/clock_nanosleep/2-1.c +++ b/testcases/open_posix_testsuite/conformance/interfaces/clock_nanosleep/2-1.c @@ -21,7 +21,7 @@ #define SLEEPSEC 3 #define ACCEPTABLEDELTA 1 -int main(int argc, char *argv[]) +int main(void) { struct timespec tssleep, tsbefore, tsafter; int sleepuntilsec, flags = 0; diff --git a/testcases/open_posix_testsuite/conformance/interfaces/clock_nanosleep/2-2.c b/testcases/open_posix_testsuite/conformance/interfaces/clock_nanosleep/2-2.c index 05c5d32..8982cba 100644 --- a/testcases/open_posix_testsuite/conformance/interfaces/clock_nanosleep/2-2.c +++ b/testcases/open_posix_testsuite/conformance/interfaces/clock_nanosleep/2-2.c @@ -28,10 +28,12 @@ void handler(int signo) { + (void) signo; + printf("In handler\n"); } -int main(int argc, char *argv[]) +int main(void) { struct timespec tssleep, tsbefore, tsafter; int pid, sleepuntilsec; diff --git a/testcases/open_posix_testsuite/conformance/interfaces/clock_nanosleep/2-3.c b/testcases/open_posix_testsuite/conformance/interfaces/clock_nanosleep/2-3.c index 99e4491..85b977f 100644 --- a/testcases/open_posix_testsuite/conformance/interfaces/clock_nanosleep/2-3.c +++ b/testcases/open_posix_testsuite/conformance/interfaces/clock_nanosleep/2-3.c @@ -19,7 +19,7 @@ #define SLEEPSEC 30 -int main(int argc, char *argv[]) +int main(void) { struct timespec tssleep, tsbefore, tsafter; int pid, sleepuntilsec; diff --git a/testcases/open_posix_testsuite/conformance/interfaces/clock_nanosleep/3-1.c b/testcases/open_posix_testsuite/conformance/interfaces/clock_nanosleep/3-1.c index 3479d34..18e7a54 100644 --- a/testcases/open_posix_testsuite/conformance/interfaces/clock_nanosleep/3-1.c +++ b/testcases/open_posix_testsuite/conformance/interfaces/clock_nanosleep/3-1.c @@ -22,7 +22,7 @@ #define SLEEPSEC 3 #define ACCEPTABLEDELTA 1 -int main(int argc, char *argv[]) +int main(void) { struct timespec tssleep, tsbefore, tsafter; int sleepuntilsec, flags = 0; diff --git a/testcases/open_posix_testsuite/conformance/interfaces/clock_nanosleep/9-1.c b/testcases/open_posix_testsuite/conformance/interfaces/clock_nanosleep/9-1.c index 771c44c..dca43ba 100644 --- a/testcases/open_posix_testsuite/conformance/interfaces/clock_nanosleep/9-1.c +++ b/testcases/open_posix_testsuite/conformance/interfaces/clock_nanosleep/9-1.c @@ -27,10 +27,12 @@ void handler(int signo) { + (void) signo; + printf("In handler\n"); } -int main(int argc, char *argv[]) +int main(void) { struct timespec tssleep, tsbefore, tsafter, tsremain; int pid; diff --git a/testcases/open_posix_testsuite/conformance/interfaces/clock_settime/1-1.c b/testcases/open_posix_testsuite/conformance/interfaces/clock_settime/1-1.c index 7e0b961..74cfc0a 100644 --- a/testcases/open_posix_testsuite/conformance/interfaces/clock_settime/1-1.c +++ b/testcases/open_posix_testsuite/conformance/interfaces/clock_settime/1-1.c @@ -26,7 +26,7 @@ #define TESTTIME 1037128358 #define ACCEPTABLEDELTA 1 -int main(int argc, char *argv[]) +int main(void) { struct timespec tpset, tpget, tpreset, tpres; int delta, nsdelta; diff --git a/testcases/open_posix_testsuite/conformance/interfaces/clock_settime/17-1.c b/testcases/open_posix_testsuite/conformance/interfaces/clock_settime/17-1.c index 69ff5ba..90b0162 100644 --- a/testcases/open_posix_testsuite/conformance/interfaces/clock_settime/17-1.c +++ b/testcases/open_posix_testsuite/conformance/interfaces/clock_settime/17-1.c @@ -21,7 +21,7 @@ #define BOGUSCLOCKID 9999 -int main(int argc, char *argv[]) +int main(void) { struct timespec tpset; diff --git a/testcases/open_posix_testsuite/conformance/interfaces/clock_settime/17-2.c b/testcases/open_posix_testsuite/conformance/interfaces/clock_settime/17-2.c index 11509a9..72e34dd 100644 --- a/testcases/open_posix_testsuite/conformance/interfaces/clock_settime/17-2.c +++ b/testcases/open_posix_testsuite/conformance/interfaces/clock_settime/17-2.c @@ -25,6 +25,7 @@ #include <time.h> #include <errno.h> #include <stdint.h> +#include <unistd.h> #include "posixtest.h" #define TESTTIME 1037128358 @@ -36,7 +37,7 @@ static int invalid_tests[NUMINVALIDTESTS] = { 1073743192, -1, 17 }; -int main(int argc, char *argv[]) +int main(void) { struct timespec tpset; int i; diff --git a/testcases/open_posix_testsuite/conformance/interfaces/clock_settime/19-1.c b/testcases/open_posix_testsuite/conformance/interfaces/clock_settime/19-1.c index 33fcf6e..98ec935 100644 --- a/testcases/open_posix_testsuite/conformance/interfaces/clock_settime/19-1.c +++ b/testcases/open_posix_testsuite/conformance/interfaces/clock_settime/19-1.c @@ -36,7 +36,7 @@ static int invalid_tests[NUMINVALIDTESTS] = { 1073743192, -1, 1000000000, 1000000001 }; -int main(int argc, char *argv[]) +int main(void) { struct timespec tsset, tscurrent, tsreset; int i; diff --git a/testcases/open_posix_testsuite/conformance/interfaces/clock_settime/20-1.c b/testcases/open_posix_testsuite/conformance/interfaces/clock_settime/20-1.c index 5eb0739..a21a2a1 100644 --- a/testcases/open_posix_testsuite/conformance/interfaces/clock_settime/20-1.c +++ b/testcases/open_posix_testsuite/conformance/interfaces/clock_settime/20-1.c @@ -18,7 +18,7 @@ #define TESTTIME 1037128358 -int main(int argc, char *argv[]) +int main(void) { #ifdef CLOCK_MONOTONIC struct timespec tpset; diff --git a/testcases/open_posix_testsuite/conformance/interfaces/clock_settime/4-1.c b/testcases/open_posix_testsuite/conformance/interfaces/clock_settime/4-1.c index 07284c2..4cb6bc0 100644 --- a/testcases/open_posix_testsuite/conformance/interfaces/clock_settime/4-1.c +++ b/testcases/open_posix_testsuite/conformance/interfaces/clock_settime/4-1.c @@ -38,7 +38,7 @@ #define SIGTOTEST SIGALRM -int main(int argc, char *argv[]) +int main(void) { struct sigevent ev; struct timespec tpT0, tpT2, tpreset; diff --git a/testcases/open_posix_testsuite/conformance/interfaces/clock_settime/4-2.c b/testcases/open_posix_testsuite/conformance/interfaces/clock_settime/4-2.c index 800dfab..73c3f69 100644 --- a/testcases/open_posix_testsuite/conformance/interfaces/clock_settime/4-2.c +++ b/testcases/open_posix_testsuite/conformance/interfaces/clock_settime/4-2.c @@ -36,13 +36,15 @@ struct timespec tpreset; void handler(int signo) { + (void) signo; + printf("Caught signal\n"); printf("Test PASSED\n"); setBackTime(tpreset); exit(PTS_PASS); } -int main(int argc, char *argv[]) +int main(void) { struct sigevent ev; struct sigaction act; diff --git a/testcases/open_posix_testsuite/conformance/interfaces/clock_settime/5-1.c b/testcases/open_posix_testsuite/conformance/interfaces/clock_settime/5-1.c index 07c2777..4df8252 100644 --- a/testcases/open_posix_testsuite/conformance/interfaces/clock_settime/5-1.c +++ b/testcases/open_posix_testsuite/conformance/interfaces/clock_settime/5-1.c @@ -36,10 +36,12 @@ void handler(int signo) { + (void) signo; + printf("Caught signal\n"); } -int main(int argc, char *argv[]) +int main(void) { struct sigevent ev; struct sigaction act; diff --git a/testcases/open_posix_testsuite/conformance/interfaces/clock_settime/5-2.c b/testcases/open_posix_testsuite/conformance/interfaces/clock_settime/5-2.c index 85e06fc..27cd54e 100644 --- a/testcases/open_posix_testsuite/conformance/interfaces/clock_settime/5-2.c +++ b/testcases/open_posix_testsuite/conformance/interfaces/clock_settime/5-2.c @@ -36,10 +36,12 @@ void handler(int signo) { + (void) signo; + printf("Caught signal\n"); } -int main(int argc, char *argv[]) +int main(void) { struct sigevent ev; struct sigaction act; diff --git a/testcases/open_posix_testsuite/conformance/interfaces/clock_settime/6-1.c b/testcases/open_posix_testsuite/conformance/interfaces/clock_settime/6-1.c index fb99958..163ce59 100644 --- a/testcases/open_posix_testsuite/conformance/interfaces/clock_settime/6-1.c +++ b/testcases/open_posix_testsuite/conformance/interfaces/clock_settime/6-1.c @@ -16,7 +16,7 @@ #define TESTTIME 1037128358 -int main(int argc, char *argv[]) +int main(void) { #ifdef CLOCK_MONOTONIC struct timespec tpset; diff --git a/testcases/open_posix_testsuite/conformance/interfaces/clock_settime/7-1.c b/testcases/open_posix_testsuite/conformance/interfaces/clock_settime/7-1.c index 4c5c8f6..569eae9 100644 --- a/testcases/open_posix_testsuite/conformance/interfaces/clock_settime/7-1.c +++ b/testcases/open_posix_testsuite/conformance/interfaces/clock_settime/7-1.c @@ -33,7 +33,7 @@ #define CHILDPASS 1 #define CHILDFAIL 0 -int main(int argc, char *argv[]) +int main(void) { struct timespec tsT0, tsT1; int pid; diff --git a/testcases/open_posix_testsuite/conformance/interfaces/clock_settime/7-2.c b/testcases/open_posix_testsuite/conformance/interfaces/clock_settime/7-2.c index 5b736e5..7c340b6 100644 --- a/testcases/open_posix_testsuite/conformance/interfaces/clock_settime/7-2.c +++ b/testcases/open_posix_testsuite/conformance/interfaces/clock_settime/7-2.c @@ -32,7 +32,7 @@ #define CHILDPASS 1 #define CHILDFAIL 0 -int main(int argc, char *argv[]) +int main(void) { struct timespec tsT0, tsT1, tsT2; int pid; diff --git a/testcases/open_posix_testsuite/conformance/interfaces/clock_settime/8-1.c b/testcases/open_posix_testsuite/conformance/interfaces/clock_settime/8-1.c index bc5cfe4..4e9d183 100644 --- a/testcases/open_posix_testsuite/conformance/interfaces/clock_settime/8-1.c +++ b/testcases/open_posix_testsuite/conformance/interfaces/clock_settime/8-1.c @@ -31,7 +31,7 @@ #define CHILDPASS 1 #define CHILDFAIL 0 -int main(int argc, char *argv[]) +int main(void) { struct timespec tsT0, tssleep; int pid; diff --git a/testcases/open_posix_testsuite/conformance/interfaces/clock_settime/speculative/4-3.c b/testcases/open_posix_testsuite/conformance/interfaces/clock_settime/speculative/4-3.c index 11c5c9d..78a4f08 100644 --- a/testcases/open_posix_testsuite/conformance/interfaces/clock_settime/speculative/4-3.c +++ b/testcases/open_posix_testsuite/conformance/interfaces/clock_settime/speculative/4-3.c @@ -47,11 +47,13 @@ int caught = 0; void handler(int signo) { + (void) signo; + printf("Caught signal\n"); caught++; } -int main(int argc, char *argv[]) +int main(void) { struct sigevent ev; struct sigaction act; diff --git a/testcases/open_posix_testsuite/conformance/interfaces/clock_settime/speculative/4-4.c b/testcases/open_posix_testsuite/conformance/interfaces/clock_settime/speculative/4-4.c index d8ce80b..10f6076 100644 --- a/testcases/open_posix_testsuite/conformance/interfaces/clock_settime/speculative/4-4.c +++ b/testcases/open_posix_testsuite/conformance/interfaces/clock_settime/speculative/4-4.c @@ -45,11 +45,13 @@ int caught = 0; void handler(int signo) { + (void) signo; + printf("Caught signal\n"); caught++; } -int main(int argc, char *argv[]) +int main(void) { struct sigevent ev; struct sigaction act; diff --git a/testcases/open_posix_testsuite/conformance/interfaces/fork/1-1.c b/testcases/open_posix_testsuite/conformance/interfaces/fork/1-1.c index 54dbaae..a303377 100644 --- a/testcases/open_posix_testsuite/conformance/interfaces/fork/1-1.c +++ b/testcases/open_posix_testsuite/conformance/interfaces/fork/1-1.c @@ -46,40 +46,19 @@ #include "../testfrmw/testfrmw.h" #include "../testfrmw/testfrmw.c" - /* - * This header is responsible for defining the following macros: - * UNRESOLVED(ret, descr); - * where descr is a description of the error and ret is an int (error code for example) - * FAILED(descr); - * where descr is a short text saying why the test has failed. - * PASSED(); - * No parameter. - * - * Both three macros shall terminate the calling process. - * The testcase shall not terminate in any other maneer. - * - * The other file defines the functions - * void output_init() - * void output(char * string, ...) - * - * Those may be used to output information. - */ - #ifndef VERBOSE #define VERBOSE 1 #endif #define SEM_NAME "/semfork1_1" -/* The main test function. */ -int main(int argc, char *argv[]) +int main(void) { int ret, status; pid_t child, ctl; sem_t *sem; struct timespec tsini, tsfin; - /* Initialize output */ output_init(); /* read current time */ diff --git a/testcases/open_posix_testsuite/conformance/interfaces/fork/11-1.c b/testcases/open_posix_testsuite/conformance/interfaces/fork/11-1.c index 70e6224..9950a78 100644 --- a/testcases/open_posix_testsuite/conformance/interfaces/fork/11-1.c +++ b/testcases/open_posix_testsuite/conformance/interfaces/fork/11-1.c @@ -33,9 +33,6 @@ /* We are testing conformance to IEEE Std 1003.1, 2003 Edition */ #define _POSIX_C_SOURCE 200112L -/********************************************************************************************/ -/****************************** standard includes *****************************************/ -/********************************************************************************************/ #include <pthread.h> #include <stdarg.h> #include <stdio.h> @@ -46,43 +43,19 @@ #include <sys/wait.h> #include <errno.h> -/********************************************************************************************/ -/****************************** Test framework *****************************************/ -/********************************************************************************************/ #include "../testfrmw/testfrmw.h" #include "../testfrmw/testfrmw.c" -/* This header is responsible for defining the following macros: - * UNRESOLVED(ret, descr); - * where descr is a description of the error and ret is an int (error code for example) - * FAILED(descr); - * where descr is a short text saying why the test has failed. - * PASSED(); - * No parameter. - * - * Both three macros shall terminate the calling process. - * The testcase shall not terminate in any other maneer. - * - * The other file defines the functions - * void output_init() - * void output(char * string, ...) - * - * Those may be used to output information. - */ - -/********************************************************************************************/ -/********************************** Configuration ******************************************/ -/********************************************************************************************/ + #ifndef VERBOSE #define VERBOSE 1 #endif -/********************************************************************************************/ -/*********************************** Test case *****************************************/ -/********************************************************************************************/ -/* Thread function */ -void *threaded(void *arg) +static void *threaded(void *arg) { int ret; + + (void) arg; + ret = ftrylockfile(stdout); if (ret != 0) { @@ -97,14 +70,12 @@ void *threaded(void *arg) return NULL; } -/* The main test function. */ -int main(int argc, char *argv[]) +int main(void) { int ret, status; pid_t child, ctl; pthread_t ch; - /* Initialize output */ output_init(); /* lock the stdout file */ @@ -152,11 +123,8 @@ int main(int argc, char *argv[]) FAILED("Child exited abnormally"); } - /* Test passed */ #if VERBOSE > 0 - output("Test passed\n"); - #endif PASSED; diff --git a/testcases/open_posix_testsuite/conformance/interfaces/fork/12-1.c b/testcases/open_posix_testsuite/conformance/interfaces/fork/12-1.c index d77b989..184c062 100644 --- a/testcases/open_posix_testsuite/conformance/interfaces/fork/12-1.c +++ b/testcases/open_posix_testsuite/conformance/interfaces/fork/12-1.c @@ -32,9 +32,6 @@ /* We are testing conformance to IEEE Std 1003.1, 2003 Edition */ #define _POSIX_C_SOURCE 200112L -/********************************************************************************************/ -/****************************** standard includes *****************************************/ -/********************************************************************************************/ #include <pthread.h> #include <stdarg.h> #include <stdio.h> @@ -47,49 +44,20 @@ #include <signal.h> -/********************************************************************************************/ -/****************************** Test framework *****************************************/ -/********************************************************************************************/ #include "../testfrmw/testfrmw.h" #include "../testfrmw/testfrmw.c" -/* This header is responsible for defining the following macros: - * UNRESOLVED(ret, descr); - * where descr is a description of the error and ret is an int (error code for example) - * FAILED(descr); - * where descr is a short text saying why the test has failed. - * PASSED(); - * No parameter. - * - * Both three macros shall terminate the calling process. - * The testcase shall not terminate in any other maneer. - * - * The other file defines the functions - * void output_init() - * void output(char * string, ...) - * - * Those may be used to output information. - */ - -/********************************************************************************************/ -/********************************** Configuration ******************************************/ -/********************************************************************************************/ + #ifndef VERBOSE #define VERBOSE 1 #endif -/********************************************************************************************/ -/*********************************** Test case *****************************************/ -/********************************************************************************************/ - -/* The main test function. */ -int main(int argc, char *argv[]) +int main(void) { int ret, status; pid_t child, ctl; sigset_t mask, pending; - /* Initialize output */ output_init(); /* block SIGUSR1 and SIGUSR2 */ @@ -257,7 +225,6 @@ int main(int argc, char *argv[]) FAILED("Child exited abnormally"); } - /* Test passed */ #if VERBOSE > 0 output("Test passed\n"); diff --git a/testcases/open_posix_testsuite/conformance/interfaces/fork/13-1.c b/testcases/open_posix_testsuite/conformance/interfaces/fork/13-1.c index f1daa84..751f10a 100644 --- a/testcases/open_posix_testsuite/conformance/interfaces/fork/13-1.c +++ b/testcases/open_posix_testsuite/conformance/interfaces/fork/13-1.c @@ -35,9 +35,6 @@ #define _XOPEN_SOURCE 600 #endif -/********************************************************************************************/ -/****************************** standard includes *****************************************/ -/********************************************************************************************/ #include <pthread.h> #include <stdarg.h> #include <stdio.h> @@ -50,49 +47,22 @@ #include <sys/time.h> -/********************************************************************************************/ -/****************************** Test framework *****************************************/ -/********************************************************************************************/ #include "../testfrmw/testfrmw.h" #include "../testfrmw/testfrmw.c" -/* This header is responsible for defining the following macros: - * UNRESOLVED(ret, descr); - * where descr is a description of the error and ret is an int (error code for example) - * FAILED(descr); - * where descr is a short text saying why the test has failed. - * PASSED(); - * No parameter. - * - * Both three macros shall terminate the calling process. - * The testcase shall not terminate in any other maneer. - * - * The other file defines the functions - * void output_init() - * void output(char * string, ...) - * - * Those may be used to output information. - */ - -/********************************************************************************************/ -/********************************** Configuration ******************************************/ -/********************************************************************************************/ + #ifndef VERBOSE #define VERBOSE 1 #endif -/********************************************************************************************/ -/*********************************** Test case *****************************************/ -/********************************************************************************************/ #ifndef WITHOUT_XOPEN -/* The main test function. */ -int main(int argc, char *argv[]) + +int main(void) { int ret, status; pid_t child, ctl; struct itimerval it; - /* Initialize output */ output_init(); /* Create the interval timer */ @@ -184,18 +154,15 @@ int main(int argc, char *argv[]) FAILED("Child exited abnormally"); } - /* Test passed */ #if VERBOSE > 0 - output("Test passed\n"); - #endif PASSED; } #else /* WITHOUT_XOPEN */ -int main(int argc, char *argv[]) +int main(void) { output_init(); UNTESTED("This testcase requires XSI features"); diff --git a/testcases/open_posix_testsuite/conformance/interfaces/fork/14-1.c b/testcases/open_posix_testsuite/conformance/interfaces/fork/14-1.c index 0cd45e3..3288d3b 100644 --- a/testcases/open_posix_testsuite/conformance/interfaces/fork/14-1.c +++ b/testcases/open_posix_testsuite/conformance/interfaces/fork/14-1.c @@ -31,9 +31,6 @@ /* We are testing conformance to IEEE Std 1003.1, 2003 Edition */ #define _POSIX_C_SOURCE 200112L -/********************************************************************************************/ -/****************************** standard includes *****************************************/ -/********************************************************************************************/ #include <pthread.h> #include <stdarg.h> #include <stdio.h> @@ -47,48 +44,20 @@ #include <semaphore.h> #include <fcntl.h> -/********************************************************************************************/ -/****************************** Test framework *****************************************/ -/********************************************************************************************/ #include "../testfrmw/testfrmw.h" #include "../testfrmw/testfrmw.c" -/* This header is responsible for defining the following macros: - * UNRESOLVED(ret, descr); - * where descr is a description of the error and ret is an int (error code for example) - * FAILED(descr); - * where descr is a short text saying why the test has failed. - * PASSED(); - * No parameter. - * - * Both three macros shall terminate the calling process. - * The testcase shall not terminate in any other maneer. - * - * The other file defines the functions - * void output_init() - * void output(char * string, ...) - * - * Those may be used to output information. - */ - -/********************************************************************************************/ -/********************************** Configuration ******************************************/ -/********************************************************************************************/ + #ifndef VERBOSE #define VERBOSE 1 #endif -/********************************************************************************************/ -/*********************************** Test case *****************************************/ -/********************************************************************************************/ -/* The main test function. */ -int main(int argc, char *argv[]) +int main(void) { int ret, status; pid_t child, ctl; sem_t *sem_linked, *sem_unlinked; - /* Initialize output */ output_init(); sem_linked = sem_open("/fork_14_1a", O_CREAT, O_RDWR, 0); @@ -196,11 +165,8 @@ int main(int argc, char *argv[]) UNRESOLVED(errno, "Failed to close semaphore B"); } - /* Test passed */ #if VERBOSE > 0 - output("Test passed\n"); - #endif PASSED; diff --git a/testcases/open_posix_testsuite/conformance/interfaces/fork/16-1.c b/testcases/open_posix_testsuite/conformance/interfaces/fork/16-1.c index 615eaf0..01b67fd 100644 --- a/testcases/open_posix_testsuite/conformance/interfaces/fork/16-1.c +++ b/testcases/open_posix_testsuite/conformance/interfaces/fork/16-1.c @@ -36,9 +36,6 @@ /* We are testing conformance to IEEE Std 1003.1, 2003 Edition */ #define _POSIX_C_SOURCE 200112L -/********************************************************************************************/ -/****************************** standard includes *****************************************/ -/********************************************************************************************/ #include <pthread.h> #include <stdarg.h> #include <stdio.h> @@ -53,48 +50,21 @@ #include <fcntl.h> #include <sys/stat.h> #include <sys/types.h> -/********************************************************************************************/ -/****************************** Test framework *****************************************/ -/********************************************************************************************/ + #include "../testfrmw/testfrmw.h" #include "../testfrmw/testfrmw.c" -/* This header is responsible for defining the following macros: - * UNRESOLVED(ret, descr); - * where descr is a description of the error and ret is an int (error code for example) - * FAILED(descr); - * where descr is a short text saying why the test has failed. - * PASSED(); - * No parameter. - * - * Both three macros shall terminate the calling process. - * The testcase shall not terminate in any other maneer. - * - * The other file defines the functions - * void output_init() - * void output(char * string, ...) - * - * Those may be used to output information. - */ - -/********************************************************************************************/ -/********************************** Configuration ******************************************/ -/********************************************************************************************/ + #ifndef VERBOSE #define VERBOSE 1 #endif -/********************************************************************************************/ -/*********************************** Test case *****************************************/ -/********************************************************************************************/ -/* The main test function. */ -int main(int argc, char *argv[]) +int main(void) { int ret, status; pid_t child, ctl; int fd_s, fd_ns; void *buf_s, *buf_ns; - /* Initialize output */ output_init(); /* Create the shared memory segment */ @@ -204,10 +174,8 @@ int main(int argc, char *argv[]) UNRESOLVED(errno, "Failed to unlink the shared memory segment"); } - /* Test passed */ #if VERBOSE > 0 output("Test passed\n"); - #endif PASSED; } diff --git a/testcases/open_posix_testsuite/conformance/interfaces/fork/17-1.c b/testcases/open_posix_testsuite/conformance/interfaces/fork/17-1.c index 5195e0b..df66312 100644 --- a/testcases/open_posix_testsuite/conformance/interfaces/fork/17-1.c +++ b/testcases/open_posix_testsuite/conformance/interfaces/fork/17-1.c @@ -32,9 +32,6 @@ /* We are testing conformance to IEEE Std 1003.1, 2003 Edition */ #define _POSIX_C_SOURCE 200112L -/********************************************************************************************/ -/****************************** standard includes *****************************************/ -/********************************************************************************************/ #include <pthread.h> #include <stdarg.h> #include <stdio.h> @@ -47,50 +44,22 @@ #include <sched.h> -/********************************************************************************************/ -/****************************** Test framework *****************************************/ -/********************************************************************************************/ #include "../testfrmw/testfrmw.h" #include "../testfrmw/testfrmw.c" -/* This header is responsible for defining the following macros: - * UNRESOLVED(ret, descr); - * where descr is a description of the error and ret is an int (error code for example) - * FAILED(descr); - * where descr is a short text saying why the test has failed. - * PASSED(); - * No parameter. - * - * Both three macros shall terminate the calling process. - * The testcase shall not terminate in any other maneer. - * - * The other file defines the functions - * void output_init() - * void output(char * string, ...) - * - * Those may be used to output information. - */ - -/********************************************************************************************/ -/********************************** Configuration ******************************************/ -/********************************************************************************************/ + #ifndef VERBOSE #define VERBOSE 1 #endif #define POLICY SCHED_RR -/********************************************************************************************/ -/*********************************** Test case *****************************************/ -/********************************************************************************************/ -/* The main test function. */ -int main(int argc, char *argv[]) +int main(void) { int ret, param, status; pid_t child, ctl; struct sched_param sp; - /* Initialize output */ output_init(); /* Change process policy and parameters */ @@ -154,10 +123,8 @@ int main(int argc, char *argv[]) FAILED("Child exited abnormally"); } - /* Test passed */ #if VERBOSE > 0 output("Test passed\n"); - #endif PASSED; } diff --git a/testcases/open_posix_testsuite/conformance/interfaces/fork/17-2.c b/testcases/op... [truncated message content] |
From: Cyril H. <su...@li...> - 2013-03-20 13:21:51
|
The branch, master, has been updated via ff4e69314c1b1316b83b240248da49de63af7b39 (commit) from c74b7f06c887ae5de2d718b1aa52db27c3a0e989 (commit) - Log ----------------------------------------------------------------- commit ff4e69314c1b1316b83b240248da49de63af7b39 Author: Cyril Hrubis <ch...@su...> Date: Wed Mar 20 14:08:28 2013 +0100 open_posix_testsuite: Enable warnings. Previously warnings were disabled and output from the compiler was redirected to file which made the build look clean while it wasn't. Signed-off-by: Cyril Hrubis <ch...@su...> ----------------------------------------------------------------------- Summary of changes: testcases/open_posix_testsuite/CFLAGS | 2 +- .../scripts/generate-makefiles.sh | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/testcases/open_posix_testsuite/CFLAGS b/testcases/open_posix_testsuite/CFLAGS index a27d9aa..b604391 100644 --- a/testcases/open_posix_testsuite/CFLAGS +++ b/testcases/open_posix_testsuite/CFLAGS @@ -1 +1 @@ --std=c99 -D_POSIX_C_SOURCE=200112L -D_XOPEN_SOURCE=600 +-std=c99 -D_POSIX_C_SOURCE=200112L -D_XOPEN_SOURCE=600 -W -Wall diff --git a/testcases/open_posix_testsuite/scripts/generate-makefiles.sh b/testcases/open_posix_testsuite/scripts/generate-makefiles.sh index 9eb3294..4f11e47 100755 --- a/testcases/open_posix_testsuite/scripts/generate-makefiles.sh +++ b/testcases/open_posix_testsuite/scripts/generate-makefiles.sh @@ -187,7 +187,7 @@ EOF cat >> "$makefile.3" <<EOF $prereq: \$(srcdir)/$c_file - @if $COMPILE_STR >logfile.\$\$\$\$ 2>&1; then \\ + @if $COMPILE_STR | tee logfile.\$\$\$\$ 2>&1; then \\ echo "\$(subdir)/$test_name compile PASSED"; \\ echo "\$(subdir)/$test_name compile PASSED" >> \$(LOGFILE); \\ else \\ hooks/post-receive -- ltp |
From: Cyril H. <su...@li...> - 2013-03-19 18:22:09
|
The branch, master, has been updated via c74b7f06c887ae5de2d718b1aa52db27c3a0e989 (commit) from 85f662d14f0326338ddaf8f633b288557ce46db0 (commit) - Log ----------------------------------------------------------------- commit c74b7f06c887ae5de2d718b1aa52db27c3a0e989 Author: Cyril Hrubis <ch...@su...> Date: Tue Mar 19 17:57:22 2013 +0100 testcases/kernel/fs/doio/doio.c: Fix buffer size. Use 'strlen(exec_path) + 2' instead of 'strlen(exec_path + 1)' Signed-off-by: Cyril Hrubis <ch...@su...> ----------------------------------------------------------------------- Summary of changes: testcases/kernel/fs/doio/doio.c | 4 +--- 1 files changed, 1 insertions(+), 3 deletions(-) diff --git a/testcases/kernel/fs/doio/doio.c b/testcases/kernel/fs/doio/doio.c index 656642b..dd4a50b 100644 --- a/testcases/kernel/fs/doio/doio.c +++ b/testcases/kernel/fs/doio/doio.c @@ -650,9 +650,7 @@ int main(int argc, char **argv) char *exec_path; exec_path = argv[0]; - argv[0] = - (char *) - malloc(strlen(exec_path + 1)); + argv[0] = malloc(strlen(exec_path) + 2); sprintf(argv[0], "-%s", exec_path); execvp(exec_path, argv); hooks/post-receive -- ltp |
From: Cyril H. <su...@li...> - 2013-03-18 19:21:25
|
The branch, master, has been updated via 85f662d14f0326338ddaf8f633b288557ce46db0 (commit) from caf3d347df69cd00ab27bf26d1093779a8c66f27 (commit) - Log ----------------------------------------------------------------- commit 85f662d14f0326338ddaf8f633b288557ce46db0 Author: Cyril Hrubis <ch...@su...> Date: Mon Mar 18 19:22:39 2013 +0100 syscalls/getdents: Remove indirection. This removes the indirection between the tests code and the kernel syscall caused by the translation of linux_dirent into libc dirent which was wrong to begin with and caused random segfaults. Signed-off-by: Cyril Hrubis <ch...@su...> ----------------------------------------------------------------------- Summary of changes: runtest/syscalls | 18 +--- testcases/kernel/syscalls/getdents/Makefile | 5 - testcases/kernel/syscalls/getdents/getdents.h | 133 +++++------------------ testcases/kernel/syscalls/getdents/getdents01.c | 104 ++++++++---------- testcases/kernel/syscalls/getdents/getdents02.c | 75 ++++--------- testcases/kernel/syscalls/getdents/getdents03.c | 69 ++++--------- testcases/kernel/syscalls/getdents/getdents04.c | 96 ++++------------- 7 files changed, 142 insertions(+), 358 deletions(-) diff --git a/runtest/syscalls b/runtest/syscalls index 191ad10..758775b 100644 --- a/runtest/syscalls +++ b/runtest/syscalls @@ -323,22 +323,14 @@ getcwd02 getcwd02 getcwd03 getcwd03 getdents01 getdents01 -getdents01_64 getdents01_64 getdents02 getdents02 -getdents02_64 getdents02_64 getdents03 getdents03 -getdents03_64 getdents03_64 getdents04 getdents04 -getdents04_64 getdents04_64 - -getdents01_long getdents01 -l -getdents01_64_long getdents01_64 -l -getdents02_long getdents02 -l -getdents02_64_long getdents02_64 -l -getdents03_long getdents03 -l -getdents03_64_long getdents03_64 -l -getdents04_long getdents04 -l -getdents04_64_long getdents04_64 -l + +getdents01_64 getdents01 -l +getdents02_64 getdents02 -l +getdents03_64 getdents03 -l +getdents04_64 getdents04 -l getdomainname01 getdomainname01 diff --git a/testcases/kernel/syscalls/getdents/Makefile b/testcases/kernel/syscalls/getdents/Makefile index ebcbc4f..bd617d8 100644 --- a/testcases/kernel/syscalls/getdents/Makefile +++ b/testcases/kernel/syscalls/getdents/Makefile @@ -19,10 +19,5 @@ top_srcdir ?= ../../../.. include $(top_srcdir)/include/mk/testcases.mk -include $(abs_srcdir)/../utils/newer_64.mk - -CPPFLAGS += -D_LARGEFILE64_SOURCE - -%_64: CPPFLAGS += -D_FILE_OFFSET_BITS=64 -DOFF_T=__off64_t include $(top_srcdir)/include/mk/generic_leaf_target.mk diff --git a/testcases/kernel/syscalls/getdents/getdents.h b/testcases/kernel/syscalls/getdents/getdents.h index ee19ad0..abea655 100644 --- a/testcases/kernel/syscalls/getdents/getdents.h +++ b/testcases/kernel/syscalls/getdents/getdents.h @@ -1,46 +1,32 @@ /* + * Copyright (c) International Business Machines Corp., 2001 + * Copyright (c) 2013 Cyril Hrubis <ch...@su...> * - * 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 free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 2 of the License, or - * (at your option) any later version. + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See + * the GNU General Public License for more details. * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See - * the GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software - * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA - */ - -/* - * getdents.h - common definitions for the getdents() tests. + * You should have received a copy of the GNU General Public 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 __GETDENTS_H -#define __GETDENTS_H 1 +#ifndef GETDENTS_H +#define GETDENTS_H -#include <dirent.h> -#include <features.h> -#include <stdio.h> -#include <string.h> -#include <unistd.h> -#include <sys/syscall.h> +#include <stdint.h> #include "test.h" #include "linux_syscall_numbers.h" /* - * The dirent struct that the C library exports is not the same - * as the kernel ABI, so we can't include dirent.h and use the - * dirent struct from there. Further, since the Linux headers - * don't export their vision of the struct either, we have to - * declare our own here. Wheeeeee. + * See fs/compat.c struct compat_linux_dirent */ - struct linux_dirent { unsigned long d_ino; unsigned long d_off; @@ -48,83 +34,24 @@ struct linux_dirent { char d_name[]; }; -struct linux_dirent64 { - unsigned long long d_ino; - long long d_off; - unsigned short d_reclen; - char d_name[]; -}; - static inline int -getdents(unsigned int fd, struct dirent *dirp, unsigned int count) +getdents(unsigned int fd, struct linux_dirent *dirp, unsigned int size) { - union { - struct linux_dirent *dirp; - char *buf; - } ptrs; - char buf[count]; - long ret; - unsigned int i; - - ptrs.buf = buf; - ret = ltp_syscall(__NR_getdents, fd, buf, count); - if (ret < 0) - return ret; - -#define kdircpy(field) memcpy(&dirp[i].field, &ptrs.dirp->field, sizeof(dirp[i].field)) - - i = 0; - while (i < count && i < ret) { - unsigned long reclen; - - kdircpy(d_ino); - kdircpy(d_reclen); - reclen = dirp[i].d_reclen; - kdircpy(d_off); - strcpy(dirp[i].d_name, ptrs.dirp->d_name); - - ptrs.buf += reclen; - - i += reclen; - } - - return ret; + return ltp_syscall(__NR_getdents, fd, dirp, size); } +struct linux_dirent64 { + uint64_t d_ino; + int64_t d_off; + unsigned short d_reclen; + unsigned char d_type; + char d_name[]; +}; + static inline int -getdents64(unsigned int fd, struct dirent64 *dirp, unsigned int count) +getdents64(unsigned int fd, struct linux_dirent64 *dirp64, unsigned int size) { - union { - struct linux_dirent64 *dirp; - char *buf; - } ptrs; - char buf[count]; - long ret; - unsigned int i; - - ptrs.buf = buf; - ret = ltp_syscall(__NR_getdents64, fd, buf, count); - if (ret < 0) - return ret; - -#define kdircpy(field) memcpy(&dirp[i].field, &ptrs.dirp->field, sizeof(dirp[i].field)) - - i = 0; - while (i < count && i < ret) { - unsigned long reclen; - - kdircpy(d_ino); - kdircpy(d_reclen); - reclen = dirp[i].d_reclen; - kdircpy(d_off); - strcpy(dirp[i].d_name, ptrs.dirp->d_name); - - ptrs.buf += reclen; - - i += reclen; - } - - return ret; + return ltp_syscall(__NR_getdents64, fd, dirp64, size); } -#endif /* getdents.h */ +#endif /* GETDENTS_H */ diff --git a/testcases/kernel/syscalls/getdents/getdents01.c b/testcases/kernel/syscalls/getdents/getdents01.c index 96cfc5a..fdfb1a0 100644 --- a/testcases/kernel/syscalls/getdents/getdents01.c +++ b/testcases/kernel/syscalls/getdents/getdents01.c @@ -1,5 +1,8 @@ /* * Copyright (c) International Business Machines Corp., 2001 + * written by Wayne Boyer + * Copyright (c) 2013 Markos Chandras + * Copyright (c) 2013 Cyril Hrubis <ch...@su...> * * This 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,34 +19,15 @@ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA */ -/* - * ALGORITHM - * issue the system call - * check the errno value - * if failure, log the errno and issue a FAIL message otherwise, - * if doing functionality testing, - * if the directory name of the first entry is "." - * issue a PASS message - * otherwise, - * issue a FAIL message - * break any remaining tests - * call cleanup - * - * HISTORY - * 03/2013 - Added -l option by Markos Chandras - * 03/2001 - Written by Wayne Boyer - */ +#include <stdio.h> +#include <errno.h> +#include <sys/types.h> +#include <sys/stat.h> +#include <fcntl.h> -#include "getdents.h" #include "test.h" #include "usctest.h" - -#include <errno.h> -#include <fcntl.h> -#include <linux/types.h> -#include <dirent.h> -#include <linux/unistd.h> -#include <unistd.h> +#include "getdents.h" static void cleanup(void); static void setup(void); @@ -64,56 +48,51 @@ static void help(void) printf(" -l Test the getdents64 system call\n"); } +/* Big enough for both dirp entires + data */ +#define BUFSIZE 512 + int main(int ac, char **av) { int lc; char *msg; int rval, fd; - int count; - size_t size = 0; - char *dir_name = NULL; - struct dirent64 *dirp64 = NULL; - struct dirent *dirp = NULL; + struct linux_dirent64 *dirp64; + struct linux_dirent *dirp; + void *buf; + + /* The buffer is allocated to make sure it's suitably aligned */ + buf = malloc(BUFSIZE); + + if (buf == NULL) + tst_brkm(TBROK, NULL, "malloc failed"); + + dirp64 = buf; + dirp = buf; if ((msg = parse_opts(ac, av, options, &help)) != NULL) tst_brkm(TBROK, NULL, "OPTION PARSING ERROR - %s", msg); setup(); - /* - * Set up count to be equal to the sizeof struct dirent, - * just to pick a decent size. - */ - if (longsyscall) { - if ((dirp64 = malloc(sizeof(struct dirent64))) == NULL) - tst_brkm(TBROK, cleanup, "malloc failed"); - count = sizeof(struct dirent64); - } else { - if ((dirp = malloc(sizeof(struct dirent))) == NULL) - tst_brkm(TBROK, cleanup, "malloc failed"); - count = sizeof(struct dirent); - } - for (lc = 0; TEST_LOOPING(lc); lc++) { - tst_count = 0; + const char *d_name; - if ((dir_name = getcwd(dir_name, size)) == NULL) - tst_brkm(TBROK, cleanup, "Can not get current " - "directory name"); + tst_count = 0; - if ((fd = open(dir_name, O_RDONLY)) == -1) + if ((fd = open(".", O_RDONLY)) == -1) tst_brkm(TBROK, cleanup, "open of directory failed"); if (longsyscall) - rval = getdents64(fd, dirp64, count); + rval = getdents64(fd, dirp64, BUFSIZE); else - rval = getdents(fd, dirp, count); + rval = getdents(fd, dirp, BUFSIZE); if (rval < 0) { - TEST_ERROR_LOG(errno); - - tst_resm(TFAIL | TERRNO, - "getdents failed unexpectedly"); + if (errno == ENOSYS) + tst_resm(TCONF, "syscall not implemented"); + else + tst_resm(TFAIL | TERRNO, + "getdents failed unexpectedly"); continue; } @@ -123,15 +102,22 @@ int main(int ac, char **av) continue; } - tst_resm(TPASS, "call succeeded"); + if (longsyscall) + d_name = dirp64->d_name; + else + d_name = dirp->d_name; - free(dir_name); - dir_name = NULL; + if (strcmp(d_name, ".")) + tst_resm(TFAIL, "First entry is not '.'"); + else + tst_resm(TPASS, "call succeeded"); - if ((rval = close(fd)) == -1) + if (close(fd) == -1) tst_brkm(TBROK, cleanup, "file close failed"); } + free(buf); + cleanup(); tst_exit(); } diff --git a/testcases/kernel/syscalls/getdents/getdents02.c b/testcases/kernel/syscalls/getdents/getdents02.c index 8f400b5..66cf89f 100644 --- a/testcases/kernel/syscalls/getdents/getdents02.c +++ b/testcases/kernel/syscalls/getdents/getdents02.c @@ -1,5 +1,8 @@ /* * Copyright (c) International Business Machines Corp., 2001 + * written by Wayne Boyer + * Copyright (c) 2013 Markos Chandras + * Copyright (c) 2013 Cyril Hrubis <ch...@su...> * * This 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,31 +19,15 @@ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA */ -/* - * ALGORITHM - * issue the system call using a bad file descriptor - * check the errno value - * issue a PASS message if we get EBADF - errno 9 - * otherwise, the tests fails - * issue a FAIL message - * break any remaining tests - * call cleanup - * - * HISTORY - * 03/2013 - Added -l option by Markos Chandras - * 03/2001 - Written by Wayne Boyer - */ +#include <stdio.h> +#include <errno.h> +#include <sys/types.h> +#include <sys/stat.h> +#include <fcntl.h> -#include "getdents.h" #include "test.h" #include "usctest.h" - -#include <errno.h> -#include <fcntl.h> -#include <linux/types.h> -#include <dirent.h> -#include <linux/unistd.h> -#include <unistd.h> +#include "getdents.h" static void cleanup(void); static void setup(void); @@ -67,43 +54,24 @@ int main(int ac, char **av) { int lc; char *msg; - int rval, fd; - int count; - size_t size = 0; - char *dir_name = NULL; - struct dirent64 *dirp64 = NULL; - struct dirent *dirp = NULL; + int rval; + struct linux_dirent64 dirp64; + struct linux_dirent dirp; if ((msg = parse_opts(ac, av, options, &help)) != NULL) tst_brkm(TBROK, NULL, "OPTION PARSING ERROR - %s", msg); setup(); - if (longsyscall) { - if ((dirp64 = malloc(sizeof(struct dirent))) == NULL) - tst_brkm(TBROK, cleanup, "malloc failed"); - count = sizeof(struct dirent64); - } else { - if ((dirp = malloc(sizeof(struct dirent))) == NULL) - tst_brkm(TBROK, cleanup, "malloc failed"); - count = sizeof(struct dirent); - } - for (lc = 0; TEST_LOOPING(lc); lc++) { - tst_count = 0; - - if ((dir_name = getcwd(dir_name, size)) == NULL) - tst_brkm(TBROK, cleanup, "Can not get current " - "directory name"); + int fd = -5; - /* set up a bad file descriptor */ - - fd = -5; + tst_count = 0; if (longsyscall) - rval = getdents64(fd, dirp64, count); + rval = getdents64(fd, &dirp64, sizeof(dirp64)); else - rval = getdents(fd, dirp, count); + rval = getdents(fd, &dirp, sizeof(dirp)); /* * Hopefully we get an error due to the bad file descriptor. @@ -115,19 +83,18 @@ int main(int ac, char **av) case EBADF: tst_resm(TPASS, "failed as expected with EBADF"); - break; + break; + case ENOSYS: + tst_resm(TCONF, "syscall not implemented"); + break; default: tst_resm(TFAIL | TERRNO, "getdents failed unexpectedly"); - break; + break; } } else { tst_resm(TFAIL, "call succeeded unexpectedly"); } - - free(dir_name); - dir_name = NULL; - } cleanup(); diff --git a/testcases/kernel/syscalls/getdents/getdents03.c b/testcases/kernel/syscalls/getdents/getdents03.c index c226fb5..5a7b295 100644 --- a/testcases/kernel/syscalls/getdents/getdents03.c +++ b/testcases/kernel/syscalls/getdents/getdents03.c @@ -1,5 +1,8 @@ /* * Copyright (c) International Business Machines Corp., 2001 + * written by Wayne Boyer + * Copyright (c) 2013 Markos Chandras + * Copyright (c) 2013 Cyril Hrubis <ch...@su...> * * This 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,31 +19,15 @@ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA */ -/* - * ALGORITHM - * issue the system call using a memory size (count) that is too small - * check the errno value - * issue a PASS message if we get EINVAL - * otherwise, the tests fails - * issue a FAIL message - * break any remaining tests - * call cleanup - * - * HISTORY - * 03/2013 - Added -l option by Markos Chandras - * 03/2001 - Written by Wayne Boyer - */ +#include <stdio.h> +#include <errno.h> +#include <sys/types.h> +#include <sys/stat.h> +#include <fcntl.h> -#include "getdents.h" #include "test.h" #include "usctest.h" - -#include <errno.h> -#include <fcntl.h> -#include <linux/types.h> -#include <dirent.h> -#include <linux/unistd.h> -#include <unistd.h> +#include "getdents.h" static void cleanup(void); static void setup(void); @@ -68,42 +55,24 @@ int main(int ac, char **av) int lc; char *msg; int rval, fd; - int count; - size_t size = 0; - char *dir_name = NULL; - struct dirent64 *dirp64 = NULL; - struct dirent *dirp = NULL; + char buf[1]; if ((msg = parse_opts(ac, av, options, &help)) != NULL) tst_brkm(TBROK, NULL, "OPTION PARSING ERROR - %s", msg); setup(); - if (longsyscall) { - if ((dirp64 = malloc(sizeof(struct dirent64))) == NULL) - tst_brkm(TBROK, cleanup, "malloc failed"); - } else { - if ((dirp = malloc(sizeof(struct dirent))) == NULL) - tst_brkm(TBROK, cleanup, "malloc failed"); - } - for (lc = 0; TEST_LOOPING(lc); lc++) { tst_count = 0; - if ((dir_name = getcwd(dir_name, size)) == NULL) - tst_brkm(TBROK, cleanup, "Can not get current " - "directory name"); - - /* Set count to be very small. The result should be EINVAL */ - count = 1; - - if ((fd = open(dir_name, O_RDONLY)) == -1) + if ((fd = open(".", O_RDONLY)) == -1) tst_brkm(TBROK, cleanup, "open of directory failed"); + /* Pass one byte long buffer. The result should be EINVAL */ if (longsyscall) - rval = getdents64(fd, dirp64, count); + rval = getdents64(fd, (void *)buf, sizeof(buf)); else - rval = getdents(fd, dirp, count); + rval = getdents(fd, (void *)buf, sizeof(buf)); /* * Hopefully we get an error due to the small buffer. @@ -115,7 +84,10 @@ int main(int ac, char **av) case EINVAL: tst_resm(TPASS, "getdents failed with EINVAL as expected"); - break; + break; + case ENOSYS: + tst_resm(TCONF, "syscall not implemented"); + break; default: tst_resm(TFAIL | TERRNO, "getdents call failed unexpectedly"); @@ -125,10 +97,7 @@ int main(int ac, char **av) tst_resm(TFAIL, "getdents passed unexpectedly"); } - free(dir_name); - dir_name = NULL; - - if ((rval = close(fd)) == -1) + if (close(fd) == -1) tst_brkm(TBROK, cleanup, "fd close failed"); } diff --git a/testcases/kernel/syscalls/getdents/getdents04.c b/testcases/kernel/syscalls/getdents/getdents04.c index 965c45e..5d94cda 100644 --- a/testcases/kernel/syscalls/getdents/getdents04.c +++ b/testcases/kernel/syscalls/getdents/getdents04.c @@ -1,5 +1,8 @@ /* * Copyright (c) International Business Machines Corp., 2001 + * written by Wayne Boyer + * Copyright (c) 2013 Markos Chandras + * Copyright (c) 2013 Cyril Hrubis <ch...@su...> * * This 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,32 +19,15 @@ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA */ -/* - * ALGORITHM - * issue the system call using a file descriptor for a file - * check the errno value - * issue a PASS message if we get ENOTDIR - * otherwise, the tests fails - * issue a FAIL message - * break any remaining tests - * call cleanup - * - * HISTORY - * 03/2013 - Added -l option by Markos Chandras - * 03/2001 - Written by Wayne Boyer - */ +#include <stdio.h> +#include <errno.h> +#include <sys/types.h> +#include <sys/stat.h> +#include <fcntl.h> -#include "getdents.h" #include "test.h" #include "usctest.h" - -#include <errno.h> -#include <fcntl.h> -#include <linux/types.h> -#include <dirent.h> -#include <linux/unistd.h> -#include <unistd.h> -#include <sys/stat.h> +#include "getdents.h" static void cleanup(void); static void setup(void); @@ -68,68 +54,31 @@ int main(int ac, char **av) { int lc; char *msg; - int count, rval, fd; - size_t size = 0; - char *dir_name = NULL; - struct stat *sbuf; - char *newfile; - struct dirent64 *dirp64 = NULL; - struct dirent *dirp = NULL; + int rval, fd; + struct linux_dirent64 dir64; + struct linux_dirent dir; if ((msg = parse_opts(ac, av, options, &help)) != NULL) tst_brkm(TBROK, NULL, "OPTION PARSING ERROR - %s", msg); setup(); - if (longsyscall) { - if ((dirp64 = malloc(sizeof(struct dirent64))) == NULL) - tst_brkm(TBROK, cleanup, "malloc failed"); - count = sizeof(struct dirent64); - } else { - if ((dirp = malloc(sizeof(struct dirent))) == NULL) - tst_brkm(TBROK, cleanup, "malloc failed"); - count = sizeof(struct dirent); - } - for (lc = 0; TEST_LOOPING(lc); lc++) { tst_count = 0; - if ((dir_name = getcwd(dir_name, size)) == NULL) - tst_brkm(TBROK, cleanup, "Can not get current " - "directory name"); - - /* set up some space for a file name */ - if ((newfile = malloc(sizeof(char) * 20)) == NULL) - tst_brkm(TBROK, cleanup, "newfile malloc failed"); - - if ((rval = sprintf(newfile, "getdents03.%d", getpid())) < 0) - tst_brkm(TBROK, cleanup, "sprintf failed"); - - if ((fd = open(newfile, O_CREAT | O_RDWR, 0777)) == -1) + if ((fd = open("test", O_CREAT | O_RDWR, 0777)) == -1) tst_brkm(TBROK | TERRNO, cleanup, "open of file failed"); - /* set up some space for the stat buffer */ - if ((sbuf = malloc(sizeof(struct stat))) == NULL) - tst_brkm(TBROK, cleanup, "stat malloc failed"); - - /* make sure fd is not a directory */ - if ((rval = fstat(fd, sbuf)) == -1) - tst_brkm(TBROK, cleanup, "fstat failed"); - - if (S_ISDIR(sbuf->st_mode)) - tst_brkm(TBROK, cleanup, "fd is a directory"); - if (longsyscall) - rval = getdents64(fd, dirp64, count); + rval = getdents64(fd, &dir64, sizeof(dir64)); else - rval = getdents(fd, dirp, count); + rval = getdents(fd, &dir, sizeof(dir)); /* * Calling with a non directory file descriptor should give * an ENOTDIR error. */ - if (rval < 0) { TEST_ERROR_LOG(errno); @@ -137,23 +86,22 @@ int main(int ac, char **av) case ENOTDIR: tst_resm(TPASS, "getdents failed as expected with ENOTDIR"); - break; + break; + case ENOSYS: + tst_resm(TCONF, "syscall not implemented"); + break; + break; default: tst_resm(TFAIL | TERRNO, "getdents failed unexpectedly"); - break; + break; } } else { tst_resm(TFAIL, "getdents call succeeded unexpectedly"); } - free(dir_name); - dir_name = NULL; - - if ((rval = close(fd)) == -1) + if (close(fd) == -1) tst_brkm(TBROK, cleanup, "fd close failed"); - if ((rval = unlink(newfile)) == -1) - tst_brkm(TBROK, cleanup, "file unlink failed"); } cleanup(); hooks/post-receive -- ltp |
From: Cyril H. <su...@li...> - 2013-03-18 13:21:35
|
The branch, master, has been updated via caf3d347df69cd00ab27bf26d1093779a8c66f27 (commit) via 28894f58504201771a6888f6bb6feb16ba48a190 (commit) from d14536de6f91935bde3b6f6ecb5cc720525e3712 (commit) - Log ----------------------------------------------------------------- commit caf3d347df69cd00ab27bf26d1093779a8c66f27 Author: Cyril Hrubis <ch...@su...> Date: Mon Mar 18 14:10:32 2013 +0100 syscalls/getdents: Fix a few style nits. Signed-off-by: Cyril Hrubis <ch...@su...> commit 28894f58504201771a6888f6bb6feb16ba48a190 Author: Markos Chandras <mar...@im...> Date: Mon Mar 18 10:54:53 2013 +0000 syscalls/getdents: Add parameter to test getdents64 syscall Add new "-l" parameter to test the getdents64 syscall along with the getdents one. Use ltp_syscall() to call the system call to get proper return values when an architecture does not support any of the getdents{,64} syscalls. Modify runtest/syscalls to call getdentsXX tests with and without the "-l" parameter Signed-off-by: Markos Chandras <mar...@im...> ----------------------------------------------------------------------- Summary of changes: runtest/syscalls | 9 ++ testcases/kernel/syscalls/getdents/Makefile | 2 + testcases/kernel/syscalls/getdents/getdents.h | 48 ++++++++++- testcases/kernel/syscalls/getdents/getdents01.c | 110 +++++++++++------------ testcases/kernel/syscalls/getdents/getdents02.c | 100 ++++++++++---------- testcases/kernel/syscalls/getdents/getdents03.c | 104 ++++++++++----------- testcases/kernel/syscalls/getdents/getdents04.c | 104 ++++++++++----------- 7 files changed, 260 insertions(+), 217 deletions(-) diff --git a/runtest/syscalls b/runtest/syscalls index c70bcbd..191ad10 100644 --- a/runtest/syscalls +++ b/runtest/syscalls @@ -331,6 +331,15 @@ getdents03_64 getdents03_64 getdents04 getdents04 getdents04_64 getdents04_64 +getdents01_long getdents01 -l +getdents01_64_long getdents01_64 -l +getdents02_long getdents02 -l +getdents02_64_long getdents02_64 -l +getdents03_long getdents03 -l +getdents03_64_long getdents03_64 -l +getdents04_long getdents04 -l +getdents04_64_long getdents04_64 -l + getdomainname01 getdomainname01 getdtablesize01 getdtablesize01 diff --git a/testcases/kernel/syscalls/getdents/Makefile b/testcases/kernel/syscalls/getdents/Makefile index df7b63f..ebcbc4f 100644 --- a/testcases/kernel/syscalls/getdents/Makefile +++ b/testcases/kernel/syscalls/getdents/Makefile @@ -21,6 +21,8 @@ top_srcdir ?= ../../../.. include $(top_srcdir)/include/mk/testcases.mk include $(abs_srcdir)/../utils/newer_64.mk +CPPFLAGS += -D_LARGEFILE64_SOURCE + %_64: CPPFLAGS += -D_FILE_OFFSET_BITS=64 -DOFF_T=__off64_t include $(top_srcdir)/include/mk/generic_leaf_target.mk diff --git a/testcases/kernel/syscalls/getdents/getdents.h b/testcases/kernel/syscalls/getdents/getdents.h index 1d5e584..ee19ad0 100644 --- a/testcases/kernel/syscalls/getdents/getdents.h +++ b/testcases/kernel/syscalls/getdents/getdents.h @@ -25,10 +25,13 @@ #define __GETDENTS_H 1 #include <dirent.h> +#include <features.h> #include <stdio.h> #include <string.h> #include <unistd.h> #include <sys/syscall.h> +#include "test.h" +#include "linux_syscall_numbers.h" /* * The dirent struct that the C library exports is not the same @@ -45,6 +48,13 @@ struct linux_dirent { char d_name[]; }; +struct linux_dirent64 { + unsigned long long d_ino; + long long d_off; + unsigned short d_reclen; + char d_name[]; +}; + static inline int getdents(unsigned int fd, struct dirent *dirp, unsigned int count) { @@ -57,7 +67,43 @@ getdents(unsigned int fd, struct dirent *dirp, unsigned int count) unsigned int i; ptrs.buf = buf; - ret = syscall(SYS_getdents, fd, buf, count); + ret = ltp_syscall(__NR_getdents, fd, buf, count); + if (ret < 0) + return ret; + +#define kdircpy(field) memcpy(&dirp[i].field, &ptrs.dirp->field, sizeof(dirp[i].field)) + + i = 0; + while (i < count && i < ret) { + unsigned long reclen; + + kdircpy(d_ino); + kdircpy(d_reclen); + reclen = dirp[i].d_reclen; + kdircpy(d_off); + strcpy(dirp[i].d_name, ptrs.dirp->d_name); + + ptrs.buf += reclen; + + i += reclen; + } + + return ret; +} + +static inline int +getdents64(unsigned int fd, struct dirent64 *dirp, unsigned int count) +{ + union { + struct linux_dirent64 *dirp; + char *buf; + } ptrs; + char buf[count]; + long ret; + unsigned int i; + + ptrs.buf = buf; + ret = ltp_syscall(__NR_getdents64, fd, buf, count); if (ret < 0) return ret; diff --git a/testcases/kernel/syscalls/getdents/getdents01.c b/testcases/kernel/syscalls/getdents/getdents01.c index af0ac1a..96cfc5a 100644 --- a/testcases/kernel/syscalls/getdents/getdents01.c +++ b/testcases/kernel/syscalls/getdents/getdents01.c @@ -1,35 +1,26 @@ /* + * Copyright (c) International Business Machines Corp., 2001 * - * 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 free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 2 of the License, or - * (at your option) any later version. + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See + * the GNU General Public License for more details. * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See - * the GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software - * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software + * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA */ /* - * NAME - * getdents01.c - * - * DESCRIPTION - * getdents01 - get a directory entry - * * ALGORITHM - * loop if that option was specified * issue the system call * check the errno value - * if failure, log the errno and issue a FAIL message - * otherwise, + * if failure, log the errno and issue a FAIL message otherwise, * if doing functionality testing, * if the directory name of the first entry is "." * issue a PASS message @@ -38,20 +29,9 @@ * break any remaining tests * call cleanup * - * USAGE: <for command-line> - * getdents01 [-c n] [-f] [-i n] [-I x] [-p x] [-t] - * where, -c n : Run n copies concurrently. - * -f : Turn off functionality Testing. - * -i n : Execute test n times. - * -I x : Execute test for x seconds. - * -P x : Pause for x seconds between iterations. - * -t : Turn on syscall timing. - * * HISTORY + * 03/2013 - Added -l option by Markos Chandras * 03/2001 - Written by Wayne Boyer - * - * RESTRICTIONS - * Any restrictions */ #include "getdents.h" @@ -65,12 +45,25 @@ #include <linux/unistd.h> #include <unistd.h> -void cleanup(void); -void setup(void); +static void cleanup(void); +static void setup(void); char *TCID = "getdents01"; int TST_TOTAL = 1; +static int longsyscall; + +static option_t options[] = { + /* -l long option. Tests getdents64 */ + {"l", &longsyscall, NULL}, + {NULL, NULL, NULL} +}; + +static void help(void) +{ + printf(" -l Test the getdents64 system call\n"); +} + int main(int ac, char **av) { int lc; @@ -79,13 +72,28 @@ int main(int ac, char **av) int count; size_t size = 0; char *dir_name = NULL; - struct dirent *dirp; + struct dirent64 *dirp64 = NULL; + struct dirent *dirp = NULL; - if ((msg = parse_opts(ac, av, NULL, NULL)) != NULL) + if ((msg = parse_opts(ac, av, options, &help)) != NULL) tst_brkm(TBROK, NULL, "OPTION PARSING ERROR - %s", msg); setup(); + /* + * Set up count to be equal to the sizeof struct dirent, + * just to pick a decent size. + */ + if (longsyscall) { + if ((dirp64 = malloc(sizeof(struct dirent64))) == NULL) + tst_brkm(TBROK, cleanup, "malloc failed"); + count = sizeof(struct dirent64); + } else { + if ((dirp = malloc(sizeof(struct dirent))) == NULL) + tst_brkm(TBROK, cleanup, "malloc failed"); + count = sizeof(struct dirent); + } + for (lc = 0; TEST_LOOPING(lc); lc++) { tst_count = 0; @@ -93,22 +101,15 @@ int main(int ac, char **av) tst_brkm(TBROK, cleanup, "Can not get current " "directory name"); - if ((dirp = malloc(sizeof(struct dirent))) == NULL) - tst_brkm(TBROK, cleanup, "malloc failed"); - - /* - * Set up count to be equal to the sizeof struct dirent, - * just to pick a decent size. - */ - - count = (int)sizeof(struct dirent); - if ((fd = open(dir_name, O_RDONLY)) == -1) tst_brkm(TBROK, cleanup, "open of directory failed"); - rval = getdents(fd, dirp, count); - if (rval < 0) { + if (longsyscall) + rval = getdents64(fd, dirp64, count); + else + rval = getdents(fd, dirp, count); + if (rval < 0) { TEST_ERROR_LOG(errno); tst_resm(TFAIL | TERRNO, @@ -127,20 +128,16 @@ int main(int ac, char **av) free(dir_name); dir_name = NULL; - free(dirp); - if ((rval = close(fd)) == -1) tst_brkm(TBROK, cleanup, "file close failed"); } cleanup(); - tst_exit(); } -void setup(void) +static void setup(void) { - tst_sig(NOFORK, DEF_HANDLER, cleanup); tst_tmpdir(); @@ -148,9 +145,8 @@ void setup(void) TEST_PAUSE; } -void cleanup(void) +static void cleanup(void) { - TEST_CLEANUP; tst_rmdir(); diff --git a/testcases/kernel/syscalls/getdents/getdents02.c b/testcases/kernel/syscalls/getdents/getdents02.c index ee34de2..8f400b5 100644 --- a/testcases/kernel/syscalls/getdents/getdents02.c +++ b/testcases/kernel/syscalls/getdents/getdents02.c @@ -1,31 +1,23 @@ /* + * Copyright (c) International Business Machines Corp., 2001 * - * 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 free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 2 of the License, or - * (at your option) any later version. + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See + * the GNU General Public License for more details. * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See - * the GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software - * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software + * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA */ /* - * NAME - * getdents02.c - * - * DESCRIPTION - * getdents02 - check that we get a failure with a bad file descriptor - * * ALGORITHM - * loop if that option was specified * issue the system call using a bad file descriptor * check the errno value * issue a PASS message if we get EBADF - errno 9 @@ -34,20 +26,9 @@ * break any remaining tests * call cleanup * - * USAGE: <for command-line> - * getdents02 [-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. - * * HISTORY + * 03/2013 - Added -l option by Markos Chandras * 03/2001 - Written by Wayne Boyer - * - * RESTRICTIONS - * none */ #include "getdents.h" @@ -61,13 +42,26 @@ #include <linux/unistd.h> #include <unistd.h> -void cleanup(void); -void setup(void); +static void cleanup(void); +static void setup(void); char *TCID = "getdents02"; int TST_TOTAL = 1; -int exp_enos[] = { EBADF, 0 }; /* 0 terminated list of expected errnos */ +static int exp_enos[] = { EBADF, 0 }; + +static int longsyscall; + +option_t options[] = { + /* -l long option. Tests getdents64 */ + {"l", &longsyscall, NULL}, + {NULL, NULL, NULL} +}; + +static void help(void) +{ + printf(" -l Test the getdents64 system call\n"); +} int main(int ac, char **av) { @@ -77,13 +71,24 @@ int main(int ac, char **av) int count; size_t size = 0; char *dir_name = NULL; - struct dirent *dirp; + struct dirent64 *dirp64 = NULL; + struct dirent *dirp = NULL; - if ((msg = parse_opts(ac, av, NULL, NULL)) != NULL) + if ((msg = parse_opts(ac, av, options, &help)) != NULL) tst_brkm(TBROK, NULL, "OPTION PARSING ERROR - %s", msg); setup(); + if (longsyscall) { + if ((dirp64 = malloc(sizeof(struct dirent))) == NULL) + tst_brkm(TBROK, cleanup, "malloc failed"); + count = sizeof(struct dirent64); + } else { + if ((dirp = malloc(sizeof(struct dirent))) == NULL) + tst_brkm(TBROK, cleanup, "malloc failed"); + count = sizeof(struct dirent); + } + for (lc = 0; TEST_LOOPING(lc); lc++) { tst_count = 0; @@ -91,16 +96,14 @@ int main(int ac, char **av) tst_brkm(TBROK, cleanup, "Can not get current " "directory name"); - if ((dirp = malloc(sizeof(struct dirent))) == NULL) - tst_brkm(TBROK, cleanup, "malloc failed"); - - count = (int)sizeof(struct dirent); - /* set up a bad file descriptor */ fd = -5; - rval = getdents(fd, dirp, count); + if (longsyscall) + rval = getdents64(fd, dirp64, count); + else + rval = getdents(fd, dirp, count); /* * Hopefully we get an error due to the bad file descriptor. @@ -118,23 +121,21 @@ int main(int ac, char **av) "getdents failed unexpectedly"); break; } - } else + } else { tst_resm(TFAIL, "call succeeded unexpectedly"); + } free(dir_name); dir_name = NULL; - free(dirp); } cleanup(); - tst_exit(); } -void setup(void) +static void setup(void) { - tst_sig(NOFORK, DEF_HANDLER, cleanup); tst_tmpdir(); @@ -144,9 +145,8 @@ void setup(void) TEST_PAUSE; } -void cleanup(void) +static void cleanup(void) { - TEST_CLEANUP; tst_rmdir(); diff --git a/testcases/kernel/syscalls/getdents/getdents03.c b/testcases/kernel/syscalls/getdents/getdents03.c index 700e54b..c226fb5 100644 --- a/testcases/kernel/syscalls/getdents/getdents03.c +++ b/testcases/kernel/syscalls/getdents/getdents03.c @@ -1,34 +1,23 @@ /* + * Copyright (c) International Business Machines Corp., 2001 * - * 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 free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 2 of the License, or - * (at your option) any later version. + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See + * the GNU General Public License for more details. * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See - * the GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software - * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software + * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA */ /* - * NAME - * getdents03.c - * - * DESCRIPTION - * getdents03 - check for an EINVAL error - * - * CALLS - * getdents() - * * ALGORITHM - * loop if that option was specified * issue the system call using a memory size (count) that is too small * check the errno value * issue a PASS message if we get EINVAL @@ -37,20 +26,9 @@ * break any remaining tests * call cleanup * - * USAGE: <for command-line> - * getdents03 [-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. - * * HISTORY + * 03/2013 - Added -l option by Markos Chandras * 03/2001 - Written by Wayne Boyer - * - * RESTRICTIONS - * none */ #include "getdents.h" @@ -64,13 +42,26 @@ #include <linux/unistd.h> #include <unistd.h> -void cleanup(void); -void setup(void); +static void cleanup(void); +static void setup(void); char *TCID = "getdents03"; int TST_TOTAL = 1; -int exp_enos[] = { EINVAL, 0 }; /* 0 terminated list of expected errnos */ +static int exp_enos[] = { EINVAL, 0 }; + +static int longsyscall; + +static option_t options[] = { + /* -l long option. Tests getdents64 */ + {"l", &longsyscall, NULL}, + {NULL, NULL, NULL} +}; + +static void help(void) +{ + printf(" -l Test the getdents64 system call\n"); +} int main(int ac, char **av) { @@ -80,13 +71,22 @@ int main(int ac, char **av) int count; size_t size = 0; char *dir_name = NULL; - struct dirent *dirp; + struct dirent64 *dirp64 = NULL; + struct dirent *dirp = NULL; - if ((msg = parse_opts(ac, av, NULL, NULL)) != NULL) + if ((msg = parse_opts(ac, av, options, &help)) != NULL) tst_brkm(TBROK, NULL, "OPTION PARSING ERROR - %s", msg); setup(); + if (longsyscall) { + if ((dirp64 = malloc(sizeof(struct dirent64))) == NULL) + tst_brkm(TBROK, cleanup, "malloc failed"); + } else { + if ((dirp = malloc(sizeof(struct dirent))) == NULL) + tst_brkm(TBROK, cleanup, "malloc failed"); + } + for (lc = 0; TEST_LOOPING(lc); lc++) { tst_count = 0; @@ -94,22 +94,20 @@ int main(int ac, char **av) tst_brkm(TBROK, cleanup, "Can not get current " "directory name"); - if ((dirp = malloc(sizeof(struct dirent))) == NULL) - tst_brkm(TBROK, cleanup, "malloc failed"); - - /* Set count to be very small. The result should be EINVAL */ - + /* Set count to be very small. The result should be EINVAL */ count = 1; if ((fd = open(dir_name, O_RDONLY)) == -1) tst_brkm(TBROK, cleanup, "open of directory failed"); - rval = getdents(fd, dirp, count); + if (longsyscall) + rval = getdents64(fd, dirp64, count); + else + rval = getdents(fd, dirp, count); /* * Hopefully we get an error due to the small buffer. */ - if (rval < 0) { TEST_ERROR_LOG(errno); @@ -123,26 +121,23 @@ int main(int ac, char **av) "getdents call failed unexpectedly"); break; } - } else + } else { tst_resm(TFAIL, "getdents passed unexpectedly"); + } free(dir_name); dir_name = NULL; - free(dirp); - if ((rval = close(fd)) == -1) tst_brkm(TBROK, cleanup, "fd close failed"); } cleanup(); - tst_exit(); } -void setup(void) +static void setup(void) { - tst_sig(NOFORK, DEF_HANDLER, cleanup); TEST_PAUSE; @@ -154,9 +149,8 @@ void setup(void) TEST_PAUSE; } -void cleanup(void) +static void cleanup(void) { - TEST_CLEANUP; tst_rmdir(); diff --git a/testcases/kernel/syscalls/getdents/getdents04.c b/testcases/kernel/syscalls/getdents/getdents04.c index 89479a4..965c45e 100644 --- a/testcases/kernel/syscalls/getdents/getdents04.c +++ b/testcases/kernel/syscalls/getdents/getdents04.c @@ -1,34 +1,23 @@ /* + * Copyright (c) International Business Machines Corp., 2001 * - * 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 free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 2 of the License, or - * (at your option) any later version. + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See + * the GNU General Public License for more details. * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See - * the GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software - * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software + * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA */ /* - * NAME - * getdents04.c - * - * DESCRIPTION - * getdents04 - check for an ENOTDIR error - * - * CALLS - * getdents() - * * ALGORITHM - * loop if that option was specified * issue the system call using a file descriptor for a file * check the errno value * issue a PASS message if we get ENOTDIR @@ -37,20 +26,9 @@ * break any remaining tests * call cleanup * - * USAGE: <for command-line> - * getdents04 [-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. - * * HISTORY + * 03/2013 - Added -l option by Markos Chandras * 03/2001 - Written by Wayne Boyer - * - * RESTRICTIONS - * none */ #include "getdents.h" @@ -65,13 +43,26 @@ #include <unistd.h> #include <sys/stat.h> -void cleanup(void); -void setup(void); +static void cleanup(void); +static void setup(void); char *TCID = "getdents04"; int TST_TOTAL = 1; -int exp_enos[] = { ENOTDIR, 0 }; /* 0 terminated list of expected errnos */ +static int exp_enos[] = { ENOTDIR, 0 }; + +static int longsyscall; + +static option_t options[] = { + /* -l long option. Tests getdents64 */ + {"l", &longsyscall, NULL}, + {NULL, NULL, NULL} +}; + +static void help(void) +{ + printf(" -l Test the getdents64 system call\n"); +} int main(int ac, char **av) { @@ -80,15 +71,26 @@ int main(int ac, char **av) int count, rval, fd; size_t size = 0; char *dir_name = NULL; - struct dirent *dirp; struct stat *sbuf; char *newfile; + struct dirent64 *dirp64 = NULL; + struct dirent *dirp = NULL; - if ((msg = parse_opts(ac, av, NULL, NULL)) != NULL) + if ((msg = parse_opts(ac, av, options, &help)) != NULL) tst_brkm(TBROK, NULL, "OPTION PARSING ERROR - %s", msg); setup(); + if (longsyscall) { + if ((dirp64 = malloc(sizeof(struct dirent64))) == NULL) + tst_brkm(TBROK, cleanup, "malloc failed"); + count = sizeof(struct dirent64); + } else { + if ((dirp = malloc(sizeof(struct dirent))) == NULL) + tst_brkm(TBROK, cleanup, "malloc failed"); + count = sizeof(struct dirent); + } + for (lc = 0; TEST_LOOPING(lc); lc++) { tst_count = 0; @@ -96,11 +98,6 @@ int main(int ac, char **av) tst_brkm(TBROK, cleanup, "Can not get current " "directory name"); - if ((dirp = malloc(sizeof(struct dirent))) == NULL) - tst_brkm(TBROK, cleanup, "malloc failed"); - - count = (int)sizeof(struct dirent); - /* set up some space for a file name */ if ((newfile = malloc(sizeof(char) * 20)) == NULL) tst_brkm(TBROK, cleanup, "newfile malloc failed"); @@ -123,7 +120,10 @@ int main(int ac, char **av) if (S_ISDIR(sbuf->st_mode)) tst_brkm(TBROK, cleanup, "fd is a directory"); - rval = getdents(fd, dirp, count); + if (longsyscall) + rval = getdents64(fd, dirp64, count); + else + rval = getdents(fd, dirp, count); /* * Calling with a non directory file descriptor should give @@ -143,14 +143,13 @@ int main(int ac, char **av) "getdents failed unexpectedly"); break; } - } else + } else { tst_resm(TFAIL, "getdents call succeeded unexpectedly"); + } free(dir_name); dir_name = NULL; - free(dirp); - if ((rval = close(fd)) == -1) tst_brkm(TBROK, cleanup, "fd close failed"); if ((rval = unlink(newfile)) == -1) @@ -158,13 +157,11 @@ int main(int ac, char **av) } cleanup(); - tst_exit(); } -void setup(void) +static void setup(void) { - tst_sig(NOFORK, DEF_HANDLER, cleanup); tst_tmpdir(); @@ -174,9 +171,8 @@ void setup(void) TEST_PAUSE; } -void cleanup(void) +static void cleanup(void) { - TEST_CLEANUP; tst_rmdir(); hooks/post-receive -- ltp |
From: Mike F. <su...@li...> - 2013-03-16 15:40:35
|
The branch, master, has been updated via d14536de6f91935bde3b6f6ecb5cc720525e3712 (commit) from e3276e6050219f2a0161daf46ee8e747fabae5dc (commit) - Log ----------------------------------------------------------------- commit d14536de6f91935bde3b6f6ecb5cc720525e3712 Author: Markos Chandras <mar...@im...> Date: Thu Mar 14 16:55:51 2013 +0000 ltp: Add support for Imagination Technologies Meta This patch adds support for Imagination's Meta architecture. The Meta Linux kernel port will be included in the Linux Kernel v3.9. The Meta stack grows upwards so we need to add the appropriate __metag__ macro to the ltp_clone function. Also fix the #if/def macro for s390x. Signed-off-by: Markos Chandras <mar...@im...> Signed-off-by: Mike Frysinger <va...@ge...> ----------------------------------------------------------------------- Summary of changes: lib/cloner.c | 4 ++-- 1 files changed, 2 insertions(+), 2 deletions(-) diff --git a/lib/cloner.c b/lib/cloner.c index 3835184..a68ff1e 100644 --- a/lib/cloner.c +++ b/lib/cloner.c @@ -31,7 +31,7 @@ #undef clone /* we want to use clone() */ -#if defined (__s390__) || (__s390x__) +#if defined (__s390__) || defined(__s390x__) #define clone __clone extern int __clone(int (void *), void *, int, void *); #elif defined(__ia64__) @@ -54,7 +54,7 @@ ltp_clone(unsigned long clone_flags, int (*fn) (void *arg), void *arg, { int ret; -#if defined(__hppa__) +#if defined(__hppa__) || defined(__metag__) ret = clone(fn, stack, clone_flags, arg); #elif defined(__ia64__) ret = clone2(fn, stack, stack_size, clone_flags, arg, NULL, NULL, NULL); hooks/post-receive -- ltp |
From: Cyril H. <su...@li...> - 2013-03-12 16:21:48
|
The branch, master, has been updated via e3276e6050219f2a0161daf46ee8e747fabae5dc (commit) via 9af1f7495db94af73e5e68c14a1aa02a4133e49d (commit) via 5a4ed9169b121baa413dcde75baf594dd15a2ff1 (commit) via 1b7884a288e538615c842c5999c9298558072259 (commit) via fe4c96c94dfbd28bf331615bee99a1f4b1433e59 (commit) via 6d99ffa539eac1b5c679417e554fde9c397c481e (commit) via 68b3eeeb48cf624c8dfe1b3f093272c4f324563e (commit) via d99055d570d91c6b86e819405c096aa082cb700b (commit) via 222d1e773b55476a5d7d8a6cf802a53d66db6ec6 (commit) from 7f825dd95f3b6a1d1c3acd9762921a1ea1cb5055 (commit) - Log ----------------------------------------------------------------- commit e3276e6050219f2a0161daf46ee8e747fabae5dc Author: Cyril Hrubis <ch...@su...> Date: Tue Mar 12 15:43:54 2013 +0100 openposix/.../sched_yield/3-1.sh: Remove. There is no point in keeping it. Signed-off-by: Cyril Hrubis <ch...@su...> commit 9af1f7495db94af73e5e68c14a1aa02a4133e49d Author: Cyril Hrubis <ch...@su...> Date: Tue Mar 12 15:32:51 2013 +0100 openposix/.../sigignore: Cleanup. Signed-off-by: Cyril Hrubis <ch...@su...> commit 5a4ed9169b121baa413dcde75baf594dd15a2ff1 Author: Cyril Hrubis <ch...@su...> Date: Tue Mar 12 15:20:29 2013 +0100 openposix/.../sigignore/5-*: Cleanup. Merge 5-* into 5-1.c Signed-off-by: Cyril Hrubis <ch...@su...> commit 1b7884a288e538615c842c5999c9298558072259 Author: Cyril Hrubis <ch...@su...> Date: Tue Mar 12 15:03:15 2013 +0100 openposix/.../sigrelse: Cleanup. Unify the code and test outputs. Also reduce the sleep to 0.1 second. Signed-off-by: Cyril Hrubis <ch...@su...> commit fe4c96c94dfbd28bf331615bee99a1f4b1433e59 Author: Cyril Hrubis <ch...@su...> Date: Tue Mar 12 14:22:26 2013 +0100 openposix/.../sigrelse/3-*: Fixes. Remove the SIGSEGV hack. Merge 3-* into 3-1.c Signed-off-by: Cyril Hrubis <ch...@su...> commit 6d99ffa539eac1b5c679417e554fde9c397c481e Author: Cyril Hrubis <ch...@su...> Date: Tue Mar 12 13:43:13 2013 +0100 openposix/.../sigismember: Cleanup. Signed-off-by: Cyril Hrubis <ch...@su...> commit 68b3eeeb48cf624c8dfe1b3f093272c4f324563e Author: Cyril Hrubis <ch...@su...> Date: Tue Mar 12 13:36:53 2013 +0100 openposix/.../sigismember/5-*: Cleanup. Merge 5-* into 5-1.c Signed-off-by: Cyril Hrubis <ch...@su...> commit d99055d570d91c6b86e819405c096aa082cb700b Author: Cyril Hrubis <ch...@su...> Date: Tue Mar 12 13:02:07 2013 +0100 openposix/.../sigdelset/2-1: Remove. Remove test for undefined behavior. Signed-off-by: Cyril Hrubis <ch...@su...> commit 222d1e773b55476a5d7d8a6cf802a53d66db6ec6 Author: Cyril Hrubis <ch...@su...> Date: Tue Mar 12 12:58:36 2013 +0100 openposix/.../sigdelset/4-*: Cleanup. Merge 4-* into 4-1.c Signed-off-by: Cyril Hrubis <ch...@su...> ----------------------------------------------------------------------- Summary of changes: .../conformance/interfaces/sched_yield/3-1.sh | 7 -- .../conformance/interfaces/sigdelset/2-1.c | 30 ------ .../interfaces/{sigaddset => sigdelset}/4-1.c | 24 +++-- .../conformance/interfaces/sigdelset/4-1.sh | 13 --- .../conformance/interfaces/sigdelset/4-2.sh | 13 --- .../conformance/interfaces/sigdelset/4-3.sh | 13 --- .../conformance/interfaces/sigdelset/4-4.sh | 13 --- .../conformance/interfaces/sigdelset/4-core.c | 78 --------------- .../conformance/interfaces/sigignore/1-1.c | 10 +- .../conformance/interfaces/sigignore/4-1.c | 15 +-- .../interfaces/{sighold/3-1.c => sigignore/5-1.c} | 11 +- .../conformance/interfaces/sigignore/5-1.sh | 12 --- .../conformance/interfaces/sigignore/5-2.sh | 12 --- .../conformance/interfaces/sigignore/5-3.sh | 12 --- .../conformance/interfaces/sigignore/5-4.sh | 12 --- .../conformance/interfaces/sigignore/5-core.c | 66 ------------- .../conformance/interfaces/sigignore/6-1.c | 8 +- .../conformance/interfaces/sigignore/6-2.c | 6 +- .../conformance/interfaces/sigismember/3-1.c | 15 +-- .../conformance/interfaces/sigismember/4-1.c | 14 +-- .../{sigaddset/4-1.c => sigismember/5-1.c} | 23 +++-- .../conformance/interfaces/sigismember/5-1.sh | 12 --- .../conformance/interfaces/sigismember/5-2.sh | 12 --- .../conformance/interfaces/sigismember/5-3.sh | 12 --- .../conformance/interfaces/sigismember/5-4.sh | 12 --- .../conformance/interfaces/sigismember/5-core.c | 70 -------------- .../conformance/interfaces/sigrelse/1-1.c | 42 ++++---- .../conformance/interfaces/sigrelse/2-1.c | 18 ++-- .../interfaces/{sighold => sigrelse}/3-1.c | 13 ++- .../conformance/interfaces/sigrelse/3-1.sh | 12 --- .../conformance/interfaces/sigrelse/3-2.sh | 12 --- .../conformance/interfaces/sigrelse/3-3.sh | 12 --- .../conformance/interfaces/sigrelse/3-4.sh | 12 --- .../conformance/interfaces/sigrelse/3-core.c | 101 -------------------- 34 files changed, 94 insertions(+), 653 deletions(-) delete mode 100755 testcases/open_posix_testsuite/conformance/interfaces/sched_yield/3-1.sh delete mode 100644 testcases/open_posix_testsuite/conformance/interfaces/sigdelset/2-1.c copy testcases/open_posix_testsuite/conformance/interfaces/{sigaddset => sigdelset}/4-1.c (69%) delete mode 100755 testcases/open_posix_testsuite/conformance/interfaces/sigdelset/4-1.sh delete mode 100755 testcases/open_posix_testsuite/conformance/interfaces/sigdelset/4-2.sh delete mode 100755 testcases/open_posix_testsuite/conformance/interfaces/sigdelset/4-3.sh delete mode 100755 testcases/open_posix_testsuite/conformance/interfaces/sigdelset/4-4.sh delete mode 100644 testcases/open_posix_testsuite/conformance/interfaces/sigdelset/4-core.c copy testcases/open_posix_testsuite/conformance/interfaces/{sighold/3-1.c => sigignore/5-1.c} (77%) delete mode 100755 testcases/open_posix_testsuite/conformance/interfaces/sigignore/5-1.sh delete mode 100755 testcases/open_posix_testsuite/conformance/interfaces/sigignore/5-2.sh delete mode 100755 testcases/open_posix_testsuite/conformance/interfaces/sigignore/5-3.sh delete mode 100755 testcases/open_posix_testsuite/conformance/interfaces/sigignore/5-4.sh delete mode 100644 testcases/open_posix_testsuite/conformance/interfaces/sigignore/5-core.c copy testcases/open_posix_testsuite/conformance/interfaces/{sigaddset/4-1.c => sigismember/5-1.c} (66%) delete mode 100755 testcases/open_posix_testsuite/conformance/interfaces/sigismember/5-1.sh delete mode 100755 testcases/open_posix_testsuite/conformance/interfaces/sigismember/5-2.sh delete mode 100755 testcases/open_posix_testsuite/conformance/interfaces/sigismember/5-3.sh delete mode 100755 testcases/open_posix_testsuite/conformance/interfaces/sigismember/5-4.sh delete mode 100644 testcases/open_posix_testsuite/conformance/interfaces/sigismember/5-core.c copy testcases/open_posix_testsuite/conformance/interfaces/{sighold => sigrelse}/3-1.c (70%) delete mode 100755 testcases/open_posix_testsuite/conformance/interfaces/sigrelse/3-1.sh delete mode 100755 testcases/open_posix_testsuite/conformance/interfaces/sigrelse/3-2.sh delete mode 100755 testcases/open_posix_testsuite/conformance/interfaces/sigrelse/3-3.sh delete mode 100755 testcases/open_posix_testsuite/conformance/interfaces/sigrelse/3-4.sh delete mode 100644 testcases/open_posix_testsuite/conformance/interfaces/sigrelse/3-core.c diff --git a/testcases/open_posix_testsuite/conformance/interfaces/sched_yield/3-1.sh b/testcases/open_posix_testsuite/conformance/interfaces/sched_yield/3-1.sh deleted file mode 100755 index 112378a..0000000 --- a/testcases/open_posix_testsuite/conformance/interfaces/sched_yield/3-1.sh +++ /dev/null @@ -1,7 +0,0 @@ -#! /bin/sh -# Test that sched_yield() returns -1 on failure. -# -# The function shall always succeed, so nothing can be done for this test. - -echo "Nothing to do for this test, the function shall always succeed." -exit 0 diff --git a/testcases/open_posix_testsuite/conformance/interfaces/sigdelset/2-1.c b/testcases/open_posix_testsuite/conformance/interfaces/sigdelset/2-1.c deleted file mode 100644 index d5f6fd1..0000000 --- a/testcases/open_posix_testsuite/conformance/interfaces/sigdelset/2-1.c +++ /dev/null @@ -1,30 +0,0 @@ -/* - * Copyright (c) 2002, Intel Corporation. All rights reserved. - * Created by: julie.n.fleischer REMOVE-THIS AT intel DOT com - * This file is licensed under the GPL license. For the full content - * of this license, see the COPYING file at the top level of this - * source tree. - - Test that the results are undefined if sigdelset() is called without - first calling sigemptyset() or sigfillset(). - Any results are acceptable; however, the system should not crash, hang, - or do something equally as harmful. - */ -#include <stdio.h> -#include <signal.h> -#include "posixtest.h" - -int main(int argc, char *argv[]) -{ - sigset_t signalset; - - if (sigdelset(&signalset, SIGALRM) == 0) { - printf("sigdelset returned 0\n"); - } else { - printf("sigdelset() did not return 0\n"); - } - /* - * If we made it here, the test case passes. - */ - return PTS_PASS; -} diff --git a/testcases/open_posix_testsuite/conformance/interfaces/sigaddset/4-1.c b/testcases/open_posix_testsuite/conformance/interfaces/sigdelset/4-1.c similarity index 69% copy from testcases/open_posix_testsuite/conformance/interfaces/sigaddset/4-1.c copy to testcases/open_posix_testsuite/conformance/interfaces/sigdelset/4-1.c index e2dc312..9b3c4bf 100644 --- a/testcases/open_posix_testsuite/conformance/interfaces/sigaddset/4-1.c +++ b/testcases/open_posix_testsuite/conformance/interfaces/sigdelset/4-1.c @@ -2,21 +2,23 @@ * Copyright (c) 2002, Intel Corporation. All rights reserved. * Copyright (c) 2013, Cyril Hrubis <ch...@su...> * + * Created by: julie.n.fleischer REMOVE-THIS AT intel DOT com * This file is licensed under the GPL license. For the full content * of this license, see the COPYING file at the top level of this * source tree. - * Testing sending invalid signals to sigaddset(). - * After invalid signal set, sigaddset() should return -1 and set - * errno to indicate the error. + * + * Testing sending invalid signals to sigdelset(). + * After invalid signal sent, sigdelset() should return -1 and set + * errno to indicate the error. * Test steps: - * 1) Initialize an empty signal set. - * 2) Add the invalid signal to the empty signal set. + * 1) Initialize a full signal set. + * 2) Remove the invalid signal from the full signal set. * 3) Verify that -1 is returned, the invalid signal is not a member of * the signal set, and errno is set to indicate the error. */ -#include <errno.h> -#include <signal.h> #include <stdio.h> +#include <signal.h> +#include <errno.h> #include <stdint.h> #include "posixtest.h" @@ -27,17 +29,17 @@ int main(void) sigset_t signalset; int i, ret, err = 0; - if (sigemptyset(&signalset) == -1) { + if (sigfillset(&signalset) == -1) { perror("sigemptyset failed -- test aborted"); return PTS_UNRESOLVED; } for (i = 0; i < sizeof(sigs) / sizeof(int); i++) { - ret = sigaddset(&signalset, sigs[i]); - + ret = sigdelset(&signalset, sigs[i]); + if (ret != -1 || errno != EINVAL) { err++; - printf("Failed sigaddset(..., %i) ret=%i errno=%i\n", + printf("Failed sigdelset(..., %i) ret=%i errno=%i\n", sigs[i], ret, errno); } } diff --git a/testcases/open_posix_testsuite/conformance/interfaces/sigdelset/4-1.sh b/testcases/open_posix_testsuite/conformance/interfaces/sigdelset/4-1.sh deleted file mode 100755 index 2013544..0000000 --- a/testcases/open_posix_testsuite/conformance/interfaces/sigdelset/4-1.sh +++ /dev/null @@ -1,13 +0,0 @@ -#!/bin/sh -# Copyright (c) 2002, Intel Corporation. All rights reserved. -# Created by: julie.n.fleischer REMOVE-THIS AT intel DOT com -# This file is licensed under the GPL license. For the full content -# of this license, see the COPYING file at the top level of this -# source tree. -# - -# -# Test various methods of removing invalid signals to sigaddset(). -# - -./4-core 1 diff --git a/testcases/open_posix_testsuite/conformance/interfaces/sigdelset/4-2.sh b/testcases/open_posix_testsuite/conformance/interfaces/sigdelset/4-2.sh deleted file mode 100755 index d73b908..0000000 --- a/testcases/open_posix_testsuite/conformance/interfaces/sigdelset/4-2.sh +++ /dev/null @@ -1,13 +0,0 @@ -#!/bin/sh -# Copyright (c) 2002, Intel Corporation. All rights reserved. -# Created by: julie.n.fleischer REMOVE-THIS AT intel DOT com -# This file is licensed under the GPL license. For the full content -# of this license, see the COPYING file at the top level of this -# source tree. -# - -# -# Test various methods of removing invalid signals to sigaddset(). -# - -./4-core 2 diff --git a/testcases/open_posix_testsuite/conformance/interfaces/sigdelset/4-3.sh b/testcases/open_posix_testsuite/conformance/interfaces/sigdelset/4-3.sh deleted file mode 100755 index 07ea086..0000000 --- a/testcases/open_posix_testsuite/conformance/interfaces/sigdelset/4-3.sh +++ /dev/null @@ -1,13 +0,0 @@ -#!/bin/sh -# Copyright (c) 2002, Intel Corporation. All rights reserved. -# Created by: julie.n.fleischer REMOVE-THIS AT intel DOT com -# This file is licensed under the GPL license. For the full content -# of this license, see the COPYING file at the top level of this -# source tree. -# - -# -# Test various methods of removing invalid signals to sigaddset(). -# - -./4-core 3 diff --git a/testcases/open_posix_testsuite/conformance/interfaces/sigdelset/4-4.sh b/testcases/open_posix_testsuite/conformance/interfaces/sigdelset/4-4.sh deleted file mode 100755 index e9daf3c..0000000 --- a/testcases/open_posix_testsuite/conformance/interfaces/sigdelset/4-4.sh +++ /dev/null @@ -1,13 +0,0 @@ -#!/bin/sh -# Copyright (c) 2002, Intel Corporation. All rights reserved. -# Created by: julie.n.fleischer REMOVE-THIS AT intel DOT com -# This file is licensed under the GPL license. For the full content -# of this license, see the COPYING file at the top level of this -# source tree. -# - -# -# Test various methods of removing invalid signals to sigaddset(). -# - -./4-core 4 diff --git a/testcases/open_posix_testsuite/conformance/interfaces/sigdelset/4-core.c b/testcases/open_posix_testsuite/conformance/interfaces/sigdelset/4-core.c deleted file mode 100644 index ac894d6..0000000 --- a/testcases/open_posix_testsuite/conformance/interfaces/sigdelset/4-core.c +++ /dev/null @@ -1,78 +0,0 @@ -/* - * Copyright (c) 2002, Intel Corporation. All rights reserved. - * Created by: julie.n.fleischer REMOVE-THIS AT intel DOT com - * This file is licensed under the GPL license. For the full content - * of this license, see the COPYING file at the top level of this - * source tree. - - Testing sending invalid signals to sigdelset(). - After invalid signal sent, sigdelset() should return -1 and set - errno to indicate the error. - Test steps: - 1) Initialize a full signal set. - 2) Remove the invalid signal from the full signal set. - 3) Verify that -1 is returned, the invalid signal is not a member of - the signal set, and errno is set to indicate the error. - */ -#include <stdio.h> -#include <signal.h> -#include <errno.h> -#include <stdint.h> -#include "posixtest.h" - -int main(int argc, char *argv[]) -{ - sigset_t signalset; - int signo; - - if (sigfillset(&signalset) == -1) { - perror("sigemptyset failed -- test aborted"); - return PTS_UNRESOLVED; - } - - if (argc < 2) { - printf("Usage: %s [1|2|3|4]\n", argv[0]); - return PTS_UNRESOLVED; - } - - /* - Various error conditions - */ - switch (argv[1][0]) { - case '1': - signo = -1; - break; - case '2': - signo = -10000; - break; - case '3': - signo = INT32_MIN + 1; - break; - case '4': - signo = INT32_MIN; - break; - default: - printf("Usage: %s [1|2|3|4]\n", argv[0]); - return -1; - } - - if (sigdelset(&signalset, signo) == -1) { - if (EINVAL == errno) { - printf("errno set to EINVAL\n"); - if ((sigismember(&signalset, signo) == 0) || - sigismember(&signalset, signo) == -1) { - printf("signal was not removed\n"); - return PTS_PASS; - } else { - printf("possible error in sigismember\n"); - return PTS_UNRESOLVED; - } - } else { - printf("errno not set to EINVAL\n"); - return PTS_FAIL; - } - } - - printf("sigdelset did not return -1\n"); - return PTS_FAIL; -} diff --git a/testcases/open_posix_testsuite/conformance/interfaces/sigignore/1-1.c b/testcases/open_posix_testsuite/conformance/interfaces/sigignore/1-1.c index 09f9516..29c07fa 100644 --- a/testcases/open_posix_testsuite/conformance/interfaces/sigignore/1-1.c +++ b/testcases/open_posix_testsuite/conformance/interfaces/sigignore/1-1.c @@ -19,14 +19,14 @@ signal is ever raised. #include <stdio.h> #include "posixtest.h" -int handler_called = 0; +static int handler_called = 0; -void handler(int signo) +static void handler(int signo) { handler_called = 1; } -int main() +int main(void) { struct sigaction act; @@ -48,9 +48,9 @@ int main() } if (handler_called) { - printf("FAIL: Signal was not ignored\n"); + printf("FAILED: Signal was not ignored\n"); return PTS_FAIL; } - printf("PASS\n"); + printf("Test PASSED\n"); return PTS_PASS; } diff --git a/testcases/open_posix_testsuite/conformance/interfaces/sigignore/4-1.c b/testcases/open_posix_testsuite/conformance/interfaces/sigignore/4-1.c index 76b5e53..7493667 100644 --- a/testcases/open_posix_testsuite/conformance/interfaces/sigignore/4-1.c +++ b/testcases/open_posix_testsuite/conformance/interfaces/sigignore/4-1.c @@ -4,24 +4,21 @@ * This file is licensed under the GPL license. For the full content * of this license, see the COPYING file at the top level of this * source tree. - - Simply, if sigignore returns a 0 here, test passes. - -*/ - + * + * Simply, if sigignore returns a 0 here, test passes. + */ #define _XOPEN_SOURCE 600 #include <stdio.h> #include <signal.h> #include "posixtest.h" -int main() +int main(void) { - if (sigignore(SIGABRT) != 0) { - perror("sigignore failed -- returned -- test aborted"); + perror("sigignore failed"); return PTS_UNRESOLVED; } - printf("sigignore passed\n"); + printf("Test PASSED\n"); return PTS_PASS; } diff --git a/testcases/open_posix_testsuite/conformance/interfaces/sighold/3-1.c b/testcases/open_posix_testsuite/conformance/interfaces/sigignore/5-1.c similarity index 77% copy from testcases/open_posix_testsuite/conformance/interfaces/sighold/3-1.c copy to testcases/open_posix_testsuite/conformance/interfaces/sigignore/5-1.c index d124411..226942f 100644 --- a/testcases/open_posix_testsuite/conformance/interfaces/sighold/3-1.c +++ b/testcases/open_posix_testsuite/conformance/interfaces/sigignore/5-1.c @@ -7,11 +7,10 @@ * of this license, see the COPYING file at the top level of this * source tree. * - * - * After sighold is called on an invalid signal it should return -1 and set - * errno to EINVAL + * Testing passing an invalid signals to sighold(). + * After sighold is called on an invalid signal, sigignore() should + * return -1 and set errno to EINVAL */ - #define _XOPEN_SOURCE 600 #include <stdio.h> @@ -27,11 +26,11 @@ int main(void) int i, ret, err = 0; for (i = 0; i < sizeof(sigs) / sizeof(int); i++) { - ret = sighold(sigs[i]); + ret = sigignore(sigs[i]); if (ret != -1 || errno != EINVAL) { err++; - printf("Failed sighold(%i) ret=%i errno=%i\n", + printf("Failed sigignore(%i) ret=%i errno=%i\n", sigs[i], ret, errno); } } diff --git a/testcases/open_posix_testsuite/conformance/interfaces/sigignore/5-1.sh b/testcases/open_posix_testsuite/conformance/interfaces/sigignore/5-1.sh deleted file mode 100755 index a9bf498..0000000 --- a/testcases/open_posix_testsuite/conformance/interfaces/sigignore/5-1.sh +++ /dev/null @@ -1,12 +0,0 @@ -#!/bin/sh -# Copyright (c) 2003, Intel Corporation. All rights reserved. -# Created by: salwan.searty REMOVE-THIS AT intel DOT com -# This file is licensed under the GPL license. For the full content -# of this license, see the COPYING file at the top level of this -# source tree. - -# -# Test various methods of passing invalid signals to sigignore(). -# - -./5-core 1 diff --git a/testcases/open_posix_testsuite/conformance/interfaces/sigignore/5-2.sh b/testcases/open_posix_testsuite/conformance/interfaces/sigignore/5-2.sh deleted file mode 100755 index 8fa60dc..0000000 --- a/testcases/open_posix_testsuite/conformance/interfaces/sigignore/5-2.sh +++ /dev/null @@ -1,12 +0,0 @@ -#!/bin/sh -# Copyright (c) 2003, Intel Corporation. All rights reserved. -# Created by: salwan.searty REMOVE-THIS AT intel DOT com -# This file is licensed under the GPL license. For the full content -# of this license, see the COPYING file at the top level of this -# source tree. - -# -# Test various methods of passing invalid signals to sigignore(). -# - -./5-core 2 diff --git a/testcases/open_posix_testsuite/conformance/interfaces/sigignore/5-3.sh b/testcases/open_posix_testsuite/conformance/interfaces/sigignore/5-3.sh deleted file mode 100755 index c5075d2..0000000 --- a/testcases/open_posix_testsuite/conformance/interfaces/sigignore/5-3.sh +++ /dev/null @@ -1,12 +0,0 @@ -#!/bin/sh -# Copyright (c) 2003, Intel Corporation. All rights reserved. -# Created by: salwan.searty REMOVE-THIS AT intel DOT com -# This file is licensed under the GPL license. For the full content -# of this license, see the COPYING file at the top level of this -# source tree. - -# -# Test various methods of passing invalid signals to sigignore(). -# - -./5-core 3 diff --git a/testcases/open_posix_testsuite/conformance/interfaces/sigignore/5-4.sh b/testcases/open_posix_testsuite/conformance/interfaces/sigignore/5-4.sh deleted file mode 100755 index 5eb028e..0000000 --- a/testcases/open_posix_testsuite/conformance/interfaces/sigignore/5-4.sh +++ /dev/null @@ -1,12 +0,0 @@ -#!/bin/sh -# Copyright (c) 2003, Intel Corporation. All rights reserved. -# Created by: salwan.searty REMOVE-THIS AT intel DOT com -# This file is licensed under the GPL license. For the full content -# of this license, see the COPYING file at the top level of this -# source tree. - -# -# Test various methods of passing invalid signals to sigignore(). -# - -./5-core 4 diff --git a/testcases/open_posix_testsuite/conformance/interfaces/sigignore/5-core.c b/testcases/open_posix_testsuite/conformance/interfaces/sigignore/5-core.c deleted file mode 100644 index ff8ec10..0000000 --- a/testcases/open_posix_testsuite/conformance/interfaces/sigignore/5-core.c +++ /dev/null @@ -1,66 +0,0 @@ -/* - * Copyright (c) 2003, Intel Corporation. All rights reserved. - * Created by: salwan.searty REMOVE-THIS AT intel DOT com - * This file is licensed under the GPL license. For the full content - * of this license, see the COPYING file at the top level of this - * source tree. - - Testing passing an invalid signals to sighold(). - After sighold is called on an invalid signal, sigignore() should -return -1 and set errno to EINVAL - - The invalid signal passed to sigignore() depends on the argument -passed to this program. There are currently 4 invalid signals. - */ - -#define _XOPEN_SOURCE 600 - -#include <stdio.h> -#include <signal.h> -#include <errno.h> -#include <stdint.h> -#include "posixtest.h" - -int main(int argc, char *argv[]) -{ - int signo; - - if (argc < 2) { - printf("Usage: %s [1|2|3|4]\n", argv[0]); - return PTS_UNRESOLVED; - } - - /* - Various error conditions - */ - switch (argv[1][0]) { - case '1': - signo = -1; - break; - case '2': - signo = -10000; - break; - case '3': - signo = INT32_MIN + 1; - break; - case '4': - signo = INT32_MIN; - break; - default: - printf("Usage: %s [1|2|3|4]\n", argv[0]); - return PTS_UNRESOLVED; - } - - if (sigignore(signo) == -1) { - if (EINVAL == errno) { - printf("errno set to EINVAL\n"); - return PTS_PASS; - } else { - printf("errno not set to EINVAL\n"); - return PTS_FAIL; - } - } - - printf("sighold did not return -1\n"); - return PTS_FAIL; -} diff --git a/testcases/open_posix_testsuite/conformance/interfaces/sigignore/6-1.c b/testcases/open_posix_testsuite/conformance/interfaces/sigignore/6-1.c index 964c6d7..29e6c9c 100644 --- a/testcases/open_posix_testsuite/conformance/interfaces/sigignore/6-1.c +++ b/testcases/open_posix_testsuite/conformance/interfaces/sigignore/6-1.c @@ -19,14 +19,14 @@ #include <stdint.h> #include "posixtest.h" -int main() +int main(void) { if (sigignore(SIGKILL) == -1) { - if (EINVAL == errno) { - printf("errno set to EINVAL\n"); + if (errno == EINVAL) { + printf("Test PASSED: errno set to EINVAL\n"); return PTS_PASS; } else { - printf("errno not set to EINVAL\n"); + printf("errno was not set to EINVAL\n"); return PTS_FAIL; } } diff --git a/testcases/open_posix_testsuite/conformance/interfaces/sigignore/6-2.c b/testcases/open_posix_testsuite/conformance/interfaces/sigignore/6-2.c index ef1d0f2..f8b560f 100644 --- a/testcases/open_posix_testsuite/conformance/interfaces/sigignore/6-2.c +++ b/testcases/open_posix_testsuite/conformance/interfaces/sigignore/6-2.c @@ -19,14 +19,14 @@ #include <stdint.h> #include "posixtest.h" -int main() +int main(void) { if (sigignore(SIGSTOP) == -1) { if (EINVAL == errno) { - printf("errno set to EINVAL\n"); + printf("Test PASSED: errno set to EINVAL\n"); return PTS_PASS; } else { - printf("errno not set to EINVAL\n"); + printf("errno was not set to EINVAL\n"); return PTS_FAIL; } } diff --git a/testcases/open_posix_testsuite/conformance/interfaces/sigismember/3-1.c b/testcases/open_posix_testsuite/conformance/interfaces/sigismember/3-1.c index adbe6bd..15eb268 100644 --- a/testcases/open_posix_testsuite/conformance/interfaces/sigismember/3-1.c +++ b/testcases/open_posix_testsuite/conformance/interfaces/sigismember/3-1.c @@ -4,18 +4,16 @@ * This file is licensed under the GPL license. For the full content * of this license, see the COPYING file at the top level of this * source tree. - + * * Tests assertion 3 by filling a signal set and arbitrarily querying * it for a SIGABRT function. Sigmember should return a 1. -*/ - + */ #include <stdio.h> #include <signal.h> #include "posixtest.h" -int main() +int main(void) { - sigset_t signalset; if (sigfillset(&signalset) == -1) { @@ -24,13 +22,10 @@ int main() } if (sigismember(&signalset, SIGABRT) != 1) { -#ifdef DEBUG - printf - ("sigismember didn't returned a 1 even though sigfillset was just called\n"); -#endif + printf("sigismember doesn't confirm the signal was set\n"); return PTS_FAIL; } - printf("sigismember passed\n"); + printf("Test PASSED\n"); return PTS_PASS; } diff --git a/testcases/open_posix_testsuite/conformance/interfaces/sigismember/4-1.c b/testcases/open_posix_testsuite/conformance/interfaces/sigismember/4-1.c index 8d76062..5dfad8d 100644 --- a/testcases/open_posix_testsuite/conformance/interfaces/sigismember/4-1.c +++ b/testcases/open_posix_testsuite/conformance/interfaces/sigismember/4-1.c @@ -4,19 +4,18 @@ * This file is licensed under the GPL license. For the full content * of this license, see the COPYING file at the top level of this * source tree. - + * * Tests assertion 4 by emptying a signal set and querying it for * a SIGABRT function. Sigmember should return a 0 indicating that * the signal is not a member of the set. -*/ + */ #include <stdio.h> #include <signal.h> #include "posixtest.h" -int main() +int main(void) { - sigset_t signalset; if (sigemptyset(&signalset) == -1) { @@ -25,13 +24,10 @@ int main() } if (sigismember(&signalset, SIGABRT) != 0) { -#ifdef DEBUG - printf - ("sigismember did not return a 0 even though sigemptyset was just called\n"); -#endif + printf("sigismember dit not return 0"); return PTS_FAIL; } - printf("sigismember passed\n"); + printf("Test PASSED\n"); return PTS_PASS; } diff --git a/testcases/open_posix_testsuite/conformance/interfaces/sigaddset/4-1.c b/testcases/open_posix_testsuite/conformance/interfaces/sigismember/5-1.c similarity index 66% copy from testcases/open_posix_testsuite/conformance/interfaces/sigaddset/4-1.c copy to testcases/open_posix_testsuite/conformance/interfaces/sigismember/5-1.c index e2dc312..2fda6a9 100644 --- a/testcases/open_posix_testsuite/conformance/interfaces/sigaddset/4-1.c +++ b/testcases/open_posix_testsuite/conformance/interfaces/sigismember/5-1.c @@ -2,21 +2,22 @@ * Copyright (c) 2002, Intel Corporation. All rights reserved. * Copyright (c) 2013, Cyril Hrubis <ch...@su...> * + * Created by: salwan.searty REMOVE-THIS AT intel DOT com * This file is licensed under the GPL license. For the full content * of this license, see the COPYING file at the top level of this * source tree. - * Testing sending invalid signals to sigaddset(). - * After invalid signal set, sigaddset() should return -1 and set - * errno to indicate the error. + * + * Testing invalid signals with sigismember(). + * After invalid signal set sigismember() should return -1 and set + * errno to indicate the error. * Test steps: - * 1) Initialize an empty signal set. - * 2) Add the invalid signal to the empty signal set. - * 3) Verify that -1 is returned, the invalid signal is not a member of - * the signal set, and errno is set to indicate the error. + * 1) Initialize a full signal set. + * 2) Check for invalid signal from the full signal set. + * 3) Verify that -1 is returned and errno is set to indicate the error. */ -#include <errno.h> -#include <signal.h> #include <stdio.h> +#include <signal.h> +#include <errno.h> #include <stdint.h> #include "posixtest.h" @@ -27,13 +28,13 @@ int main(void) sigset_t signalset; int i, ret, err = 0; - if (sigemptyset(&signalset) == -1) { + if (sigfillset(&signalset) == -1) { perror("sigemptyset failed -- test aborted"); return PTS_UNRESOLVED; } for (i = 0; i < sizeof(sigs) / sizeof(int); i++) { - ret = sigaddset(&signalset, sigs[i]); + ret = sigismember(&signalset, sigs[i]); if (ret != -1 || errno != EINVAL) { err++; diff --git a/testcases/open_posix_testsuite/conformance/interfaces/sigismember/5-1.sh b/testcases/open_posix_testsuite/conformance/interfaces/sigismember/5-1.sh deleted file mode 100755 index 420182c..0000000 --- a/testcases/open_posix_testsuite/conformance/interfaces/sigismember/5-1.sh +++ /dev/null @@ -1,12 +0,0 @@ -#!/bin/sh -# Copyright (c) 2002, Intel Corporation. All rights reserved. -# Created by: salwan.searty REMOVE-THIS AT intel DOT com -# This file is licensed under the GPL license. For the full content -# of this license, see the COPYING file at the top level of this -# source tree. -# -# -# Test various methods of checking for invalid signals using sigismember(). -# - -./5-core 1 diff --git a/testcases/open_posix_testsuite/conformance/interfaces/sigismember/5-2.sh b/testcases/open_posix_testsuite/conformance/interfaces/sigismember/5-2.sh deleted file mode 100755 index f34514f..0000000 --- a/testcases/open_posix_testsuite/conformance/interfaces/sigismember/5-2.sh +++ /dev/null @@ -1,12 +0,0 @@ -#!/bin/sh -# Copyright (c) 2002, Intel Corporation. All rights reserved. -# Created by: salwan.searty REMOVE-THIS AT intel DOT com -# This file is licensed under the GPL license. For the full content -# of this license, see the COPYING file at the top level of this -# source tree. -# -# -# Test various methods of checking for invalid signals using sigismember(). -# - -./5-core 2 diff --git a/testcases/open_posix_testsuite/conformance/interfaces/sigismember/5-3.sh b/testcases/open_posix_testsuite/conformance/interfaces/sigismember/5-3.sh deleted file mode 100755 index 5529c20..0000000 --- a/testcases/open_posix_testsuite/conformance/interfaces/sigismember/5-3.sh +++ /dev/null @@ -1,12 +0,0 @@ -#!/bin/sh -# Copyright (c) 2002, Intel Corporation. All rights reserved. -# Created by: salwan.searty REMOVE-THIS AT intel DOT com -# This file is licensed under the GPL license. For the full content -# of this license, see the COPYING file at the top level of this -# source tree. -# -# -# Test various methods of checking for invalid signals using sigismember(). -# - -./5-core 3 diff --git a/testcases/open_posix_testsuite/conformance/interfaces/sigismember/5-4.sh b/testcases/open_posix_testsuite/conformance/interfaces/sigismember/5-4.sh deleted file mode 100755 index ab5ba0b..0000000 --- a/testcases/open_posix_testsuite/conformance/interfaces/sigismember/5-4.sh +++ /dev/null @@ -1,12 +0,0 @@ -#!/bin/sh -# Copyright (c) 2002, Intel Corporation. All rights reserved. -# Created by: salwan.searty REMOVE-THIS AT intel DOT com -# This file is licensed under the GPL license. For the full content -# of this license, see the COPYING file at the top level of this -# source tree. -# -# -# Test various methods of checking for invalid signals using sigismember(). -# - -./5-core 4 diff --git a/testcases/open_posix_testsuite/conformance/interfaces/sigismember/5-core.c b/testcases/open_posix_testsuite/conformance/interfaces/sigismember/5-core.c deleted file mode 100644 index 0a0ac87..0000000 --- a/testcases/open_posix_testsuite/conformance/interfaces/sigismember/5-core.c +++ /dev/null @@ -1,70 +0,0 @@ -/* - * Copyright (c) 2002, Intel Corporation. All rights reserved. - * Created by: salwan.searty REMOVE-THIS AT intel DOT com - * This file is licensed under the GPL license. For the full content - * of this license, see the COPYING file at the top level of this - * source tree. - * - - Testing sending invalid signals to sigdelset(). - After invalid signal sent, sigdelset() should return -1 and set - errno to indicate the error. - Test steps: - 1) Initialize a full signal set. - 2) Remove the invalid signal from the full signal set. - 3) Verify that -1 is returned, the invalid signal is not a member of - the signal set, and errno is set to indicate the error. - */ -#include <stdio.h> -#include <signal.h> -#include <errno.h> -#include <stdint.h> -#include <posixtest.h> - -int main(int argc, char *argv[]) -{ - sigset_t signalset; - int signo; - - if (sigfillset(&signalset) == -1) { - perror("sigemptyset failed -- test aborted"); - return PTS_UNRESOLVED; - } - - if (argc < 2) { - printf("Usage: %s [1|2|3|4]\n", argv[0]); - return PTS_UNRESOLVED; - } - - /* - Various error conditions - */ - switch (argv[1][0]) { - case '1': - signo = -1; - break; - case '2': - signo = -10000; - break; - case '3': - signo = INT32_MIN + 1; - break; - case '4': - signo = INT32_MIN; - break; - default: - printf("Usage: %s [1|2|3|4]\n", argv[0]); - return PTS_UNRESOLVED; - } - - if (sigismember(&signalset, signo) != -1) { - printf("sigismember did not return -1\n"); - return PTS_FAIL; - } else if (EINVAL != errno) { - printf("errno was not set to EINVAL\n"); - return PTS_FAIL; - } - - printf("errno set to EINVAL and sigismember returned -1\n"); - return PTS_PASS; -} diff --git a/testcases/open_posix_testsuite/conformance/interfaces/sigrelse/1-1.c b/testcases/open_posix_testsuite/conformance/interfaces/sigrelse/1-1.c index cf319d6..1b3a2de 100644 --- a/testcases/open_posix_testsuite/conformance/interfaces/sigrelse/1-1.c +++ b/testcases/open_posix_testsuite/conformance/interfaces/sigrelse/1-1.c @@ -1,21 +1,21 @@ /* * Copyright (c) 2003, Intel Corporation. All rights reserved. + * Copyright (c) 2013, Cyril Hrubis <ch...@su...> + * * Created by: salwan.searty REMOVE-THIS AT intel DOT com * This file is licensed under the GPL license. For the full content * of this license, see the COPYING file at the top level of this * source tree. - - Steps: - 1. Set up a handler for signal SIGABRT, such that it is called if -signal is ever raised. - 2. Call sighold on that SIGABRT. - 3. Raise a SIGABRT and verify that the signal handler was not called. -Otherwise, the test exits with unresolved results. - 4. Call sigrelse on SIGABRT. - 5. Verify that the handler gets called this time. - -*/ - + * + * Steps: + * 1. Set up a handler for signal SIGABRT, such that it is called if + * signal is ever raised. + * 2. Call sighold on that SIGABRT. + * 3. Raise a SIGABRT and verify that the signal handler was not called. + * Otherwise, the test exits with unresolved results. + * 4. Call sigrelse on SIGABRT. + * 5. Verify that the handler gets called this time. + */ #define _XOPEN_SOURCE 600 #include <signal.h> @@ -23,14 +23,14 @@ Otherwise, the test exits with unresolved results. #include <unistd.h> #include "posixtest.h" -int handler_called = 0; +static int handler_called; -void handler(int signo) +static void handler(int signo) { handler_called = 1; } -int main() +int main(void) { struct sigaction act; @@ -38,16 +38,14 @@ int main() act.sa_flags = 0; sigemptyset(&act.sa_mask); if (sigaction(SIGABRT, &act, 0) == -1) { - perror("Unexpected error while attempting to setup test " - "pre-conditions"); + perror("Failed to set signal handler."); return PTS_UNRESOLVED; } sighold(SIGABRT); if (raise(SIGABRT) == -1) { - perror("Unexpected error while attempting to setup test " - "pre-conditions"); + perror("Failed to raise SIGABRT."); return PTS_UNRESOLVED; } @@ -61,12 +59,12 @@ int main() return PTS_UNRESOLVED; } - sleep(1); + usleep(100000); if (handler_called) { - printf("PASS: SIGABRT successfully removed from signal mask\n"); + printf("Test PASSED: SIGABRT removed from signal mask\n"); return PTS_PASS; } - printf("FAIL\n"); + printf("Test FAILED\n"); return PTS_FAIL; } diff --git a/testcases/open_posix_testsuite/conformance/interfaces/sigrelse/2-1.c b/testcases/open_posix_testsuite/conformance/interfaces/sigrelse/2-1.c index 189a6d5..1694e3e 100644 --- a/testcases/open_posix_testsuite/conformance/interfaces/sigrelse/2-1.c +++ b/testcases/open_posix_testsuite/conformance/interfaces/sigrelse/2-1.c @@ -4,24 +4,22 @@ * This file is licensed under the GPL license. For the full content * of this license, see the COPYING file at the top level of this * source tree. - - Simply, if sigrelse returns a 0 here, test passes. - -*/ - + * + * Simply, if sigrelse returns a 0 here, test passes. + * + */ #define _XOPEN_SOURCE 600 #include <stdio.h> #include <signal.h> #include "posixtest.h" -int main() +int main(void) { - - if ((int)sigrelse(SIGABRT) != 0) { - perror("sigrelse failed -- returned -- test aborted"); + if (sigrelse(SIGABRT) != 0) { + perror("Sigrelse failed"); return PTS_UNRESOLVED; } - printf("sigrelse passed\n"); + printf("Test PASSED\n"); return PTS_PASS; } diff --git a/testcases/open_posix_testsuite/conformance/interfaces/sighold/3-1.c b/testcases/open_posix_testsuite/conformance/interfaces/sigrelse/3-1.c similarity index 70% copy from testcases/open_posix_testsuite/conformance/interfaces/sighold/3-1.c copy to testcases/open_posix_testsuite/conformance/interfaces/sigrelse/3-1.c index d124411..4db3a49 100644 --- a/testcases/open_posix_testsuite/conformance/interfaces/sighold/3-1.c +++ b/testcases/open_posix_testsuite/conformance/interfaces/sigrelse/3-1.c @@ -7,17 +7,20 @@ * of this license, see the COPYING file at the top level of this * source tree. * + * Testing passing an invalid signals to sigrelse(). + * After sighold is called on an invalid signal, sigrelse() should + * return -1 and set errno to EINVAL * - * After sighold is called on an invalid signal it should return -1 and set - * errno to EINVAL + * The invalid signal passed to sigrelse() depends on the argument + * passed to this program. */ - #define _XOPEN_SOURCE 600 #include <stdio.h> #include <signal.h> #include <errno.h> #include <stdint.h> +#include <setjmp.h> #include "posixtest.h" static const int sigs[] = {-1, -10000, INT32_MIN, INT32_MIN + 1}; @@ -27,11 +30,11 @@ int main(void) int i, ret, err = 0; for (i = 0; i < sizeof(sigs) / sizeof(int); i++) { - ret = sighold(sigs[i]); + ret = sigrelse(sigs[i]); if (ret != -1 || errno != EINVAL) { err++; - printf("Failed sighold(%i) ret=%i errno=%i\n", + printf("Failed sigrelse(%i) ret=%i errno=%i\n", sigs[i], ret, errno); } } diff --git a/testcases/open_posix_testsuite/conformance/interfaces/sigrelse/3-1.sh b/testcases/open_posix_testsuite/conformance/interfaces/sigrelse/3-1.sh deleted file mode 100755 index 20bfbd3..0000000 --- a/testcases/open_posix_testsuite/conformance/interfaces/sigrelse/3-1.sh +++ /dev/null @@ -1,12 +0,0 @@ -#!/bin/sh -# Copyright (c) 2003, Intel Corporation. All rights reserved. -# Created by: salwan.searty REMOVE-THIS AT intel DOT com -# This file is licensed under the GPL license. For the full content -# of this license, see the COPYING file at the top level of this -# source tree. - -# -# Test various methods of adding invalid signals to sigrelse(). -# - -./3-core 1 diff --git a/testcases/open_posix_testsuite/conformance/interfaces/sigrelse/3-2.sh b/testcases/open_posix_testsuite/conformance/interfaces/sigrelse/3-2.sh deleted file mode 100755 index bf1dcfc..0000000 --- a/testcases/open_posix_testsuite/conformance/interfaces/sigrelse/3-2.sh +++ /dev/null @@ -1,12 +0,0 @@ -#!/bin/sh -# Copyright (c) 2003, Intel Corporation. All rights reserved. -# Created by: salwan.searty REMOVE-THIS AT intel DOT com -# This file is licensed under the GPL license. For the full content -# of this license, see the COPYING file at the top level of this -# source tree. - -# -# Test various methods of adding invalid signals to sigrelse(). -# - -./3-core 2 diff --git a/testcases/open_posix_testsuite/conformance/interfaces/sigrelse/3-3.sh b/testcases/open_posix_testsuite/conformance/interfaces/sigrelse/3-3.sh deleted file mode 100755 index 8b8cf46..0000000 --- a/testcases/open_posix_testsuite/conformance/interfaces/sigrelse/3-3.sh +++ /dev/null @@ -1,12 +0,0 @@ -#!/bin/sh -# Copyright (c) 2003, Intel Corporation. All rights reserved. -# Created by: salwan.searty REMOVE-THIS AT intel DOT com -# This file is licensed under the GPL license. For the full content -# of this license, see the COPYING file at the top level of this -# source tree. - -# -# Test various methods of adding invalid signals to sigrelse(). -# - -./3-core 3 diff --git a/testcases/open_posix_testsuite/conformance/interfaces/sigrelse/3-4.sh b/testcases/open_posix_testsuite/conformance/interfaces/sigrelse/3-4.sh deleted file mode 100755 index 9edafb7..0000000 --- a/testcases/open_posix_testsuite/conformance/interfaces/sigrelse/3-4.sh +++ /dev/null @@ -1,12 +0,0 @@ -#!/bin/sh -# Copyright (c) 2003, Intel Corporation. All rights reserved. -# Created by: salwan.searty REMOVE-THIS AT intel DOT com -# This file is licensed under the GPL license. For the full content -# of this license, see the COPYING file at the top level of this -# source tree. - -# -# Test various methods of adding invalid signals to sigrelse(). -# - -./3-core 4 diff --git a/testcases/open_posix_testsuite/conformance/interfaces/sigrelse/3-core.c b/testcases/open_posix_testsuite/conformance/interfaces/sigrelse/3-core.c deleted file mode 100644 index eb1f8ef..0000000 --- a/testcases/open_posix_testsuite/conformance/interfaces/sigrelse/3-core.c +++ /dev/null @@ -1,101 +0,0 @@ -/* - * Copyright (c) 2003, Intel Corporation. All rights reserved. - * Created by: salwan.searty REMOVE-THIS AT intel DOT com - * This file is licensed under the GPL license. For the full content - * of this license, see the COPYING file at the top level of this - * source tree. - - Testing passing an invalid signals to sigrelse(). - After sighold is called on an invalid signal, sigrelse() should -return -1 and set errno to EINVAL - - The invalid signal passed to sigrelse() depends on the argument -passed to this program. - There are currently 4 invalid signals. - */ - -#define _XOPEN_SOURCE 600 - -#include <stdio.h> -#include <signal.h> -#include <errno.h> -#include <stdint.h> -#include <setjmp.h> -#include "posixtest.h" - -jmp_buf sig11_recover; -void sig11_handler(int sig); - -int main(int argc, char *argv[]) -{ - int signo, TEST_RETURN; - struct sigaction sa, osa; - - if (argc < 2) { - printf("Usage: %s [1|2|3|4]\n", argv[0]); - return PTS_UNRESOLVED; - } - - /* - Various error conditions - */ - switch (argv[1][0]) { - case '1': - signo = -1; - break; - case '2': - signo = -10000; - break; - case '3': - signo = INT32_MIN + 1; - break; - case '4': - signo = INT32_MIN; - break; - default: - printf("Usage: %s [1|2|3|4]\n", argv[0]); - return PTS_UNRESOLVED; - } - - /* special sig11 case */ - sa.sa_handler = &sig11_handler; - sigemptyset(&sa.sa_mask); - sa.sa_flags = 0; - - sigaction(SIGSEGV, NULL, &osa); - sigaction(SIGSEGV, &sa, NULL); - - if (setjmp(sig11_recover)) { - errno = EINVAL; - TEST_RETURN = -2; - } else { - TEST_RETURN = sigrelse(signo); - } - sigaction(SIGSEGV, &osa, NULL); - - if (TEST_RETURN == -1) { - if (EINVAL == errno) { - printf("errno set to EINVAL\n"); - return PTS_PASS; - } else { - printf("errno not set to EINVAL\n"); - return PTS_FAIL; - } - } - if (TEST_RETURN == -2) { - printf("test received SIGSEGV\n"); - return PTS_UNRESOLVED; - } - - printf("sigrelse did not return -1\n"); - return PTS_FAIL; - -} - -/****************************************************************** - * sig11_handler() - our segfault recover hack - ******************************************************************/ -void sig11_handler(int sig) -{ - longjmp(sig11_recover, 1); -} hooks/post-receive -- ltp |
From: Mike F. <su...@li...> - 2013-03-11 19:34:17
|
The branch, master, has been updated via 7f825dd95f3b6a1d1c3acd9762921a1ea1cb5055 (commit) from 0524aeacad297e6212c45b4eb3dd485eb1f4a613 (commit) - Log ----------------------------------------------------------------- commit 7f825dd95f3b6a1d1c3acd9762921a1ea1cb5055 Author: Mike Frysinger <va...@ge...> Date: Mon Mar 11 15:36:25 2013 -0400 getcwd: use (void) everywhere Signed-off-by: Mike Frysinger <va...@ge...> ----------------------------------------------------------------------- Summary of changes: testcases/kernel/syscalls/getcwd/getcwd01.c | 8 ++---- testcases/kernel/syscalls/getcwd/getcwd02.c | 34 ++++++++++++-------------- testcases/kernel/syscalls/getcwd/getcwd03.c | 10 +++---- 3 files changed, 23 insertions(+), 29 deletions(-) diff --git a/testcases/kernel/syscalls/getcwd/getcwd01.c b/testcases/kernel/syscalls/getcwd/getcwd01.c index ab173c7..cb2b3f6 100644 --- a/testcases/kernel/syscalls/getcwd/getcwd01.c +++ b/testcases/kernel/syscalls/getcwd/getcwd01.c @@ -141,14 +141,13 @@ int main(int ac, char **av) tst_exit(); } -void setup_test4() +void setup_test4(void) { chdir("/"); } -void setup() +void setup(void) { - tst_sig(NOFORK, DEF_HANDLER, cleanup); TEST_PAUSE; @@ -157,7 +156,7 @@ void setup() tst_tmpdir(); } -void cleanup() +void cleanup(void) { /* remove the test directory */ tst_rmdir(); @@ -167,5 +166,4 @@ void cleanup() * print errno log if that option was specified. */ TEST_CLEANUP; - } diff --git a/testcases/kernel/syscalls/getcwd/getcwd02.c b/testcases/kernel/syscalls/getcwd/getcwd02.c index b68c05e..335ae9d 100644 --- a/testcases/kernel/syscalls/getcwd/getcwd02.c +++ b/testcases/kernel/syscalls/getcwd/getcwd02.c @@ -70,13 +70,13 @@ int TST_TOTAL = 7; void cleanup(void); void setup(void); -void do_block1(); -void do_block2(); -void do_block3(); -void do_block4(); -void do_block5(); -void do_block6(); -void do_block7(); +void do_block1(void); +void do_block2(void); +void do_block3(void); +void do_block4(void); +void do_block5(void); +void do_block6(void); +void do_block7(void); char pwd_buf[BUFSIZ]; //holds results of pwd pipe char cwd[BUFSIZ]; //used as our valid buffer @@ -126,7 +126,7 @@ int main(int ac, char **av) tst_exit(); } -void do_block1() //valid cwd[]: -> Should work fine +void do_block1(void) //valid cwd[]: -> Should work fine { int flag = 0; tst_resm(TINFO, "Enter Block 1"); @@ -149,7 +149,7 @@ void do_block1() //valid cwd[]: -> Should work fine } } -void do_block2() //valid cwd[], size = 0: -> Should return NULL, errno = EINVAL +void do_block2(void) //valid cwd[], size = 0: -> Should return NULL, errno = EINVAL { int flag = 0; tst_resm(TINFO, "Enter Block 2"); @@ -168,7 +168,7 @@ void do_block2() //valid cwd[], size = 0: -> Should return NULL, errno = EINVAL } } -void do_block3() //valid cwd[], size = 1 -> Should return NULL, errno = ERANGE +void do_block3(void) //valid cwd[], size = 1 -> Should return NULL, errno = ERANGE { int flag = 0; tst_resm(TINFO, "Enter Block 3"); @@ -187,7 +187,7 @@ void do_block3() //valid cwd[], size = 1 -> Should return NULL, errno = ERANGE } } -void do_block4() //invalid cwd[] = -1, size = BUFSIZ: -> return NULL, errno = FAULT +void do_block4(void) //invalid cwd[] = -1, size = BUFSIZ: -> return NULL, errno = FAULT { /* Skip since uClinux does not implement memory protection */ #ifndef UCLINUX @@ -211,7 +211,7 @@ void do_block4() //invalid cwd[] = -1, size = BUFSIZ: -> return NULL, errno = F #endif } -void do_block5() //buffer = NULL, and size = 0, should succeed +void do_block5(void) //buffer = NULL, and size = 0, should succeed { int flag = 0; tst_resm(TINFO, "Enter Block 5"); @@ -236,7 +236,7 @@ void do_block5() //buffer = NULL, and size = 0, should succeed buffer = NULL; } -void do_block6() //buffer = NULL, size = 1: -> return NULL, errno = ERANGE +void do_block6(void) //buffer = NULL, size = 1: -> return NULL, errno = ERANGE { int flag = 0; tst_resm(TINFO, "Enter Block 6"); @@ -255,7 +255,7 @@ void do_block6() //buffer = NULL, size = 1: -> return NULL, errno = ERANGE } } -void do_block7() //buffer = NULL, size = BUFSIZ: -> work fine, allocate buffer +void do_block7(void) //buffer = NULL, size = BUFSIZ: -> work fine, allocate buffer { int flag = 0; tst_resm(TINFO, "Enter Block 7"); @@ -280,9 +280,8 @@ void do_block7() //buffer = NULL, size = BUFSIZ: -> work fine, allocate buffer buffer = NULL; } -void setup() +void setup(void) { - /* FORK is set here because of the popen() call above */ tst_sig(FORK, DEF_HANDLER, cleanup); @@ -292,9 +291,8 @@ void setup() tst_tmpdir(); } -void cleanup() +void cleanup(void) { /* remove the test directory */ tst_rmdir(); - } diff --git a/testcases/kernel/syscalls/getcwd/getcwd03.c b/testcases/kernel/syscalls/getcwd/getcwd03.c index 34d5e8b..eecbd17 100644 --- a/testcases/kernel/syscalls/getcwd/getcwd03.c +++ b/testcases/kernel/syscalls/getcwd/getcwd03.c @@ -69,7 +69,7 @@ int TST_TOTAL = 1; void cleanup(void); void setup(void); -char *getpwd(); +char *getpwd(void); int main(int ac, char **av) { @@ -203,9 +203,8 @@ int main(int ac, char **av) tst_exit(); } -void setup() +void setup(void) { - /* FORK is set here because of the popen() call below */ tst_sig(FORK, DEF_HANDLER, cleanup); @@ -215,17 +214,16 @@ void setup() tst_tmpdir(); } -void cleanup() +void cleanup(void) { /* remove the test directory */ tst_rmdir(); /* print timing stats if that option was specified */ TEST_CLEANUP; - } -char *getpwd() +char *getpwd(void) { FILE *fin; char *pwd = "/bin/pwd"; hooks/post-receive -- ltp |
From: Cyril H. <su...@li...> - 2013-03-11 18:21:43
|
The branch, master, has been updated via 0524aeacad297e6212c45b4eb3dd485eb1f4a613 (commit) via 7169c348c035cb454752d67036a7ad0ce5f9cdff (commit) via c564a963820ce6dd1a7da48fe3d9df0b5795cf53 (commit) via e23ac119aa0bb9517630e798efc7e3f8eb8a9216 (commit) via 0183d60059bfefcadb74f251e4829e8901510371 (commit) via e40d6bae0ade4626bdd83719f5237617add55437 (commit) via 44fce9911ce6cd1c973c0e83cf787d0e2daabe95 (commit) via 35def81efdfa9e4e05407968aaad1fb8605e7d9c (commit) via 6bdf92d2bc80c3a55fb63cb3d720dfc7782de602 (commit) from 31dffcf9420430f6a5042b74d4beb72317523f18 (commit) - Log ----------------------------------------------------------------- commit 0524aeacad297e6212c45b4eb3dd485eb1f4a613 Author: DAN LI <li...@cn...> Date: Fri Mar 8 10:39:56 2013 +0800 pthread_once/1-1.c : cleanup & error checks Fix the prototype and remove the (void *) casts. Add error checks to: Make sure this case not slip into one situation that the first pthread_once fails, and the second successes, then the case passes with bypassing its assertion. Give more detailed and exact execute result. Signed-off-by: DAN LI <li...@cn...> Signed-off-by: Cyril Hrubis <ch...@su...> commit 7169c348c035cb454752d67036a7ad0ce5f9cdff Author: Cyril Hrubis <ch...@su...> Date: Mon Mar 11 16:38:52 2013 +0100 openposix/.../sigdelset/1-*: Cleanup. Split 1-core.c into 1-1.c and 1-2.c. Remove 1-1.sh and 1-2.sh. Signed-off-by: Cyril Hrubis <ch...@su...> commit c564a963820ce6dd1a7da48fe3d9df0b5795cf53 Author: Cyril Hrubis <ch...@su...> Date: Mon Mar 11 16:26:44 2013 +0100 openposix/.../sigaddset: Cleanup. Make use of PTS_ return values, unify output, etc. Signed-off-by: Cyril Hrubis <ch...@su...> commit e23ac119aa0bb9517630e798efc7e3f8eb8a9216 Author: Cyril Hrubis <ch...@su...> Date: Mon Mar 11 16:14:29 2013 +0100 openposix/.../sigaddset/4-*: Cleanup. Merge 4-* into 4-1.c Signed-off-by: Cyril Hrubis <ch...@su...> commit 0183d60059bfefcadb74f251e4829e8901510371 Author: Cyril Hrubis <ch...@su...> Date: Mon Mar 11 14:27:05 2013 +0100 openposix/.../sigaddset: Cleanup. Split 1-core.c into 1-1.c and 1-2.c. Remove 1-1.sh and 1-2.sh. Signed-off-by: Cyril Hrubis <ch...@su...> commit e40d6bae0ade4626bdd83719f5237617add55437 Author: Cyril Hrubis <ch...@su...> Date: Mon Mar 11 14:16:26 2013 +0100 openposix/.../sigprocmask: Cleanup. Small cleanup & unify Test PASSED messages. Signed-off-by: Cyril Hrubis <ch...@su...> commit 44fce9911ce6cd1c973c0e83cf787d0e2daabe95 Author: Cyril Hrubis <ch...@su...> Date: Mon Mar 11 13:51:09 2013 +0100 openposix/.../sigprocmask/17-*: Rewrite. Rewrite the 17-* tests, they should test for invalid how not invalid signals. Signed-off-by: Cyril Hrubis <ch...@su...> commit 35def81efdfa9e4e05407968aaad1fb8605e7d9c Author: Cyril Hrubis <ch...@su...> Date: Mon Mar 11 13:13:27 2013 +0100 openposix/.../sighold: Small cleanup. Remove useless casts from 1-1.c and 2-1.c. Also reduce the sleep to 0.1 second. Signed-off-by: Cyril Hrubis <ch...@su...> commit 6bdf92d2bc80c3a55fb63cb3d720dfc7782de602 Author: Cyril Hrubis <ch...@su...> Date: Thu Mar 7 18:00:10 2013 +0100 openposix/.../sighold/3-x: Fixes. * Remove the SIGSEGV hack. If call to sighold causes crash the test would be marked as failed anyway. There is no need to overcomplicate the test with longjump from signal handler. * Merge the 3-x testcases Again there is no need for the overcomplicated structure. Make the test just loop over invalid signal numbers. Instead of the shell helpers running the binary with different parameters. Signed-off-by: Cyril Hrubis <ch...@su...> ----------------------------------------------------------------------- Summary of changes: .../conformance/interfaces/pthread_once/1-1.c | 19 +++- .../conformance/interfaces/sigaddset/1-1.c | 40 ++++++++ .../conformance/interfaces/sigaddset/1-1.sh | 20 ---- .../conformance/interfaces/sigaddset/1-2.c | 40 ++++++++ .../conformance/interfaces/sigaddset/1-2.sh | 18 ---- .../conformance/interfaces/sigaddset/1-3.c | 83 +++++++---------- .../conformance/interfaces/sigaddset/1-core.c | 54 ----------- .../conformance/interfaces/sigaddset/2-1.c | 4 +- .../conformance/interfaces/sigaddset/4-1.c | 52 ++++++++++ .../conformance/interfaces/sigaddset/4-1.sh | 12 --- .../conformance/interfaces/sigaddset/4-2.sh | 13 --- .../conformance/interfaces/sigaddset/4-3.sh | 12 --- .../conformance/interfaces/sigaddset/4-4.sh | 12 --- .../conformance/interfaces/sigaddset/4-core.c | 77 --------------- .../conformance/interfaces/sigdelset/1-1.c | 53 +++++++++++ .../conformance/interfaces/sigdelset/1-1.sh | 16 --- .../conformance/interfaces/sigdelset/1-2.c | 53 +++++++++++ .../conformance/interfaces/sigdelset/1-2.sh | 16 --- .../conformance/interfaces/sigdelset/1-core.c | 67 ------------- .../conformance/interfaces/sighold/1-1.c | 9 +- .../conformance/interfaces/sighold/2-1.c | 6 +- .../conformance/interfaces/sighold/3-1.c | 46 +++++++++ .../conformance/interfaces/sighold/3-1.sh | 12 --- .../conformance/interfaces/sighold/3-2.sh | 13 --- .../conformance/interfaces/sighold/3-3.sh | 12 --- .../conformance/interfaces/sighold/3-4.sh | 12 --- .../conformance/interfaces/sighold/3-core.c | 99 -------------------- .../conformance/interfaces/sigprocmask/10-1.c | 3 +- .../conformance/interfaces/sigprocmask/12-1.c | 6 +- .../conformance/interfaces/sigprocmask/15-1.c | 5 +- .../conformance/interfaces/sigprocmask/17-1.c | 53 +++++++++++ .../conformance/interfaces/sigprocmask/17-1.sh | 12 --- .../conformance/interfaces/sigprocmask/17-2.sh | 12 --- .../conformance/interfaces/sigprocmask/17-3.sh | 12 --- .../conformance/interfaces/sigprocmask/17-4.sh | 12 --- .../conformance/interfaces/sigprocmask/17-core.c | 71 -------------- .../conformance/interfaces/sigprocmask/4-1.c | 2 +- .../conformance/interfaces/sigprocmask/5-1.c | 2 +- .../conformance/interfaces/sigprocmask/6-1.c | 2 +- .../conformance/interfaces/sigprocmask/7-1.c | 2 +- .../conformance/interfaces/sigprocmask/8-1.c | 8 +- .../conformance/interfaces/sigprocmask/8-2.c | 8 +- .../conformance/interfaces/sigprocmask/8-3.c | 8 +- .../conformance/interfaces/sigprocmask/9-1.c | 2 +- 44 files changed, 418 insertions(+), 672 deletions(-) create mode 100644 testcases/open_posix_testsuite/conformance/interfaces/sigaddset/1-1.c delete mode 100755 testcases/open_posix_testsuite/conformance/interfaces/sigaddset/1-1.sh create mode 100644 testcases/open_posix_testsuite/conformance/interfaces/sigaddset/1-2.c delete mode 100755 testcases/open_posix_testsuite/conformance/interfaces/sigaddset/1-2.sh delete mode 100644 testcases/open_posix_testsuite/conformance/interfaces/sigaddset/1-core.c create mode 100644 testcases/open_posix_testsuite/conformance/interfaces/sigaddset/4-1.c delete mode 100755 testcases/open_posix_testsuite/conformance/interfaces/sigaddset/4-1.sh delete mode 100755 testcases/open_posix_testsuite/conformance/interfaces/sigaddset/4-2.sh delete mode 100755 testcases/open_posix_testsuite/conformance/interfaces/sigaddset/4-3.sh delete mode 100755 testcases/open_posix_testsuite/conformance/interfaces/sigaddset/4-4.sh delete mode 100644 testcases/open_posix_testsuite/conformance/interfaces/sigaddset/4-core.c create mode 100644 testcases/open_posix_testsuite/conformance/interfaces/sigdelset/1-1.c delete mode 100755 testcases/open_posix_testsuite/conformance/interfaces/sigdelset/1-1.sh create mode 100644 testcases/open_posix_testsuite/conformance/interfaces/sigdelset/1-2.c delete mode 100755 testcases/open_posix_testsuite/conformance/interfaces/sigdelset/1-2.sh delete mode 100644 testcases/open_posix_testsuite/conformance/interfaces/sigdelset/1-core.c create mode 100644 testcases/open_posix_testsuite/conformance/interfaces/sighold/3-1.c delete mode 100755 testcases/open_posix_testsuite/conformance/interfaces/sighold/3-1.sh delete mode 100755 testcases/open_posix_testsuite/conformance/interfaces/sighold/3-2.sh delete mode 100755 testcases/open_posix_testsuite/conformance/interfaces/sighold/3-3.sh delete mode 100755 testcases/open_posix_testsuite/conformance/interfaces/sighold/3-4.sh delete mode 100644 testcases/open_posix_testsuite/conformance/interfaces/sighold/3-core.c create mode 100644 testcases/open_posix_testsuite/conformance/interfaces/sigprocmask/17-1.c delete mode 100755 testcases/open_posix_testsuite/conformance/interfaces/sigprocmask/17-1.sh delete mode 100755 testcases/open_posix_testsuite/conformance/interfaces/sigprocmask/17-2.sh delete mode 100755 testcases/open_posix_testsuite/conformance/interfaces/sigprocmask/17-3.sh delete mode 100755 testcases/open_posix_testsuite/conformance/interfaces/sigprocmask/17-4.sh delete mode 100644 testcases/open_posix_testsuite/conformance/interfaces/sigprocmask/17-core.c diff --git a/testcases/open_posix_testsuite/conformance/interfaces/pthread_once/1-1.c b/testcases/open_posix_testsuite/conformance/interfaces/pthread_once/1-1.c index 3a7c861..7504f6c 100644 --- a/testcases/open_posix_testsuite/conformance/interfaces/pthread_once/1-1.c +++ b/testcases/open_posix_testsuite/conformance/interfaces/pthread_once/1-1.c @@ -26,10 +26,10 @@ #include "posixtest.h" /* Keeps track of how many times the init function has been called. */ -int init_flag; +static int init_flag; /* The init function that pthread_once calls */ -void *an_init_func() +void an_init_func(void) { init_flag++; return NULL; @@ -37,16 +37,25 @@ void *an_init_func() int main() { + int ret; + pthread_once_t once_control = PTHREAD_ONCE_INIT; init_flag = 0; /* Call pthread_once, passing it the once_control */ - pthread_once(&once_control, (void *)an_init_func); - + ret = pthread_once(&once_control, an_init_func); + if (ret != 0) { + printf("pthread_once failed\n"); + return PTS_UNRESOLVED; + } /* Call pthread_once again. The init function should not be * called. */ - pthread_once(&once_control, (void *)an_init_func); + ret = pthread_once(&once_control, an_init_func); + if (ret != 0) { + printf("pthread_once failed\n"); + return PTS_UNRESOLVED; + } if (init_flag != 1) { printf("Test FAILED\n"); diff --git a/testcases/open_posix_testsuite/conformance/interfaces/sigaddset/1-1.c b/testcases/open_posix_testsuite/conformance/interfaces/sigaddset/1-1.c new file mode 100644 index 0000000..e33acd2 --- /dev/null +++ b/testcases/open_posix_testsuite/conformance/interfaces/sigaddset/1-1.c @@ -0,0 +1,40 @@ +/* + * Copyright (c) 2002, Intel Corporation. All rights reserved. + * Copyright (c) 2013 Cyril Hrubis <ch...@su...> + * + * Created by: julie.n.fleischer REMOVE-THIS AT intel DOT com + * This file is licensed under the GPL license. For the full content + * of this license, see the COPYING file at the top level of this + * source tree. + * + * Test that sigaddset() will add signo to the set signal set. + * Test steps: + * 1) Initialize an empty or full signal set. + * 2) Add the SIGALRM signal to the empty signal set. + * 3) Verify that SIGALRM is a member of the signal set. + */ +#include <stdio.h> +#include <signal.h> +#include "posixtest.h" + +int main(void) +{ + sigset_t signalset; + + if (sigemptyset(&signalset) == -1) { + perror("sigemptyset failed -- test aborted"); + return PTS_UNRESOLVED; + } + + if (sigaddset(&signalset, SIGALRM) == 0) { + if (sigismember(&signalset, SIGALRM) == 1) { + printf("Test PASSED: sigaddset added signal\n"); + return PTS_PASS; + } + printf("sigaddset returned, sigmember failed\n"); + return PTS_FAIL; + } + + printf("sigaddset failed\n"); + return PTS_FAIL; +} diff --git a/testcases/open_posix_testsuite/conformance/interfaces/sigaddset/1-1.sh b/testcases/open_posix_testsuite/conformance/interfaces/sigaddset/1-1.sh deleted file mode 100755 index 5078b0b..0000000 --- a/testcases/open_posix_testsuite/conformance/interfaces/sigaddset/1-1.sh +++ /dev/null @@ -1,20 +0,0 @@ -#!/bin/sh -# -# Copyright (c) 2002, Intel Corporation. All rights reserved. -# Created by: julie.n.fleischer REMOVE-THIS AT intel DOT com -# This file is licensed under the GPL license. For the full content -# of this license, see the COPYING file at the top level of this -# source tree. -# - -# Test that sigaddset() will add signo to the set signal set. -# This test initializes an empty signal set first. -# Test steps: -# 1) Initialize an empty signal set. -# 2) Add the SIGALRM signal to the empty signal set. -# 3) Verify that SIGALRM is a member of the signal set. -# - -# Calling 1-core with a 0 parameter initializes to an -# empty set. -./1-core 0 diff --git a/testcases/open_posix_testsuite/conformance/interfaces/sigaddset/1-2.c b/testcases/open_posix_testsuite/conformance/interfaces/sigaddset/1-2.c new file mode 100644 index 0000000..88ff762 --- /dev/null +++ b/testcases/open_posix_testsuite/conformance/interfaces/sigaddset/1-2.c @@ -0,0 +1,40 @@ +/* + * Copyright (c) 2002, Intel Corporation. All rights reserved. + * Copyright (c) 2013 Cyril Hrubis <ch...@su...> + * + * Created by: julie.n.fleischer REMOVE-THIS AT intel DOT com + * This file is licensed under the GPL license. For the full content + * of this license, see the COPYING file at the top level of this + * source tree. + * + * Test that sigaddset() will add signo to the set signal set. + * Test steps: + * 1) Initialize an empty or full signal set. + * 2) Add the SIGALRM signal to the empty signal set. + * 3) Verify that SIGALRM is a member of the signal set. + */ +#include <stdio.h> +#include <signal.h> +#include "posixtest.h" + +int main(void) +{ + sigset_t signalset; + + if (sigfillset(&signalset) == -1) { + perror("sigemptyset failed -- test aborted"); + return PTS_UNRESOLVED; + } + + if (sigaddset(&signalset, SIGALRM) == 0) { + if (sigismember(&signalset, SIGALRM) == 1) { + printf("Test PASSED: sigaddset added signal\n"); + return PTS_PASS; + } + printf("sigaddset returned, sigmember failed\n"); + return PTS_FAIL; + } + + printf("sigaddset failed\n"); + return PTS_FAIL; +} diff --git a/testcases/open_posix_testsuite/conformance/interfaces/sigaddset/1-2.sh b/testcases/open_posix_testsuite/conformance/interfaces/sigaddset/1-2.sh deleted file mode 100755 index e415624..0000000 --- a/testcases/open_posix_testsuite/conformance/interfaces/sigaddset/1-2.sh +++ /dev/null @@ -1,18 +0,0 @@ -#!/bin/sh -# Copyright (c) 2002, Intel Corporation. All rights reserved. -# Created by: julie.n.fleischer REMOVE-THIS AT intel DOT com -# This file is licensed under the GPL license. For the full content -# of this license, see the COPYING file at the top level of this -# source tree. - -# Test that sigaddset() will add signo to the set signal set. -# This test initializes an full signal set first. -# Test steps: -# 1) Initialize an full signal set. -# 2) Add the SIGALRM signal to the full signal set. -# 3) Verify that SIGALRM is a member of the signal set. -# - -# Calling 1-core with a 1 parameter initializes to an -# full set. -./1-core 1 diff --git a/testcases/open_posix_testsuite/conformance/interfaces/sigaddset/1-3.c b/testcases/open_posix_testsuite/conformance/interfaces/sigaddset/1-3.c index 8fc82ee..144d2ac 100644 --- a/testcases/open_posix_testsuite/conformance/interfaces/sigaddset/1-3.c +++ b/testcases/open_posix_testsuite/conformance/interfaces/sigaddset/1-3.c @@ -1,75 +1,60 @@ /* * Copyright (c) 2002, Intel Corporation. All rights reserved. + * Copyright (c) 2013 Cyril Hrubis <ch...@su...> + * * Created by: julie.fleischer REMOVE-THIS AT intel DOT com * This file is licensed under the GPL license. For the full content * of this license, see the COPYING file at the top level of this * source tree. - - Test that sigaddset() will add all defined signal numbers to a signal - set. - Test steps: - 1) Initialize an empty signal set. - For each signal number: - 2) Add the signal to the empty signal set. - 3) Verify that the signal is a member of the signal set. + * + * Test that sigaddset() will add all defined signal numbers to a signal + * set. + * + * Test steps: + * 1) Initialize an empty signal set. + * For each signal number: + * 2) Add the signal to the empty signal set. + * 3) Verify that the signal is a member of the signal set. */ #include <stdio.h> #include <signal.h> +#include "posixtest.h" -#define SIGNALLISTSIZE 21 +static const int sigs[] = { + SIGABRT, SIGALRM, SIGBUS, SIGCHLD, SIGCONT, + SIGFPE, SIGHUP, SIGILL, SIGINT, SIGKILL, + SIGPIPE, SIGQUIT, SIGSEGV, SIGSTOP, SIGTERM, + SIGTSTP, SIGTTIN, SIGTTOU, SIGUSR1, SIGUSR2, + SIGURG, +}; -int main() +int main(void) { sigset_t signalset; - int signallist[SIGNALLISTSIZE]; - int i; - int f = 0; + int i, err; - signallist[0] = SIGABRT; - signallist[1] = SIGALRM; - signallist[2] = SIGBUS; - signallist[3] = SIGCHLD; - signallist[4] = SIGCONT; - signallist[5] = SIGFPE; - signallist[6] = SIGHUP; - signallist[7] = SIGILL; - signallist[8] = SIGINT; - signallist[9] = SIGKILL; - signallist[10] = SIGPIPE; - signallist[11] = SIGQUIT; - signallist[12] = SIGSEGV; - signallist[13] = SIGSTOP; - signallist[14] = SIGTERM; - signallist[15] = SIGTSTP; - signallist[16] = SIGTTIN; - signallist[17] = SIGTTOU; - signallist[18] = SIGUSR1; - signallist[19] = SIGUSR2; - signallist[20] = SIGURG; if (sigemptyset(&signalset) == -1) { perror("sigemptyset failed -- test aborting\n"); - return -1; + return PTS_UNRESOLVED; } - for (i = 0; i < SIGNALLISTSIZE; i++) { - if (sigaddset(&signalset, signallist[i]) == 0) { - if (sigismember(&signalset, signallist[i]) == 1) { - // signal added - } else { - f = -1; - printf("Signal - %d\n", signallist[i]); + for (i = 0; i < sizeof(sigs)/sizeof(int); i++) { + if (sigaddset(&signalset, sigs[i]) == 0) { + if (sigismember(&signalset, sigs[i]) != 1) { + err++; + printf("Signal %d wasn't added \n", sigs[i]); } } else { - f = -1; - printf("Signal - %d\n", signallist[i]); + err++; + printf("Failed to add sinal %d\n", sigs[i]); } } - if (0 == f) { - printf("All signals added\n"); - return 0; + if (err) { + printf("FAILED: Some signals not added\n"); + return PTS_FAIL; } else { - printf("Some signals not added -- see above\n"); - return -1; + printf("Test PASSED: All signals added\n"); + return PTS_PASS; } } diff --git a/testcases/open_posix_testsuite/conformance/interfaces/sigaddset/1-core.c b/testcases/open_posix_testsuite/conformance/interfaces/sigaddset/1-core.c deleted file mode 100644 index e018541..0000000 --- a/testcases/open_posix_testsuite/conformance/interfaces/sigaddset/1-core.c +++ /dev/null @@ -1,54 +0,0 @@ -/* - * Copyright (c) 2002, Intel Corporation. All rights reserved. - * Created by: julie.n.fleischer REMOVE-THIS AT intel DOT com - * This file is licensed under the GPL license. For the full content - * of this license, see the COPYING file at the top level of this - * source tree. - - Test that sigaddset() will add signo to the set signal set. - Test steps: - 1) Initialize an empty or full signal set. - --> if argv[1] = 0, empty - --> if argv[1] = 1, full - 2) Add the SIGALRM signal to the empty signal set. - 3) Verify that SIGALRM is a member of the signal set. - */ -#include <stdio.h> -#include <signal.h> -#include "posixtest.h" - -int main(int argc, char *argv[]) -{ - sigset_t signalset; - - if (argc < 2) { - printf("Usage: %s [0|1]\n", argv[0]); - return PTS_UNRESOLVED; - } - if ('0' == argv[1][0]) { - if (sigemptyset(&signalset) == -1) { - perror("sigemptyset failed -- test aborted"); - return PTS_UNRESOLVED; - } - } else if ('1' == argv[1][0]) { - if (sigfillset(&signalset) == -1) { - perror("sigfillset failed -- test aborted"); - return PTS_UNRESOLVED; - } - } else { - printf("Usage: %s [0|1]\n", argv[0]); - return PTS_UNRESOLVED; - } - - if (sigaddset(&signalset, SIGALRM) == 0) { - if (sigismember(&signalset, SIGALRM) == 1) { - printf("sigaddset successfully added signal\n"); - return PTS_PASS; - } - printf("sigaddset returned, sigmember failed\n"); - return PTS_FAIL; - } - - printf("sigaddset failed\n"); - return PTS_FAIL; -} diff --git a/testcases/open_posix_testsuite/conformance/interfaces/sigaddset/2-1.c b/testcases/open_posix_testsuite/conformance/interfaces/sigaddset/2-1.c index a6528e4..99a2e0f 100644 --- a/testcases/open_posix_testsuite/conformance/interfaces/sigaddset/2-1.c +++ b/testcases/open_posix_testsuite/conformance/interfaces/sigaddset/2-1.c @@ -16,13 +16,13 @@ #include <signal.h> #include "posixtest.h" -int main() +int main(void) { sigset_t signalset; if (sigaddset(&signalset, SIGALRM) == 0) { if (sigismember(&signalset, SIGALRM) == 1) { - printf("Signal was added\n"); + printf("Test PASSED: Signal was added\n"); return PTS_PASS; } printf("Signal was not added\n"); diff --git a/testcases/open_posix_testsuite/conformance/interfaces/sigaddset/4-1.c b/testcases/open_posix_testsuite/conformance/interfaces/sigaddset/4-1.c new file mode 100644 index 0000000..e2dc312 --- /dev/null +++ b/testcases/open_posix_testsuite/conformance/interfaces/sigaddset/4-1.c @@ -0,0 +1,52 @@ +/* + * Copyright (c) 2002, Intel Corporation. All rights reserved. + * Copyright (c) 2013, Cyril Hrubis <ch...@su...> + * + * This file is licensed under the GPL license. For the full content + * of this license, see the COPYING file at the top level of this + * source tree. + * Testing sending invalid signals to sigaddset(). + * After invalid signal set, sigaddset() should return -1 and set + * errno to indicate the error. + * Test steps: + * 1) Initialize an empty signal set. + * 2) Add the invalid signal to the empty signal set. + * 3) Verify that -1 is returned, the invalid signal is not a member of + * the signal set, and errno is set to indicate the error. + */ +#include <errno.h> +#include <signal.h> +#include <stdio.h> +#include <stdint.h> +#include "posixtest.h" + +static const int sigs[] = {-1, -10000, INT32_MIN, INT32_MIN + 1}; + +int main(void) +{ + sigset_t signalset; + int i, ret, err = 0; + + if (sigemptyset(&signalset) == -1) { + perror("sigemptyset failed -- test aborted"); + return PTS_UNRESOLVED; + } + + for (i = 0; i < sizeof(sigs) / sizeof(int); i++) { + ret = sigaddset(&signalset, sigs[i]); + + if (ret != -1 || errno != EINVAL) { + err++; + printf("Failed sigaddset(..., %i) ret=%i errno=%i\n", + sigs[i], ret, errno); + } + } + + if (err) { + printf("Test FAILED\n"); + return PTS_FAIL; + } else { + printf("Test PASSED\n"); + return PTS_PASS; + } +} diff --git a/testcases/open_posix_testsuite/conformance/interfaces/sigaddset/4-1.sh b/testcases/open_posix_testsuite/conformance/interfaces/sigaddset/4-1.sh deleted file mode 100755 index 4ba1478..0000000 --- a/testcases/open_posix_testsuite/conformance/interfaces/sigaddset/4-1.sh +++ /dev/null @@ -1,12 +0,0 @@ -#!/bin/sh -# Copyright (c) 2002, Intel Corporation. All rights reserved. -# Created by: julie.n.fleischer REMOVE-THIS AT intel DOT com -# This file is licensed under the GPL license. For the full content -# of this license, see the COPYING file at the top level of this -# source tree. - -# -# Test various methods of adding invalid signals to sigaddset(). -# - -./4-core 1 diff --git a/testcases/open_posix_testsuite/conformance/interfaces/sigaddset/4-2.sh b/testcases/open_posix_testsuite/conformance/interfaces/sigaddset/4-2.sh deleted file mode 100755 index 1d20217..0000000 --- a/testcases/open_posix_testsuite/conformance/interfaces/sigaddset/4-2.sh +++ /dev/null @@ -1,13 +0,0 @@ -#!/bin/sh -# Copyright (c) 2002, Intel Corporation. All rights reserved. -# Created by: julie.n.fleischer REMOVE-THIS AT intel DOT com -# This file is licensed under the GPL license. For the full content -# of this license, see the COPYING file at the top level of this -# source tree. -# - -# -# Test various methods of adding invalid signals to sigaddset(). -# - -./4-core 2 diff --git a/testcases/open_posix_testsuite/conformance/interfaces/sigaddset/4-3.sh b/testcases/open_posix_testsuite/conformance/interfaces/sigaddset/4-3.sh deleted file mode 100755 index 12feaf6..0000000 --- a/testcases/open_posix_testsuite/conformance/interfaces/sigaddset/4-3.sh +++ /dev/null @@ -1,12 +0,0 @@ -#!/bin/sh -# Copyright (c) 2002, Intel Corporation. All rights reserved. -# Created by: julie.n.fleischer REMOVE-THIS AT intel DOT com -# This file is licensed under the GPL license. For the full content -# of this license, see the COPYING file at the top level of this -# source tree. -# -# -# Test various methods of adding invalid signals to sigaddset(). -# - -./4-core 3 diff --git a/testcases/open_posix_testsuite/conformance/interfaces/sigaddset/4-4.sh b/testcases/open_posix_testsuite/conformance/interfaces/sigaddset/4-4.sh deleted file mode 100755 index 8f1614b..0000000 --- a/testcases/open_posix_testsuite/conformance/interfaces/sigaddset/4-4.sh +++ /dev/null @@ -1,12 +0,0 @@ -#!/bin/sh -# Copyright (c) 2002, Intel Corporation. All rights reserved. -# Created by: julie.n.fleischer REMOVE-THIS AT intel DOT com -# This file is licensed under the GPL license. For the full content -# of this license, see the COPYING file at the top level of this -# source tree. -# -# -# Test various methods of adding invalid signals to sigaddset(). -# - -./4-core 4 diff --git a/testcases/open_posix_testsuite/conformance/interfaces/sigaddset/4-core.c b/testcases/open_posix_testsuite/conformance/interfaces/sigaddset/4-core.c deleted file mode 100644 index d14a15c..0000000 --- a/testcases/open_posix_testsuite/conformance/interfaces/sigaddset/4-core.c +++ /dev/null @@ -1,77 +0,0 @@ -/* - * Copyright (c) 2002, Intel Corporation. All rights reserved. - * Created by: julie.n.fleischer REMOVE-THIS AT intel DOT com - * This file is licensed under the GPL license. For the full content - * of this license, see the COPYING file at the top level of this - * source tree. - Testing sending invalid signals to sigaddset(). - After invalid signal sent, sigaddset() should return -1 and set - errno to indicate the error. - Test steps: - 1) Initialize an empty signal set. - 2) Add the invalid signal to the empty signal set. - 3) Verify that -1 is returned, the invalid signal is not a member of - the signal set, and errno is set to indicate the error. - */ -#include <errno.h> -#include <signal.h> -#include <stdio.h> -#include <stdint.h> -#include "posixtest.h" - -int main(int argc, char *argv[]) -{ - sigset_t signalset; - int signo; - - if (sigemptyset(&signalset) == -1) { - perror("sigemptyset failed -- test aborted"); - return PTS_UNRESOLVED; - } - - if (argc < 2) { - printf("Usage: %s [1|2|3|4]\n", argv[0]); - return PTS_UNRESOLVED; - } - - /* - Various error conditions - */ - switch (argv[1][0]) { - case '1': - signo = -1; - break; - case '2': - signo = -10000; - break; - case '3': - signo = INT32_MIN + 1; - break; - case '4': - signo = INT32_MIN; - break; - default: - printf("Usage: %s [1|2|3|4]\n", argv[0]); - return PTS_UNRESOLVED; - } - - if (sigaddset(&signalset, signo) == -1) { - if (EINVAL == errno) { - printf("errno set to EINVAL\n"); - if ((sigismember(&signalset, signo) == 0) || - sigismember(&signalset, signo) == -1) { - printf("signal was not added\n"); - return PTS_PASS; - } else { - printf("possible error in sigismember\n"); - return PTS_UNRESOLVED; - } - } else { - printf("errno not set to EINVAL\n"); - return PTS_FAIL; - } - } - - printf("sigaddset did not return -1\n"); - return PTS_FAIL; -} diff --git a/testcases/open_posix_testsuite/conformance/interfaces/sigdelset/1-1.c b/testcases/open_posix_testsuite/conformance/interfaces/sigdelset/1-1.c new file mode 100644 index 0000000..6a23e2b --- /dev/null +++ b/testcases/open_posix_testsuite/conformance/interfaces/sigdelset/1-1.c @@ -0,0 +1,53 @@ +/* + * Copyright (c) 2002, Intel Corporation. All rights reserved. + * Copyright (c) 2013 Cyril Hrubis <ch...@su...> + * + * Created by: julie.n.fleischer REMOVE-THIS AT intel DOT com + * This file is licensed under the GPL license. For the full content + * of this license, see the COPYING file at the top level of this + * source tree. + * + * Test that sigdelset() will remove signo to the set signal set. + * Test steps: + * 1) Initialize an empty or full signal set. + * 2) Add the SIGALRM signal to the empty signal set. + * 3) Verify that SIGALRM is a member of the signal set. + * 4) Remove the SIGALRM signal from the signal set. + * 5) Verify that SIGALRM is not a member of the signal set. + */ +#include <stdio.h> +#include <signal.h> +#include "posixtest.h" + +int main(void) +{ + sigset_t signalset; + + if (sigemptyset(&signalset) == -1) { + perror("sigemptyset failed -- test aborted"); + return PTS_UNRESOLVED; + } + + if (sigaddset(&signalset, SIGALRM) == -1) { + printf("sigaddset did not successfully add signal\n"); + return PTS_UNRESOLVED; + } + + if (sigismember(&signalset, SIGALRM) != 1) { + printf("sigismember failed\n"); + return PTS_UNRESOLVED; + } + + if (sigdelset(&signalset, SIGALRM) == -1) { + printf("sigdelset() failed\n"); + return PTS_FAIL; + } + + if (sigismember(&signalset, SIGALRM) == 0) { + printf("Test PASSED: sigdelset successfully removed signal\n"); + return PTS_PASS; + } else { + printf("Signal is still in signal set.\n"); + return PTS_FAIL; + } +} diff --git a/testcases/open_posix_testsuite/conformance/interfaces/sigdelset/1-1.sh b/testcases/open_posix_testsuite/conformance/interfaces/sigdelset/1-1.sh deleted file mode 100755 index 7b58c44..0000000 --- a/testcases/open_posix_testsuite/conformance/interfaces/sigdelset/1-1.sh +++ /dev/null @@ -1,16 +0,0 @@ -#!/bin/sh -# Copyright (c) 2002, Intel Corporation. All rights reserved. -# Created by: julie.n.fleischer REMOVE-THIS AT intel DOT com -# This file is licensed under the GPL license. For the full content -# of this license, see the COPYING file at the top level of this -# source tree. -# - -# -# Test that sigdelset() will remove signo from the set signal set. -# This test initializes an empty signal set first. -# - -# Calling 1-core with a 0 parameter initializes to an -# empty set. -./1-core 0 diff --git a/testcases/open_posix_testsuite/conformance/interfaces/sigdelset/1-2.c b/testcases/open_posix_testsuite/conformance/interfaces/sigdelset/1-2.c new file mode 100644 index 0000000..d9834e1 --- /dev/null +++ b/testcases/open_posix_testsuite/conformance/interfaces/sigdelset/1-2.c @@ -0,0 +1,53 @@ +/* + * Copyright (c) 2002, Intel Corporation. All rights reserved. + * Copyright (c) 2013 Cyril Hrubis <ch...@su...> + * + * Created by: julie.n.fleischer REMOVE-THIS AT intel DOT com + * This file is licensed under the GPL license. For the full content + * of this license, see the COPYING file at the top level of this + * source tree. + * + * Test that sigdelset() will remove signo to the set signal set. + * Test steps: + * 1) Initialize an empty or full signal set. + * 2) Add the SIGALRM signal to the empty signal set. + * 3) Verify that SIGALRM is a member of the signal set. + * 4) Remove the SIGALRM signal from the signal set. + * 5) Verify that SIGALRM is not a member of the signal set. + */ +#include <stdio.h> +#include <signal.h> +#include "posixtest.h" + +int main(void) +{ + sigset_t signalset; + + if (sigfillset(&signalset) == -1) { + perror("sigfillset failed -- test aborted"); + return PTS_UNRESOLVED; + } + + if (sigaddset(&signalset, SIGALRM) == -1) { + printf("sigaddset did not successfully add signal\n"); + return PTS_UNRESOLVED; + } + + if (sigismember(&signalset, SIGALRM) != 1) { + printf("sigismember failed\n"); + return PTS_UNRESOLVED; + } + + if (sigdelset(&signalset, SIGALRM) == -1) { + printf("sigdelset() failed\n"); + return PTS_FAIL; + } + + if (sigismember(&signalset, SIGALRM) == 0) { + printf("Test PASSED: sigdelset successfully removed signal\n"); + return PTS_PASS; + } else { + printf("Signal is still in signal set.\n"); + return PTS_FAIL; + } +} diff --git a/testcases/open_posix_testsuite/conformance/interfaces/sigdelset/1-2.sh b/testcases/open_posix_testsuite/conformance/interfaces/sigdelset/1-2.sh deleted file mode 100755 index 17b5a33..0000000 --- a/testcases/open_posix_testsuite/conformance/interfaces/sigdelset/1-2.sh +++ /dev/null @@ -1,16 +0,0 @@ -#!/bin/sh -# Copyright (c) 2002, Intel Corporation. All rights reserved. -# Created by: julie.n.fleischer REMOVE-THIS AT intel DOT com -# This file is licensed under the GPL license. For the full content -# of this license, see the COPYING file at the top level of this -# source tree. -# - -# -# Test that sigdelset() will remove signo from the set signal set. -# This test initializes a full signal set first. -# - -# Calling 1-core with a 1 parameter initializes to an -# full set. -./1-core 1 diff --git a/testcases/open_posix_testsuite/conformance/interfaces/sigdelset/1-core.c b/testcases/open_posix_testsuite/conformance/interfaces/sigdelset/1-core.c deleted file mode 100644 index 659d827..0000000 --- a/testcases/open_posix_testsuite/conformance/interfaces/sigdelset/1-core.c +++ /dev/null @@ -1,67 +0,0 @@ -/* - * Copyright (c) 2002, Intel Corporation. All rights reserved. - * Created by: julie.n.fleischer REMOVE-THIS AT intel DOT com - * This file is licensed under the GPL license. For the full content - * of this license, see the COPYING file at the top level of this - * source tree. - - Test that sigdelset() will remove signo to the set signal set. - Test steps: - 1) Initialize an empty or full signal set. - --> if argv[1] = 0, empty - --> if argv[1] = 1, full - 2) Add the SIGALRM signal to the empty signal set. - 3) Verify that SIGALRM is a member of the signal set. - 4) Remove the SIGALRM signal from the signal set. - 5) Verify that SIGALRM is not a member of the signal set. - */ -#include <stdio.h> -#include <signal.h> -#include "posixtest.h" - -int main(int argc, char *argv[]) -{ - sigset_t signalset; - - if (argc < 2) { - printf("Usage: %s [0|1]\n", argv[0]); - return PTS_UNRESOLVED; - } - if ('0' == argv[1][0]) { - if (sigemptyset(&signalset) == -1) { - perror("sigemptyset failed -- test aborted"); - return PTS_UNRESOLVED; - } - } else if ('1' == argv[1][0]) { - if (sigfillset(&signalset) == -1) { - perror("sigfillset failed -- test aborted"); - return PTS_UNRESOLVED; - } - } else { - printf("Usage: %s [0|1]\n", argv[0]); - return PTS_UNRESOLVED; - } - - if (sigaddset(&signalset, SIGALRM) == 0) { - if (sigismember(&signalset, SIGALRM) == 0) { - printf("sigaddset returned, sigismember failed\n"); - return PTS_UNRESOLVED; - } - } else { - printf("sigaddset did not successfully add signal\n"); - return PTS_UNRESOLVED; - } - - if (sigdelset(&signalset, SIGALRM) == 0) { - if (sigismember(&signalset, SIGALRM) == 0) { - printf("sigdelset successfully removed signal\n"); - return PTS_PASS; - } else { - printf("Signal is still in signal set.\n"); - return PTS_FAIL; - } - } else { - printf("sigdelset() failed\n"); - return PTS_FAIL; - } -} diff --git a/testcases/open_posix_testsuite/conformance/interfaces/sighold/1-1.c b/testcases/open_posix_testsuite/conformance/interfaces/sighold/1-1.c index 2346300..35a91d2 100644 --- a/testcases/open_posix_testsuite/conformance/interfaces/sighold/1-1.c +++ b/testcases/open_posix_testsuite/conformance/interfaces/sighold/1-1.c @@ -19,14 +19,14 @@ #include <unistd.h> #include "posixtest.h" -int handler_called = 0; +static int handler_called = 0; -void handler(int signo) +static void handler(int signo) { handler_called = 1; } -int main() +int main(void) { struct sigaction act; @@ -51,7 +51,8 @@ int main() return PTS_UNRESOLVED; } - sleep(1); + usleep(100000); + if (handler_called) { printf("FAIL: Signal was not blocked\n"); return PTS_FAIL; diff --git a/testcases/open_posix_testsuite/conformance/interfaces/sighold/2-1.c b/testcases/open_posix_testsuite/conformance/interfaces/sighold/2-1.c index 8aa98fa..e94f4ce 100644 --- a/testcases/open_posix_testsuite/conformance/interfaces/sighold/2-1.c +++ b/testcases/open_posix_testsuite/conformance/interfaces/sighold/2-1.c @@ -15,13 +15,13 @@ #include <signal.h> #include "posixtest.h" -int main() +int main(void) { - if ((int)sighold(SIGABRT) != 0) { + if (sighold(SIGABRT) != 0) { perror("sighold failed -- returned -- test aborted"); return PTS_UNRESOLVED; } - printf("sighold passed\n"); + printf("Test PASSED\n"); return PTS_PASS; } diff --git a/testcases/open_posix_testsuite/conformance/interfaces/sighold/3-1.c b/testcases/open_posix_testsuite/conformance/interfaces/sighold/3-1.c new file mode 100644 index 0000000..d124411 --- /dev/null +++ b/testcases/open_posix_testsuite/conformance/interfaces/sighold/3-1.c @@ -0,0 +1,46 @@ +/* + * Copyright (c) 2003, Intel Corporation. All rights reserved. + * Copyright (c) 2013, Cyril Hrubis <ch...@su...> + * + * Created by: salwan.searty REMOVE-THIS AT intel DOT com + * This file is licensed under the GPL license. For the full content + * of this license, see the COPYING file at the top level of this + * source tree. + * + * + * After sighold is called on an invalid signal it should return -1 and set + * errno to EINVAL + */ + +#define _XOPEN_SOURCE 600 + +#include <stdio.h> +#include <signal.h> +#include <errno.h> +#include <stdint.h> +#include "posixtest.h" + +static const int sigs[] = {-1, -10000, INT32_MIN, INT32_MIN + 1}; + +int main(void) +{ + int i, ret, err = 0; + + for (i = 0; i < sizeof(sigs) / sizeof(int); i++) { + ret = sighold(sigs[i]); + + if (ret != -1 || errno != EINVAL) { + err++; + printf("Failed sighold(%i) ret=%i errno=%i\n", + sigs[i], ret, errno); + } + } + + if (err) { + printf("Test FAILED\n"); + return PTS_FAIL; + } else { + printf("Test PASSED\n"); + return PTS_PASS; + } +} diff --git a/testcases/open_posix_testsuite/conformance/interfaces/sighold/3-1.sh b/testcases/open_posix_testsuite/conformance/interfaces/sighold/3-1.sh deleted file mode 100755 index 7cd8eae..0000000 --- a/testcases/open_posix_testsuite/conformance/interfaces/sighold/3-1.sh +++ /dev/null @@ -1,12 +0,0 @@ -#!/bin/sh -# Copyright (c) 2003, Intel Corporation. All rights reserved. -# Created by: salwan.searty REMOVE-THIS AT intel DOT com -# This file is licensed under the GPL license. For the full content -# of this license, see the COPYING file at the top level of this -# source tree. - -# -# Test various methods of adding invalid signals to sighold(). -# - -./3-core 1 diff --git a/testcases/open_posix_testsuite/conformance/interfaces/sighold/3-2.sh b/testcases/open_posix_testsuite/conformance/interfaces/sighold/3-2.sh deleted file mode 100755 index 395bd4e..0000000 --- a/testcases/open_posix_testsuite/conformance/interfaces/sighold/3-2.sh +++ /dev/null @@ -1,13 +0,0 @@ -#!/bin/sh -# Copyright (c) 2003, Intel Corporation. All rights reserved. -# Created by: salwan.searty REMOVE-THIS AT intel DOT com -# This file is licensed under the GPL license. For the full content -# of this license, see the COPYING file at the top level of this -# source tree. -# - -# -# Test various methods of passing invalid signals to sighold(). -# - -./3-core 2 diff --git a/testcases/open_posix_testsuite/conformance/interfaces/sighold/3-3.sh b/testcases/open_posix_testsuite/conformance/interfaces/sighold/3-3.sh deleted file mode 100755 index 8b22746..0000000 --- a/testcases/open_posix_testsuite/conformance/interfaces/sighold/3-3.sh +++ /dev/null @@ -1,12 +0,0 @@ -#!/bin/sh -# Copyright (c) 2003, Intel Corporation. All rights reserved. -# Created by: salwan.searty REMOVE-THIS AT intel DOT com -# This file is licensed under the GPL license. For the full content -# of this license, see the COPYING file at the top level of this -# source tree. -# -# -# Test various methods of passing invalid signals to sighold(). -# - -./3-core 3 diff --git a/testcases/open_posix_testsuite/conformance/interfaces/sighold/3-4.sh b/testcases/open_posix_testsuite/conformance/interfaces/sighold/3-4.sh deleted file mode 100755 index e017443..0000000 --- a/testcases/open_posix_testsuite/conformance/interfaces/sighold/3-4.sh +++ /dev/null @@ -1,12 +0,0 @@ -#!/bin/sh -# Copyright (c) 2003, Intel Corporation. All rights reserved. -# Created by: salwan.searty REMOVE-THIS AT intel DOT com -# This file is licensed under the GPL license. For the full content -# of this license, see the COPYING file at the top level of this -# source tree. -# -# -# Test various methods of passing invalid signals to sighold(). -# - -./3-core 4 diff --git a/testcases/open_posix_testsuite/conformance/interfaces/sighold/3-core.c b/testcases/open_posix_testsuite/conformance/interfaces/sighold/3-core.c deleted file mode 100644 index d661de8..0000000 --- a/testcases/open_posix_testsuite/conformance/interfaces/sighold/3-core.c +++ /dev/null @@ -1,99 +0,0 @@ -/* - * Copyright (c) 2003, Intel Corporation. All rights reserved. - * Created by: salwan.searty REMOVE-THIS AT intel DOT com - * This file is licensed under the GPL license. For the full content - * of this license, see the COPYING file at the top level of this - * source tree. - - Testing passing an invalid signals to sighold(). - After sighold is called on an invalid signal, sighold() should return -1 and set - errno to EINVAL - - The invalid signal passed to sighold() depends on the argument passed to this program. - There are currently 4 invalid signals. - */ - -#define _XOPEN_SOURCE 600 - -#include <stdio.h> -#include <signal.h> -#include <errno.h> -#include <stdint.h> -#include <setjmp.h> -#include "posixtest.h" - -jmp_buf sig11_recover; -void sig11_handler(int sig); - -int main(int argc, char *argv[]) -{ - int signo, TEST_RETURN; - struct sigaction sa, osa; - - if (argc < 2) { - printf("Usage: %s [1|2|3|4]\n", argv[0]); - return PTS_UNRESOLVED; - } - - /* - Various error conditions - */ - switch (argv[1][0]) { - case '1': - signo = -1; - break; - case '2': - signo = -10000; - break; - case '3': - signo = INT32_MIN + 1; - break; - case '4': - signo = INT32_MIN; - break; - default: - printf("Usage: %s [1|2|3|4]\n", argv[0]); - return PTS_UNRESOLVED; - } - - /* special sig11 case */ - sa.sa_handler = &sig11_handler; - sigemptyset(&sa.sa_mask); - sa.sa_flags = 0; - - sigaction(SIGSEGV, NULL, &osa); - sigaction(SIGSEGV, &sa, NULL); - - if (setjmp(sig11_recover)) { - errno = EINVAL; - TEST_RETURN = -2; - } else { - TEST_RETURN = sighold(signo); - } - sigaction(SIGSEGV, &osa, NULL); - - if (TEST_RETURN == -1) { - if (EINVAL == errno) { - printf("errno set to EINVAL\n"); - return PTS_PASS; - } else { - printf("errno not set to EINVAL\n"); - return PTS_FAIL; - } - } - if (TEST_RETURN == -2) { - printf("test received SIGSEGV\n"); - return PTS_UNRESOLVED; - } - - printf("sighold did not return -1\n"); - return PTS_FAIL; -} - -/****************************************************************** - * sig11_handler() - our segfault recover hack - ******************************************************************/ -void sig11_handler(int sig) -{ - longjmp(sig11_recover, 1); -} diff --git a/testcases/open_posix_testsuite/conformance/interfaces/sigprocmask/10-1.c b/testcases/open_posix_testsuite/conformance/interfaces/sigprocmask/10-1.c index 9052fe5..62d718f 100644 --- a/testcases/open_posix_testsuite/conformance/interfaces/sigprocmask/10-1.c +++ b/testcases/open_posix_testsuite/conformance/interfaces/sigprocmask/10-1.c @@ -15,9 +15,8 @@ #include <stdio.h> #include "posixtest.h" -int main() +int main(void) { - sigset_t set1, set2; int sigprocmask_return_val = 1; diff --git a/testcases/open_posix_testsuite/conformance/interfaces/sigprocmask/12-1.c b/testcases/open_posix_testsuite/conformance/interfaces/sigprocmask/12-1.c index 57c5036..5e0d2f4 100644 --- a/testcases/open_posix_testsuite/conformance/interfaces/sigprocmask/12-1.c +++ b/testcases/open_posix_testsuite/conformance/interfaces/sigprocmask/12-1.c @@ -51,7 +51,7 @@ int is_changed(sigset_t set) return 0; } -int get_rand() +int get_rand(void) { int r; @@ -62,7 +62,7 @@ int get_rand() return r; } -int main() +int main(void) { int r = get_rand(); @@ -93,6 +93,6 @@ int main() return PTS_FAIL; } - printf("PASS: signal mask was not changed.\n"); + printf("Test PASSED: signal mask was not changed.\n"); return PTS_PASS; } diff --git a/testcases/open_posix_testsuite/conformance/interfaces/sigprocmask/15-1.c b/testcases/open_posix_testsuite/conformance/interfaces/sigprocmask/15-1.c index bbacffd..c0ac96d 100644 --- a/testcases/open_posix_testsuite/conformance/interfaces/sigprocmask/15-1.c +++ b/testcases/open_posix_testsuite/conformance/interfaces/sigprocmask/15-1.c @@ -15,9 +15,8 @@ #include <signal.h> #include "posixtest.h" -int main() +int main(void) { - sigset_t set; sigaddset(&set, SIGABRT); @@ -25,6 +24,6 @@ int main() perror("sigprocmask failed -- returned -- test aborted"); return PTS_FAIL; } - printf("sigignore passed\n"); + printf("Test PASSED\n"); return PTS_PASS; } diff --git a/testcases/open_posix_testsuite/conformance/interfaces/sigprocmask/17-1.c b/testcases/open_posix_testsuite/conformance/interfaces/sigprocmask/17-1.c new file mode 100644 index 0000000..f10397a --- /dev/null +++ b/testcases/open_posix_testsuite/conformance/interfaces/sigprocmask/17-1.c @@ -0,0 +1,53 @@ +/* + * Copyright (c) 2013 Cyril Hrubis <ch...@su...> + * + * This file is licensed under the GPL license. For the full content of this + * license, see the COPYING file at the top level of this source tree. + * + * After sigprocmask() is called on an invalid how it should return -1 and set + * errno to EINVAL. + */ + +#define _XOPEN_SOURCE 600 + +#include <stdio.h> +#include <signal.h> +#include <errno.h> +#include <stdint.h> +#include <stdlib.h> +#include "posixtest.h" + +int main(void) +{ + sigset_t set; + int r, i, fails = 0; + + sigemptyset(&set); + sigaddset(&set, SIGABRT); + + for (i = 0; i < 100000; i++) { + r = rand() % (i + 1); + + switch (r) { + case SIG_BLOCK: + case SIG_UNBLOCK: + case SIG_SETMASK: + continue; + default: + break; + } + + if (sigprocmask(r, &set, NULL) != -1 || errno != EINVAL) { + printf("sigprocmask(%i, ...) failed to fail\n", r); + fails++; + } + } + + if (fails) { + printf("Test FAILED\n"); + return PTS_FAIL; + } + + printf("Test PASSED\n"); + return PTS_PASS; +} diff --git a/testcases/open_posix_testsuite/conformance/interfaces/sigprocmask/17-1.sh b/testcases/open_posix_testsuite/conformance/interfaces/sigprocmask/17-1.sh deleted file mode 100755 index b3cf7eb..0000000 --- a/testcases/open_posix_testsuite/conformance/interfaces/sigprocmask/17-1.sh +++ /dev/null @@ -1,12 +0,0 @@ -#!/bin/sh -# Copyright (c) 2003, Intel Corporation. All rights reserved. -# Created by: salwan.searty REMOVE-THIS AT intel DOT com -# This file is licensed under the GPL license. For the full content -# of this license, see the COPYING file at the top level of this -# source tree. - -# -# Test various methods of passing invalid signals to sigignore(). -# - -./17-core 1 diff --git a/testcases/open_posix_testsuite/conformance/interfaces/sigprocmask/17-2.sh b/testcases/open_posix_testsuite/conformance/interfaces/sigprocmask/17-2.sh deleted file mode 100755 index e4dbd01..0000000 --- a/testcases/open_posix_testsuite/conformance/interfaces/sigprocmask/17-2.sh +++ /dev/null @@ -1,12 +0,0 @@ -#!/bin/sh -# Copyright (c) 2003, Intel Corporation. All rights reserved. -# Created by: salwan.searty REMOVE-THIS AT intel DOT com -# This file is licensed under the GPL license. For the full content -# of this license, see the COPYING file at the top level of this -# source tree. - -# -# Test various methods of passing invalid signals to sigignore(). -# - -./17-core 2 diff --git a/testcases/open_posix_testsuite/conformance/interfaces/sigprocmask/17-3.sh b/testcases/open_posix_testsuite/conformance/interfaces/sigprocmask/17-3.sh deleted file mode 100755 index de3080c..0000000 --- a/testcases/open_posix_testsuite/conformance/interfaces/sigprocmask/17-3.sh +++ /dev/null @@ -1,12 +0,0 @@ -#!/bin/sh -# Copyright (c) 2003, Intel Corporation. All rights reserved. -# Created by: salwan.searty REMOVE-THIS AT intel DOT com -# This file is licensed under the GPL license. For the full content -# of this license, see the COPYING file at the top level of this -# source tree. - -# -# Test various methods of passing invalid signals to sigignore(). -# - -./17-core 3 diff --git a/testcases/open_posix_testsuite/conformance/interfaces/sigprocmask/17-4.sh b/testcases/open_posix_testsuite/conformance/interfaces/sigprocmask/17-4.sh deleted file mode 100755 index 79e72c9..0000000 --- a/testcases/open_posix_testsuite/conformance/interfaces/sigprocmask/17-4.sh +++ /dev/null @@ -1,12 +0,0 @@ -#!/bin/sh -# Copyright (c) 2003, Intel Corporation. All rights reserved. -# Created by: salwan.searty REMOVE-THIS AT intel DOT com -# This file is licensed under the GPL license. For the full content -# of this license, see the COPYING file at the top level of this -# source tree. - -# -# Test various methods of passing invalid signals to sigignore(). -# - -./17-core 4 diff --git a/testcases/open_posix_testsuite/conformance/interfaces/sigprocmask/17-core.c b/testcases/open_posix_testsuite/conformance/interfaces/sigprocmask/17-core.c deleted file mode 100644 index f2434d8..0000000 --- a/testcases/open_posix_testsuite/conformance/interfaces/sigprocmask/17-core.c +++ /dev/null @@ -1,71 +0,0 @@ -/* - * Copyright (c) 2003, Intel Corporation. All rights reserved. - * Created by: salwan.searty REMOVE-THIS AT intel DOT com - * This file is licensed under the GPL license. For the full content - * of this license, see the COPYING file at the top level of this - * source tree. - - Testing passing an invalid signals to sighold(). - After sighold is called on an invalid signal, sigignore() should -return -1 and set errno to EINVAL - - The invalid signal passed to sigignore() depends on the argument -passed to this program. There are currently 4 invalid signals. - */ - -#define _XOPEN_SOURCE 600 - -#include <stdio.h> -#include <signal.h> -#include <errno.h> -#include <stdint.h> -#include <stdlib.h> -#include "posixtest.h" - -int main(int argc, char *argv[]) -{ - int signo; - int r = rand(); - sigset_t set; - - if (argc < 2) { - printf("Usage: %s [1|2|3|4]\n", argv[0]); - return PTS_UNRESOLVED; - } - - /* - Various error conditions - */ - switch (argv[1][0]) { - case '1': - signo = -1; - break; - case '2': - signo = -10000; - break; - case '3': - signo = INT32_MIN + 1; - break; - case '4': - signo = INT32_MIN; - break; - default: - printf("Usage: %s [1|2|3|4]\n", argv[0]); - return PTS_UNRESOLVED; - } - - sigaddset(&set, SIGABRT); - - if (sigprocmask(r, &set, NULL) == -1) { - if (EINVAL == errno) { - printf("errno set to EINVAL\n"); - return PTS_PASS; - } else { - printf("errno not set to EINVAL\n"); - return PTS_FAIL; - } - } - - printf("sighold did not return -1\n"); - return PTS_FAIL; -} diff --git a/testcases/open_posix_testsuite/conformance/interfaces/sigprocmask/4-1.c b/testcases/open_posix_testsuite/conformance/interfaces/sigprocmask/4-1.c index 0778cc6..d0496d0 100644 --- a/testcases/open_posix_testsuite/conformance/interfaces/sigprocmask/4-1.c +++ b/testcases/open_posix_testsuite/conformance/interfaces/sigprocmask/4-1.c @@ -22,7 +22,7 @@ void handler(int signo) handler_called = 1; } -int main() +int main(void) { struct sigaction act; sigset_t blocked_set1, blocked_set2, pending_set; diff --git a/testcases/open_posix_testsuite/conformance/interfaces/sigprocmask/5-1.c b/testcases/open_posix_testsuite/conformance/interfaces/sigprocmask/5-1.c index e7157ac..f8297ff 100644 --- a/testcases/open_posix_testsuite/conformance/interfaces/sigprocmask/5-1.c +++ b/testcases/open_posix_testsuite/conformance/interfaces/sigprocmask/5-1.c @@ -20,7 +20,7 @@ void handler(int signo) handler_called = 1; } -int main() +int main(void) { struct sigaction act; sigset_t blocked_set, pending_set; diff --git a/testcases/open_posix_testsuite/conformance/interfaces/sigprocmask/6-1.c b/testcases/open_posix_testsuite/conformance/interfaces/sigprocmask/6-1.c index a039751..21dafeb 100644 --- a/testcases/open_posix_testsuite/conformance/interfaces/sigprocmask/6-1.c +++ b/testcases/open_posix_testsuite/conformance/interfaces/sigprocmask/6-1.c @@ -22,7 +22,7 @@ void handler(int signo) handler_called = 1; } -int main() +int main(void) { struct sigaction act; sigset_t set1, set2, pending_set; diff --git a/testcases/open_posix_testsuite/conformance/interfaces/sigprocmask/7-1.c b/testcases/open_posix_testsuite/conformance/interfaces/sigprocmask/7-1.c index 06ce8b2..28bea01 100644 --- a/testcases/open_posix_testsuite/conformance/interfaces/sigprocmask/7-1.c +++ b/testcases/open_posix_testsuite/conformance/interfaces/sigprocmask/7-1.c @@ -21,7 +21,7 @@ #define NUMSIGNALS (sizeof(siglist) / sizeof(siglist[0])) -int main() +int main(void) { sigset_t oactl, tempset; int i, j, test_failed = 0; diff --git a/testcases/open_posix_testsuite/conformance/interfaces/sigprocmask/8-1.c b/testcases/open_posix_testsuite/conformance/interfaces/sigprocmask/8-1.c index 3ebfd6e..d2c3f68 100644 --- a/testcases/open_posix_testsuite/conformance/interfaces/sigprocmask/8-1.c +++ b/testcases/open_posix_testsuite/conformance/interfaces/sigprocmask/8-1.c @@ -53,7 +53,7 @@ int is_changed(sigset_t set, int sig) return 0; } -int main() +int main(void) { sigset_t actl, oactl; @@ -65,9 +65,9 @@ int main() sigprocmask(SIG_SETMASK, &actl, NULL); sigprocmask(SIG_BLOCK, NULL, &oactl); - if (is_changed(oactl, SIGABRT)) { + if (is_changed(oactl, SIGABRT)) return PTS_FAIL; - } - printf("PASS: signal mask was not changed.\n"); + + printf("Test PASSED: signal mask was not changed.\n"); return PTS_PASS; } diff --git a/testcases/open_posix_testsuite/conformance/interfaces/sigprocmask/8-2.c b/testcases/open_posix_testsuite/conformance/interfaces/sigprocmask/8-2.c index fb59b81..e478679 100644 --- a/testcases/open_posix_testsuite/conformance/interfaces/sigprocmask/8-2.c +++ b/testcases/open_posix_testsuite/conformance/interfaces/sigprocmask/8-2.c @@ -54,7 +54,7 @@ int is_changed(sigset_t set, int sig) return 0; } -int main() +int main(void) { sigset_t actl, oactl; @@ -66,9 +66,9 @@ int main() sigprocmask(SIG_SETMASK, &actl, NULL); sigprocmask(SIG_SETMASK, NULL, &oactl); - if (is_changed(oactl, SIGABRT)) { + if (is_changed(oactl, SIGABRT)) return PTS_FAIL; - } - printf("PASS: signal mask was not changed.\n"); + + printf("Test PASSED: signal mask was not changed.\n"); return PTS_PASS; } diff --git a/testcases/open_posix_testsuite/conformance/interfaces/sigprocmask/8-3.c b/testcases/open_posix_testsuite/conformance/interfaces/sigprocmask/8-3.c index 6939455..98bc095 100644 --- a/testcases/open_posix_testsuite/conformance/interfaces/sigprocmask/8-3.c +++ b/testcases/open_posix_testsuite/conformance/interfaces/sigprocmask/8-3.c @@ -53,7 +53,7 @@ int is_changed(sigset_t set, int sig) return 0; } -int main() +int main(void) { sigset_t actl, oactl; @@ -65,9 +65,9 @@ int main() sigprocmask(SIG_SETMASK, &actl, NULL); sigprocmask(SIG_UNBLOCK, NULL, &oactl); - if (is_changed(oactl, SIGABRT)) { + if (is_changed(oactl, SIGABRT)) return PTS_FAIL; - } - printf("PASS: signal mask was not changed.\n"); + + printf("Test PASSED: signal mask was not changed.\n"); return PTS_PASS; } diff --git a/testcases/open_posix_testsuite/conformance/interfaces/sigprocmask/9-1.c b/testcases/open_posix_testsuite/conformance/interfaces/sigprocmask/9-1.c index 7db46b2..53d11c0 100644 --- a/testcases/open_posix_testsuite/conformance/interfaces/sigprocmask/9-1.c +++ b/testcases/open_posix_testsuite/conformance/interfaces/sigprocmask/9-1.c @@ -36,7 +36,7 @@ void handler(int signo) } } -int main() +int main(void) { struct sigaction act; sigset_t blocked_set1; hooks/post-receive -- ltp |
From: Caspar Z. <su...@li...> - 2013-03-11 04:14:49
|
The branch, master, has been updated via 31dffcf9420430f6a5042b74d4beb72317523f18 (commit) via 0101f63a3c2ec900bbbf537ac1e68d4db0b550c9 (commit) via d59a659cd639ca2780b00049d102acd2a783d585 (commit) from a5cc30c425040cb352aa185993afac0c846f18d4 (commit) - Log ----------------------------------------------------------------- commit 31dffcf9420430f6a5042b74d4beb72317523f18 Author: Caspar Zhang <ca...@ca...> Date: Thu Mar 7 14:39:16 2013 +0800 syscalls/madvise02: fix madvise case due to kernel change since kernel commit 1998cc0 (after kernel-3.8 released), madvise(MADV_WILLNEED) to anonymous memory doesn't return -EBADF now, as now we support swap prefetch. Thus the 5th testcase in madvise02 will not pass. This patch fixes this by adding a tst_kvercmp() condition, and will give a pass if kernel is >=3.9 (including the RCs). Signed-off-by: Caspar Zhang <ca...@ca...> Reviewed-by: Wanlong Gao <gao...@cn...> Reviewed-by: Zhouping Liu <zl...@re...> commit 0101f63a3c2ec900bbbf537ac1e68d4db0b550c9 Author: Caspar Zhang <ca...@ca...> Date: Thu Mar 7 14:24:26 2013 +0800 syscalls/madvise: code cleanup Just a code cleanup for syscalls/madvise01-04 cases. Signed-off-by: Caspar Zhang <ca...@ca...> Reviewed-by: Wanlong Gao<gao...@cn...> commit d59a659cd639ca2780b00049d102acd2a783d585 Author: Caspar Zhang <ca...@ca...> Date: Thu Mar 7 14:59:12 2013 +0800 s/Tst_count/tst_count/ to avoid CamelCase when using latest checkpatch.pl, CamelCase variables are not encouraged, this patch does a batch update to replace all var `Tst_count` with `tst_count`. Signed-off-by: Caspar Zhang <ca...@ca...> Acked-by: Wanlong Gao <gao...@cn...> ----------------------------------------------------------------------- Summary of changes: doc/examples/quickhit.c | 6 +- doc/man3/tst_res.3 | 20 ++-- doc/man3/tst_set_error.3 | 18 ++-- doc/man3/tst_sig.3 | 8 +- include/test.h | 2 +- lib/tst_res.c | 16 ++-- testcases/kernel/fs/proc/proc01.c | 2 +- testcases/kernel/mem/cpuset/cpuset01.c | 2 +- testcases/kernel/mem/hugetlb/hugemmap/hugemmap01.c | 2 +- testcases/kernel/mem/hugetlb/hugemmap/hugemmap02.c | 2 +- testcases/kernel/mem/hugetlb/hugemmap/hugemmap03.c | 2 +- testcases/kernel/mem/hugetlb/hugemmap/hugemmap04.c | 2 +- testcases/kernel/mem/hugetlb/hugemmap/hugemmap05.c | 4 +- .../kernel/mem/hugetlb/hugeshmat/hugeshmat01.c | 2 +- .../kernel/mem/hugetlb/hugeshmat/hugeshmat02.c | 2 +- .../kernel/mem/hugetlb/hugeshmat/hugeshmat03.c | 2 +- .../kernel/mem/hugetlb/hugeshmctl/hugeshmctl01.c | 2 +- .../kernel/mem/hugetlb/hugeshmctl/hugeshmctl02.c | 2 +- .../kernel/mem/hugetlb/hugeshmctl/hugeshmctl03.c | 2 +- .../kernel/mem/hugetlb/hugeshmdt/hugeshmdt01.c | 2 +- .../kernel/mem/hugetlb/hugeshmget/hugeshmget01.c | 2 +- .../kernel/mem/hugetlb/hugeshmget/hugeshmget02.c | 2 +- .../kernel/mem/hugetlb/hugeshmget/hugeshmget03.c | 2 +- .../kernel/mem/hugetlb/hugeshmget/hugeshmget05.c | 2 +- testcases/kernel/mem/ksm/ksm01.c | 2 +- testcases/kernel/mem/ksm/ksm02.c | 2 +- testcases/kernel/mem/ksm/ksm03.c | 2 +- testcases/kernel/mem/ksm/ksm04.c | 2 +- testcases/kernel/mem/ksm/ksm05.c | 2 +- testcases/kernel/mem/mem/mem01.c | 2 +- .../kernel/mem/mmapstress/mmap-corruption01.c | 2 +- testcases/kernel/mem/oom/oom01.c | 2 +- testcases/kernel/mem/oom/oom02.c | 2 +- testcases/kernel/mem/oom/oom03.c | 2 +- testcases/kernel/mem/oom/oom04.c | 2 +- testcases/kernel/mem/swapping/swapping01.c | 2 +- testcases/kernel/mem/thp/thp02.c | 2 +- testcases/kernel/mem/thp/thp03.c | 2 +- testcases/kernel/mem/tunable/max_map_count.c | 2 +- testcases/kernel/mem/tunable/min_free_kbytes.c | 2 +- testcases/kernel/mem/tunable/overcommit_memory.c | 2 +- testcases/kernel/mem/vma/vma01.c | 2 +- testcases/kernel/mem/vma/vma02.c | 2 +- testcases/kernel/mem/vma/vma03.c | 2 +- testcases/kernel/mem/vma/vma04.c | 2 +- testcases/kernel/mem/zram/zram01.c | 2 +- .../kernel/module/create_module/create_module01.c | 4 +- .../kernel/module/create_module/create_module02.c | 4 +- .../kernel/module/delete_module/delete_module01.c | 4 +- .../kernel/module/delete_module/delete_module02.c | 4 +- .../kernel/module/delete_module/delete_module03.c | 4 +- .../kernel/module/query_module/query_module01.c | 4 +- .../kernel/module/query_module/query_module02.c | 4 +- .../kernel/module/query_module/query_module03.c | 4 +- testcases/kernel/numa/support_numa.c | 2 +- .../performance_counters/performance_counter01.c | 2 +- testcases/kernel/syscalls/accept/accept01.c | 2 +- testcases/kernel/syscalls/access/access01.c | 2 +- testcases/kernel/syscalls/access/access02.c | 2 +- testcases/kernel/syscalls/access/access03.c | 2 +- testcases/kernel/syscalls/access/access04.c | 2 +- testcases/kernel/syscalls/access/access05.c | 2 +- testcases/kernel/syscalls/add_key/add_key02.c | 2 +- testcases/kernel/syscalls/adjtimex/adjtimex01.c | 2 +- testcases/kernel/syscalls/adjtimex/adjtimex02.c | 2 +- testcases/kernel/syscalls/alarm/alarm01.c | 2 +- testcases/kernel/syscalls/alarm/alarm02.c | 2 +- testcases/kernel/syscalls/alarm/alarm03.c | 4 +- testcases/kernel/syscalls/alarm/alarm05.c | 2 +- testcases/kernel/syscalls/alarm/alarm06.c | 2 +- testcases/kernel/syscalls/alarm/alarm07.c | 2 +- testcases/kernel/syscalls/asyncio/asyncio02.c | 2 +- testcases/kernel/syscalls/bdflush/bdflush01.c | 2 +- testcases/kernel/syscalls/bind/bind01.c | 2 +- testcases/kernel/syscalls/brk/brk01.c | 2 +- .../kernel/syscalls/cacheflush/cacheflush01.c | 2 +- testcases/kernel/syscalls/capget/capget01.c | 2 +- testcases/kernel/syscalls/capget/capget02.c | 2 +- testcases/kernel/syscalls/capset/capset01.c | 2 +- testcases/kernel/syscalls/capset/capset02.c | 2 +- testcases/kernel/syscalls/chdir/chdir01.c | 2 +- testcases/kernel/syscalls/chdir/chdir02.c | 2 +- testcases/kernel/syscalls/chdir/chdir03.c | 2 +- testcases/kernel/syscalls/chdir/chdir04.c | 2 +- testcases/kernel/syscalls/chmod/chmod01.c | 2 +- testcases/kernel/syscalls/chmod/chmod02.c | 4 +- testcases/kernel/syscalls/chmod/chmod03.c | 2 +- testcases/kernel/syscalls/chmod/chmod04.c | 2 +- testcases/kernel/syscalls/chmod/chmod05.c | 2 +- testcases/kernel/syscalls/chmod/chmod06.c | 2 +- testcases/kernel/syscalls/chmod/chmod07.c | 2 +- testcases/kernel/syscalls/chown/chown01.c | 2 +- testcases/kernel/syscalls/chown/chown02.c | 2 +- testcases/kernel/syscalls/chown/chown03.c | 2 +- testcases/kernel/syscalls/chown/chown04.c | 2 +- testcases/kernel/syscalls/chown/chown05.c | 2 +- testcases/kernel/syscalls/chroot/chroot01.c | 2 +- testcases/kernel/syscalls/chroot/chroot02.c | 4 +- testcases/kernel/syscalls/chroot/chroot03.c | 4 +- testcases/kernel/syscalls/chroot/chroot04.c | 4 +- .../kernel/syscalls/clock_getres/clock_getres01.c | 2 +- .../syscalls/clock_nanosleep/clock_nanosleep01.c | 2 +- .../clock_nanosleep2/clock_nanosleep2_01.c | 2 +- testcases/kernel/syscalls/clone/clone01.c | 2 +- testcases/kernel/syscalls/clone/clone02.c | 2 +- testcases/kernel/syscalls/clone/clone03.c | 2 +- testcases/kernel/syscalls/clone/clone04.c | 2 +- testcases/kernel/syscalls/clone/clone05.c | 2 +- testcases/kernel/syscalls/clone/clone06.c | 2 +- testcases/kernel/syscalls/clone/clone07.c | 2 +- testcases/kernel/syscalls/close/close01.c | 2 +- testcases/kernel/syscalls/close/close02.c | 4 +- testcases/kernel/syscalls/close/close08.c | 2 +- testcases/kernel/syscalls/cma/process_vm01.c | 2 +- testcases/kernel/syscalls/cma/process_vm_readv02.c | 2 +- testcases/kernel/syscalls/cma/process_vm_readv03.c | 2 +- .../kernel/syscalls/cma/process_vm_writev02.c | 2 +- testcases/kernel/syscalls/connect/connect01.c | 2 +- testcases/kernel/syscalls/creat/creat01.c | 2 +- testcases/kernel/syscalls/creat/creat03.c | 2 +- testcases/kernel/syscalls/creat/creat04.c | 4 +- testcases/kernel/syscalls/creat/creat05.c | 4 +- testcases/kernel/syscalls/creat/creat06.c | 4 +- testcases/kernel/syscalls/creat/creat07.c | 2 +- testcases/kernel/syscalls/creat/creat09.c | 2 +- testcases/kernel/syscalls/dup/dup01.c | 2 +- testcases/kernel/syscalls/dup/dup02.c | 2 +- testcases/kernel/syscalls/dup/dup03.c | 2 +- testcases/kernel/syscalls/dup/dup04.c | 6 +- testcases/kernel/syscalls/dup/dup05.c | 2 +- testcases/kernel/syscalls/dup2/dup201.c | 2 +- testcases/kernel/syscalls/dup2/dup202.c | 2 +- testcases/kernel/syscalls/dup2/dup203.c | 2 +- testcases/kernel/syscalls/dup2/dup204.c | 2 +- testcases/kernel/syscalls/eventfd/eventfd01.c | 2 +- testcases/kernel/syscalls/eventfd2/eventfd2_02.c | 2 +- testcases/kernel/syscalls/execl/execl01.c | 2 +- testcases/kernel/syscalls/execle/execle01.c | 2 +- testcases/kernel/syscalls/execlp/execlp01.c | 2 +- testcases/kernel/syscalls/execv/execv01.c | 2 +- testcases/kernel/syscalls/execve/execve01.c | 2 +- testcases/kernel/syscalls/execve/execve02.c | 2 +- testcases/kernel/syscalls/execve/execve03.c | 2 +- testcases/kernel/syscalls/execve/execve04.c | 2 +- testcases/kernel/syscalls/execve/execve05.c | 2 +- testcases/kernel/syscalls/execvp/execvp01.c | 2 +- testcases/kernel/syscalls/exit/exit01.c | 2 +- testcases/kernel/syscalls/exit/exit02.c | 4 +- testcases/kernel/syscalls/faccessat/faccessat01.c | 2 +- .../kernel/syscalls/fadvise/posix_fadvise01.c | 2 +- .../kernel/syscalls/fadvise/posix_fadvise02.c | 2 +- .../kernel/syscalls/fadvise/posix_fadvise03.c | 2 +- .../kernel/syscalls/fadvise/posix_fadvise04.c | 2 +- testcases/kernel/syscalls/fallocate/fallocate01.c | 2 +- testcases/kernel/syscalls/fallocate/fallocate02.c | 2 +- testcases/kernel/syscalls/fallocate/fallocate03.c | 4 +- testcases/kernel/syscalls/fchdir/fchdir01.c | 2 +- testcases/kernel/syscalls/fchdir/fchdir02.c | 2 +- testcases/kernel/syscalls/fchdir/fchdir03.c | 2 +- testcases/kernel/syscalls/fchmod/fchmod01.c | 2 +- testcases/kernel/syscalls/fchmod/fchmod02.c | 2 +- testcases/kernel/syscalls/fchmod/fchmod03.c | 2 +- testcases/kernel/syscalls/fchmod/fchmod04.c | 2 +- testcases/kernel/syscalls/fchmod/fchmod05.c | 2 +- testcases/kernel/syscalls/fchmod/fchmod06.c | 2 +- testcases/kernel/syscalls/fchmod/fchmod07.c | 2 +- testcases/kernel/syscalls/fchmodat/fchmodat01.c | 2 +- testcases/kernel/syscalls/fchown/fchown01.c | 2 +- testcases/kernel/syscalls/fchown/fchown02.c | 2 +- testcases/kernel/syscalls/fchown/fchown03.c | 2 +- testcases/kernel/syscalls/fchown/fchown04.c | 2 +- testcases/kernel/syscalls/fchown/fchown05.c | 2 +- testcases/kernel/syscalls/fchownat/fchownat01.c | 2 +- testcases/kernel/syscalls/fcntl/fcntl01.c | 2 +- testcases/kernel/syscalls/fcntl/fcntl02.c | 2 +- testcases/kernel/syscalls/fcntl/fcntl03.c | 2 +- testcases/kernel/syscalls/fcntl/fcntl04.c | 2 +- testcases/kernel/syscalls/fcntl/fcntl05.c | 2 +- testcases/kernel/syscalls/fcntl/fcntl07.c | 2 +- testcases/kernel/syscalls/fcntl/fcntl07B.c | 2 +- testcases/kernel/syscalls/fcntl/fcntl08.c | 2 +- testcases/kernel/syscalls/fcntl/fcntl09.c | 2 +- testcases/kernel/syscalls/fcntl/fcntl10.c | 2 +- testcases/kernel/syscalls/fcntl/fcntl11.c | 4 +- testcases/kernel/syscalls/fcntl/fcntl12.c | 4 +- testcases/kernel/syscalls/fcntl/fcntl13.c | 4 +- testcases/kernel/syscalls/fcntl/fcntl14.c | 4 +- testcases/kernel/syscalls/fcntl/fcntl15.c | 4 +- testcases/kernel/syscalls/fcntl/fcntl16.c | 4 +- testcases/kernel/syscalls/fcntl/fcntl17.c | 4 +- testcases/kernel/syscalls/fcntl/fcntl19.c | 4 +- testcases/kernel/syscalls/fcntl/fcntl20.c | 4 +- testcases/kernel/syscalls/fcntl/fcntl21.c | 4 +- testcases/kernel/syscalls/fcntl/fcntl22.c | 4 +- testcases/kernel/syscalls/fcntl/fcntl23.c | 2 +- testcases/kernel/syscalls/fcntl/fcntl24.c | 2 +- testcases/kernel/syscalls/fcntl/fcntl25.c | 2 +- testcases/kernel/syscalls/fcntl/fcntl26.c | 2 +- testcases/kernel/syscalls/fcntl/fcntl27.c | 2 +- testcases/kernel/syscalls/fcntl/fcntl28.c | 2 +- testcases/kernel/syscalls/fdatasync/fdatasync01.c | 4 +- testcases/kernel/syscalls/fdatasync/fdatasync02.c | 4 +- testcases/kernel/syscalls/flock/flock01.c | 4 +- testcases/kernel/syscalls/flock/flock02.c | 2 +- testcases/kernel/syscalls/flock/flock03.c | 2 +- testcases/kernel/syscalls/flock/flock04.c | 2 +- testcases/kernel/syscalls/flock/flock05.c | 4 +- testcases/kernel/syscalls/flock/flock06.c | 4 +- testcases/kernel/syscalls/fork/fork01.c | 2 +- testcases/kernel/syscalls/fork/fork02.c | 2 +- testcases/kernel/syscalls/fork/fork03.c | 2 +- testcases/kernel/syscalls/fork/fork04.c | 2 +- testcases/kernel/syscalls/fork/fork06.c | 2 +- testcases/kernel/syscalls/fork/fork07.c | 2 +- testcases/kernel/syscalls/fork/fork08.c | 2 +- testcases/kernel/syscalls/fork/fork09.c | 2 +- testcases/kernel/syscalls/fork/fork10.c | 2 +- testcases/kernel/syscalls/fork/fork11.c | 2 +- testcases/kernel/syscalls/fork/fork12.c | 2 +- testcases/kernel/syscalls/fork/fork13.c | 2 +- testcases/kernel/syscalls/fpathconf/fpathconf01.c | 2 +- testcases/kernel/syscalls/fstat/fstat01.c | 2 +- testcases/kernel/syscalls/fstat/fstat02.c | 2 +- testcases/kernel/syscalls/fstat/fstat03.c | 2 +- testcases/kernel/syscalls/fstat/fstat04.c | 2 +- testcases/kernel/syscalls/fstat/fstat05.c | 2 +- testcases/kernel/syscalls/fstatat/fstatat01.c | 2 +- testcases/kernel/syscalls/fstatfs/fstatfs01.c | 2 +- testcases/kernel/syscalls/fstatfs/fstatfs02.c | 2 +- testcases/kernel/syscalls/fsync/fsync01.c | 2 +- testcases/kernel/syscalls/fsync/fsync02.c | 2 +- testcases/kernel/syscalls/fsync/fsync03.c | 2 +- testcases/kernel/syscalls/ftruncate/ftruncate01.c | 2 +- testcases/kernel/syscalls/ftruncate/ftruncate02.c | 2 +- testcases/kernel/syscalls/futimesat/futimesat01.c | 2 +- .../syscalls/get_mempolicy/get_mempolicy01.c | 2 +- .../syscalls/get_robust_list/get_robust_list01.c | 2 +- .../kernel/syscalls/getcontext/getcontext01.c | 2 +- testcases/kernel/syscalls/getcpu/getcpu01.c | 4 +- testcases/kernel/syscalls/getcwd/getcwd01.c | 2 +- testcases/kernel/syscalls/getcwd/getcwd02.c | 2 +- testcases/kernel/syscalls/getcwd/getcwd03.c | 2 +- testcases/kernel/syscalls/getdents/getdents01.c | 2 +- testcases/kernel/syscalls/getdents/getdents02.c | 2 +- testcases/kernel/syscalls/getdents/getdents03.c | 2 +- testcases/kernel/syscalls/getdents/getdents04.c | 2 +- .../syscalls/getdomainname/getdomainname01.c | 2 +- testcases/kernel/syscalls/getegid/getegid01.c | 2 +- testcases/kernel/syscalls/getegid/getegid02.c | 4 +- testcases/kernel/syscalls/geteuid/geteuid01.c | 2 +- testcases/kernel/syscalls/getgid/getgid01.c | 2 +- testcases/kernel/syscalls/getgid/getgid03.c | 4 +- testcases/kernel/syscalls/getgroups/getgroups01.c | 2 +- testcases/kernel/syscalls/getgroups/getgroups02.c | 2 +- testcases/kernel/syscalls/getgroups/getgroups03.c | 2 +- testcases/kernel/syscalls/getgroups/getgroups04.c | 2 +- testcases/kernel/syscalls/gethostid/gethostid01.c | 2 +- .../kernel/syscalls/gethostname/gethostname01.c | 2 +- testcases/kernel/syscalls/getitimer/getitimer01.c | 4 +- testcases/kernel/syscalls/getitimer/getitimer02.c | 4 +- testcases/kernel/syscalls/getitimer/getitimer03.c | 4 +- .../kernel/syscalls/getpagesize/getpagesize01.c | 2 +- .../kernel/syscalls/getpeername/getpeername01.c | 2 +- testcases/kernel/syscalls/getpgid/getpgid01.c | 2 +- testcases/kernel/syscalls/getpgid/getpgid02.c | 4 +- testcases/kernel/syscalls/getpgrp/getpgrp01.c | 2 +- testcases/kernel/syscalls/getpid/getpid01.c | 2 +- testcases/kernel/syscalls/getpid/getpid02.c | 2 +- testcases/kernel/syscalls/getppid/getppid01.c | 2 +- testcases/kernel/syscalls/getppid/getppid02.c | 2 +- .../kernel/syscalls/getpriority/getpriority01.c | 2 +- .../kernel/syscalls/getpriority/getpriority02.c | 2 +- testcases/kernel/syscalls/getresgid/getresgid01.c | 2 +- testcases/kernel/syscalls/getresgid/getresgid02.c | 2 +- testcases/kernel/syscalls/getresgid/getresgid03.c | 2 +- testcases/kernel/syscalls/getresuid/getresuid01.c | 2 +- testcases/kernel/syscalls/getresuid/getresuid02.c | 2 +- testcases/kernel/syscalls/getresuid/getresuid03.c | 2 +- testcases/kernel/syscalls/getrlimit/getrlimit01.c | 2 +- testcases/kernel/syscalls/getrlimit/getrlimit02.c | 2 +- testcases/kernel/syscalls/getrusage/getrusage01.c | 2 +- testcases/kernel/syscalls/getrusage/getrusage02.c | 2 +- testcases/kernel/syscalls/getrusage/getrusage03.c | 2 +- .../kernel/syscalls/getrusage/getrusage03_child.c | 2 +- testcases/kernel/syscalls/getrusage/getrusage04.c | 2 +- testcases/kernel/syscalls/getsid/getsid01.c | 4 +- testcases/kernel/syscalls/getsid/getsid02.c | 2 +- .../kernel/syscalls/getsockname/getsockname01.c | 2 +- .../kernel/syscalls/getsockopt/getsockopt01.c | 2 +- testcases/kernel/syscalls/gettid/gettid01.c | 2 +- .../kernel/syscalls/gettimeofday/gettimeofday01.c | 4 +- testcases/kernel/syscalls/getuid/getuid01.c | 2 +- testcases/kernel/syscalls/getuid/getuid02.c | 2 +- testcases/kernel/syscalls/getuid/getuid03.c | 2 +- testcases/kernel/syscalls/getxattr/getxattr01.c | 2 +- testcases/kernel/syscalls/getxattr/getxattr02.c | 2 +- testcases/kernel/syscalls/getxattr/getxattr03.c | 2 +- testcases/kernel/syscalls/inotify/inotify01.c | 36 +++--- testcases/kernel/syscalls/inotify/inotify02.c | 62 +++++----- testcases/kernel/syscalls/inotify/inotify03.c | 18 ++-- testcases/kernel/syscalls/inotify/inotify04.c | 40 +++--- .../syscalls/inotify_init/inotify_init1_01.c | 2 +- .../syscalls/inotify_init/inotify_init1_02.c | 2 +- testcases/kernel/syscalls/io_cancel/io_cancel01.c | 2 +- .../kernel/syscalls/io_destroy/io_destroy01.c | 2 +- .../kernel/syscalls/io_getevents/io_getevents01.c | 2 +- testcases/kernel/syscalls/io_setup/io_setup01.c | 2 +- testcases/kernel/syscalls/io_submit/io_submit01.c | 2 +- testcases/kernel/syscalls/ioctl/ioctl01.c | 2 +- testcases/kernel/syscalls/ioctl/ioctl02.c | 2 +- testcases/kernel/syscalls/ioperm/ioperm01.c | 2 +- testcases/kernel/syscalls/ioperm/ioperm02.c | 2 +- testcases/kernel/syscalls/iopl/iopl01.c | 2 +- testcases/kernel/syscalls/iopl/iopl02.c | 2 +- testcases/kernel/syscalls/ipc/msgctl/msgctl01.c | 4 +- testcases/kernel/syscalls/ipc/msgctl/msgctl02.c | 4 +- testcases/kernel/syscalls/ipc/msgctl/msgctl04.c | 4 +- testcases/kernel/syscalls/ipc/msgctl/msgctl05.c | 4 +- testcases/kernel/syscalls/ipc/msgget/msgget01.c | 4 +- testcases/kernel/syscalls/ipc/msgget/msgget02.c | 4 +- testcases/kernel/syscalls/ipc/msgget/msgget03.c | 4 +- testcases/kernel/syscalls/ipc/msgget/msgget04.c | 4 +- testcases/kernel/syscalls/ipc/msgrcv/msgrcv01.c | 4 +- testcases/kernel/syscalls/ipc/msgrcv/msgrcv02.c | 4 +- testcases/kernel/syscalls/ipc/msgrcv/msgrcv03.c | 4 +- testcases/kernel/syscalls/ipc/msgrcv/msgrcv04.c | 4 +- testcases/kernel/syscalls/ipc/msgrcv/msgrcv05.c | 2 +- testcases/kernel/syscalls/ipc/msgrcv/msgrcv06.c | 4 +- testcases/kernel/syscalls/ipc/msgsnd/msgsnd01.c | 4 +- testcases/kernel/syscalls/ipc/msgsnd/msgsnd02.c | 4 +- testcases/kernel/syscalls/ipc/msgsnd/msgsnd03.c | 4 +- testcases/kernel/syscalls/ipc/msgsnd/msgsnd04.c | 4 +- testcases/kernel/syscalls/ipc/msgsnd/msgsnd05.c | 4 +- testcases/kernel/syscalls/ipc/msgsnd/msgsnd06.c | 4 +- testcases/kernel/syscalls/ipc/semctl/semctl01.c | 4 +- testcases/kernel/syscalls/ipc/semctl/semctl02.c | 4 +- testcases/kernel/syscalls/ipc/semctl/semctl03.c | 4 +- testcases/kernel/syscalls/ipc/semctl/semctl04.c | 4 +- testcases/kernel/syscalls/ipc/semctl/semctl05.c | 4 +- testcases/kernel/syscalls/ipc/semget/semget01.c | 4 +- testcases/kernel/syscalls/ipc/semget/semget02.c | 4 +- testcases/kernel/syscalls/ipc/semget/semget03.c | 4 +- testcases/kernel/syscalls/ipc/semget/semget05.c | 4 +- testcases/kernel/syscalls/ipc/semget/semget06.c | 4 +- testcases/kernel/syscalls/ipc/semop/semop01.c | 4 +- testcases/kernel/syscalls/ipc/semop/semop02.c | 4 +- testcases/kernel/syscalls/ipc/semop/semop03.c | 4 +- testcases/kernel/syscalls/ipc/semop/semop04.c | 4 +- testcases/kernel/syscalls/ipc/semop/semop05.c | 4 +- testcases/kernel/syscalls/ipc/shmat/shmat01.c | 4 +- testcases/kernel/syscalls/ipc/shmat/shmat02.c | 2 +- testcases/kernel/syscalls/ipc/shmat/shmat03.c | 4 +- testcases/kernel/syscalls/ipc/shmctl/shmctl01.c | 4 +- testcases/kernel/syscalls/ipc/shmctl/shmctl02.c | 4 +- testcases/kernel/syscalls/ipc/shmctl/shmctl03.c | 4 +- testcases/kernel/syscalls/ipc/shmctl/shmctl04.c | 4 +- testcases/kernel/syscalls/ipc/shmdt/shmdt01.c | 4 +- testcases/kernel/syscalls/ipc/shmdt/shmdt02.c | 4 +- testcases/kernel/syscalls/ipc/shmget/shmget01.c | 4 +- testcases/kernel/syscalls/ipc/shmget/shmget02.c | 4 +- testcases/kernel/syscalls/ipc/shmget/shmget03.c | 4 +- testcases/kernel/syscalls/ipc/shmget/shmget04.c | 4 +- testcases/kernel/syscalls/ipc/shmget/shmget05.c | 4 +- testcases/kernel/syscalls/keyctl/keyctl01.c | 2 +- testcases/kernel/syscalls/kill/kill01.c | 4 +- testcases/kernel/syscalls/kill/kill02.c | 6 +- testcases/kernel/syscalls/kill/kill03.c | 4 +- testcases/kernel/syscalls/kill/kill04.c | 4 +- testcases/kernel/syscalls/kill/kill05.c | 2 +- testcases/kernel/syscalls/kill/kill06.c | 4 +- testcases/kernel/syscalls/kill/kill07.c | 4 +- testcases/kernel/syscalls/kill/kill08.c | 4 +- testcases/kernel/syscalls/kill/kill09.c | 2 +- testcases/kernel/syscalls/kill/kill10.c | 2 +- testcases/kernel/syscalls/lchown/lchown01.c | 2 +- testcases/kernel/syscalls/lchown/lchown02.c | 2 +- testcases/kernel/syscalls/link/link02.c | 2 +- testcases/kernel/syscalls/link/link03.c | 4 +- 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/linkat01.c | 2 +- testcases/kernel/syscalls/listen/listen01.c | 2 +- testcases/kernel/syscalls/llseek/llseek01.c | 2 +- testcases/kernel/syscalls/llseek/llseek02.c | 2 +- testcases/kernel/syscalls/lseek/lseek01.c | 4 +- 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/lseek07.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/lstat01.c | 2 +- testcases/kernel/syscalls/lstat/lstat02.c | 2 +- testcases/kernel/syscalls/lstat/lstat03.c | 2 +- testcases/kernel/syscalls/madvise/madvise01.c | 79 +++---------- testcases/kernel/syscalls/madvise/madvise02.c | 129 +++++++------------- testcases/kernel/syscalls/madvise/madvise03.c | 19 ++-- testcases/kernel/syscalls/madvise/madvise04.c | 7 +- testcases/kernel/syscalls/mallopt/mallopt01.c | 2 +- testcases/kernel/syscalls/mbind/mbind01.c | 2 +- .../syscalls/migrate_pages/migrate_pages01.c | 2 +- .../syscalls/migrate_pages/migrate_pages02.c | 2 +- testcases/kernel/syscalls/mincore/mincore01.c | 4 +- testcases/kernel/syscalls/mkdir/mkdir01.c | 2 +- testcases/kernel/syscalls/mkdir/mkdir02.c | 2 +- testcases/kernel/syscalls/mkdir/mkdir03.c | 2 +- testcases/kernel/syscalls/mkdir/mkdir04.c | 2 +- testcases/kernel/syscalls/mkdir/mkdir05.c | 2 +- testcases/kernel/syscalls/mkdir/mkdir08.c | 2 +- testcases/kernel/syscalls/mkdirat/mkdirat01.c | 2 +- testcases/kernel/syscalls/mknod/mknod01.c | 2 +- testcases/kernel/syscalls/mknod/mknod02.c | 2 +- testcases/kernel/syscalls/mknod/mknod03.c | 2 +- testcases/kernel/syscalls/mknod/mknod04.c | 2 +- testcases/kernel/syscalls/mknod/mknod05.c | 2 +- testcases/kernel/syscalls/mknod/mknod06.c | 2 +- testcases/kernel/syscalls/mknod/mknod07.c | 2 +- testcases/kernel/syscalls/mknod/mknod08.c | 2 +- testcases/kernel/syscalls/mknod/mknod09.c | 2 +- testcases/kernel/syscalls/mknodat/mknodat01.c | 2 +- testcases/kernel/syscalls/mlock/mlock01.c | 2 +- testcases/kernel/syscalls/mlock/mlock02.c | 2 +- testcases/kernel/syscalls/mlockall/mlockall01.c | 2 +- testcases/kernel/syscalls/mlockall/mlockall02.c | 2 +- testcases/kernel/syscalls/mlockall/mlockall03.c | 2 +- testcases/kernel/syscalls/mmap/mmap001.c | 2 +- testcases/kernel/syscalls/mmap/mmap01.c | 2 +- testcases/kernel/syscalls/mmap/mmap02.c | 2 +- testcases/kernel/syscalls/mmap/mmap03.c | 2 +- testcases/kernel/syscalls/mmap/mmap04.c | 2 +- testcases/kernel/syscalls/mmap/mmap05.c | 2 +- testcases/kernel/syscalls/mmap/mmap06.c | 2 +- testcases/kernel/syscalls/mmap/mmap07.c | 2 +- testcases/kernel/syscalls/mmap/mmap08.c | 2 +- testcases/kernel/syscalls/mmap/mmap09.c | 2 +- testcases/kernel/syscalls/mmap/mmap10.c | 2 +- testcases/kernel/syscalls/mmap/mmap11.c | 2 +- .../kernel/syscalls/modify_ldt/modify_ldt01.c | 4 +- .../kernel/syscalls/modify_ldt/modify_ldt02.c | 4 +- testcases/kernel/syscalls/mount/mount01.c | 2 +- testcases/kernel/syscalls/mount/mount02.c | 2 +- testcases/kernel/syscalls/mount/mount03.c | 2 +- testcases/kernel/syscalls/mount/mount04.c | 2 +- .../kernel/syscalls/move_pages/move_pages01.c | 4 +- .../kernel/syscalls/move_pages/move_pages02.c | 4 +- .../kernel/syscalls/move_pages/move_pages03.c | 4 +- .../kernel/syscalls/move_pages/move_pages04.c | 4 +- .../kernel/syscalls/move_pages/move_pages05.c | 4 +- .../kernel/syscalls/move_pages/move_pages06.c | 4 +- .../kernel/syscalls/move_pages/move_pages07.c | 4 +- .../kernel/syscalls/move_pages/move_pages08.c | 4 +- .../kernel/syscalls/move_pages/move_pages09.c | 4 +- .../kernel/syscalls/move_pages/move_pages10.c | 4 +- .../kernel/syscalls/move_pages/move_pages11.c | 4 +- testcases/kernel/syscalls/mprotect/mprotect01.c | 4 +- testcases/kernel/syscalls/mprotect/mprotect02.c | 2 +- testcases/kernel/syscalls/mprotect/mprotect03.c | 4 +- testcases/kernel/syscalls/mq_notify/mq_notify01.c | 2 +- testcases/kernel/syscalls/mq_open/mq_open01.c | 2 +- .../syscalls/mq_timedreceive/mq_timedreceive01.c | 2 +- .../kernel/syscalls/mq_timedsend/mq_timedsend01.c | 2 +- testcases/kernel/syscalls/mq_unlink/mq_unlink01.c | 2 +- testcases/kernel/syscalls/mremap/mremap01.c | 2 +- testcases/kernel/syscalls/mremap/mremap02.c | 2 +- testcases/kernel/syscalls/mremap/mremap03.c | 2 +- testcases/kernel/syscalls/mremap/mremap04.c | 2 +- testcases/kernel/syscalls/mremap/mremap05.c | 2 +- testcases/kernel/syscalls/msync/msync01.c | 2 +- testcases/kernel/syscalls/msync/msync02.c | 2 +- testcases/kernel/syscalls/msync/msync03.c | 2 +- testcases/kernel/syscalls/msync/msync04.c | 2 +- testcases/kernel/syscalls/msync/msync05.c | 2 +- testcases/kernel/syscalls/munlock/munlock01.c | 2 +- testcases/kernel/syscalls/munlock/munlock02.c | 2 +- .../kernel/syscalls/munlockall/munlockall01.c | 2 +- .../kernel/syscalls/munlockall/munlockall02.c | 2 +- testcases/kernel/syscalls/munmap/munmap01.c | 2 +- testcases/kernel/syscalls/munmap/munmap02.c | 2 +- testcases/kernel/syscalls/munmap/munmap03.c | 2 +- testcases/kernel/syscalls/nanosleep/nanosleep01.c | 2 +- testcases/kernel/syscalls/nanosleep/nanosleep02.c | 2 +- testcases/kernel/syscalls/nanosleep/nanosleep03.c | 2 +- testcases/kernel/syscalls/nanosleep/nanosleep04.c | 2 +- testcases/kernel/syscalls/newuname/newuname01.c | 2 +- testcases/kernel/syscalls/nice/nice01.c | 2 +- testcases/kernel/syscalls/nice/nice02.c | 2 +- testcases/kernel/syscalls/nice/nice03.c | 2 +- testcases/kernel/syscalls/nice/nice04.c | 2 +- testcases/kernel/syscalls/nice/nice05.c | 2 +- testcases/kernel/syscalls/open/open01.c | 2 +- testcases/kernel/syscalls/open/open02.c | 2 +- testcases/kernel/syscalls/open/open03.c | 2 +- testcases/kernel/syscalls/open/open04.c | 2 +- testcases/kernel/syscalls/open/open05.c | 4 +- testcases/kernel/syscalls/open/open06.c | 2 +- testcases/kernel/syscalls/open/open07.c | 2 +- testcases/kernel/syscalls/open/open08.c | 2 +- testcases/kernel/syscalls/openat/openat01.c | 2 +- testcases/kernel/syscalls/pathconf/pathconf01.c | 2 +- testcases/kernel/syscalls/pause/pause01.c | 2 +- testcases/kernel/syscalls/pause/pause02.c | 2 +- testcases/kernel/syscalls/pause/pause03.c | 2 +- .../kernel/syscalls/personality/personality01.c | 4 +- .../kernel/syscalls/personality/personality02.c | 4 +- testcases/kernel/syscalls/pipe/pipe01.c | 4 +- testcases/kernel/syscalls/pipe/pipe02.c | 4 +- testcases/kernel/syscalls/pipe/pipe03.c | 4 +- testcases/kernel/syscalls/pipe/pipe04.c | 4 +- testcases/kernel/syscalls/pipe/pipe05.c | 4 +- testcases/kernel/syscalls/pipe/pipe06.c | 4 +- testcases/kernel/syscalls/pipe/pipe07.c | 4 +- testcases/kernel/syscalls/pipe/pipe08.c | 4 +- testcases/kernel/syscalls/pipe/pipe09.c | 4 +- testcases/kernel/syscalls/pipe/pipe10.c | 4 +- testcases/kernel/syscalls/pipe/pipe11.c | 4 +- testcases/kernel/syscalls/pipe2/pipe2_01.c | 2 +- testcases/kernel/syscalls/pipe2/pipe2_02.c | 2 +- testcases/kernel/syscalls/poll/poll01.c | 2 +- testcases/kernel/syscalls/prctl/prctl01.c | 2 +- testcases/kernel/syscalls/prctl/prctl02.c | 2 +- testcases/kernel/syscalls/pread/pread01.c | 4 +- testcases/kernel/syscalls/pread/pread02.c | 2 +- testcases/kernel/syscalls/pread/pread03.c | 4 +- testcases/kernel/syscalls/ptrace/ptrace01.c | 2 +- testcases/kernel/syscalls/ptrace/ptrace02.c | 2 +- testcases/kernel/syscalls/ptrace/ptrace03.c | 2 +- testcases/kernel/syscalls/pwrite/pwrite01.c | 2 +- testcases/kernel/syscalls/pwrite/pwrite02.c | 2 +- testcases/kernel/syscalls/pwrite/pwrite03.c | 2 +- testcases/kernel/syscalls/quotactl/quotactl01.c | 2 +- testcases/kernel/syscalls/read/read01.c | 2 +- testcases/kernel/syscalls/read/read02.c | 4 +- testcases/kernel/syscalls/read/read03.c | 4 +- testcases/kernel/syscalls/read/read04.c | 2 +- testcases/kernel/syscalls/readahead/readahead01.c | 2 +- testcases/kernel/syscalls/readahead/readahead02.c | 2 +- testcases/kernel/syscalls/readdir/readdir01.c | 2 +- testcases/kernel/syscalls/readdir/readdir02.c | 2 +- testcases/kernel/syscalls/readlink/readlink01.c | 2 +- testcases/kernel/syscalls/readlink/readlink02.c | 2 +- testcases/kernel/syscalls/readlink/readlink03.c | 2 +- testcases/kernel/syscalls/readlink/readlink04.c | 2 +- .../kernel/syscalls/readlinkat/readlinkat01.c | 2 +- testcases/kernel/syscalls/readv/readv01.c | 4 +- testcases/kernel/syscalls/readv/readv02.c | 4 +- testcases/kernel/syscalls/readv/readv03.c | 4 +- testcases/kernel/syscalls/reboot/reboot01.c | 2 +- testcases/kernel/syscalls/reboot/reboot02.c | 2 +- testcases/kernel/syscalls/recv/recv01.c | 2 +- testcases/kernel/syscalls/recvfrom/recvfrom01.c | 2 +- testcases/kernel/syscalls/recvmsg/recvmsg01.c | 2 +- .../syscalls/remap_file_pages/remap_file_pages01.c | 2 +- .../syscalls/remap_file_pages/remap_file_pages02.c | 2 +- testcases/kernel/syscalls/rename/rename01.c | 2 +- testcases/kernel/syscalls/rename/rename02.c | 2 +- testcases/kernel/syscalls/rename/rename03.c | 2 +- testcases/kernel/syscalls/rename/rename04.c | 2 +- testcases/kernel/syscalls/rename/rename05.c | 2 +- testcases/kernel/syscalls/rename/rename06.c | 2 +- testcases/kernel/syscalls/rename/rename07.c | 2 +- testcases/kernel/syscalls/rename/rename08.c | 2 +- testcases/kernel/syscalls/rename/rename09.c | 2 +- testcases/kernel/syscalls/rename/rename10.c | 2 +- testcases/kernel/syscalls/rename/rename12.c | 2 +- testcases/kernel/syscalls/rename/rename13.c | 2 +- testcases/kernel/syscalls/renameat/renameat01.c | 2 +- testcases/kernel/syscalls/rmdir/rmdir01.c | 2 +- testcases/kernel/syscalls/rmdir/rmdir02.c | 2 +- testcases/kernel/syscalls/rmdir/rmdir03.c | 2 +- testcases/kernel/syscalls/rmdir/rmdir04.c | 2 +- testcases/kernel/syscalls/rmdir/rmdir05.c | 2 +- .../kernel/syscalls/rt_sigaction/rt_sigaction01.c | 2 +- .../kernel/syscalls/rt_sigaction/rt_sigaction02.c | 2 +- .../kernel/syscalls/rt_sigaction/rt_sigaction03.c | 2 +- .../syscalls/rt_sigprocmask/rt_sigprocmask01.c | 4 +- .../syscalls/rt_sigprocmask/rt_sigprocmask02.c | 2 +- .../syscalls/rt_sigqueueinfo/rt_sigqueueinfo01.c | 2 +- .../syscalls/rt_sigsuspend/rt_sigsuspend01.c | 2 +- testcases/kernel/syscalls/sbrk/sbrk01.c | 2 +- .../sched_get_priority_max01.c | 2 +- .../sched_get_priority_max02.c | 2 +- .../sched_get_priority_min01.c | 2 +- .../sched_get_priority_min02.c | 2 +- .../sched_getaffinity/sched_getaffinity01.c | 2 +- .../syscalls/sched_getparam/sched_getparam01.c | 2 +- .../syscalls/sched_getparam/sched_getparam02.c | 2 +- .../syscalls/sched_getparam/sched_getparam03.c | 4 +- .../sched_getscheduler/sched_getscheduler01.c | 2 +- .../sched_getscheduler/sched_getscheduler02.c | 4 +- .../sched_rr_get_interval01.c | 2 +- .../sched_rr_get_interval02.c | 2 +- .../sched_rr_get_interval03.c | 2 +- .../syscalls/sched_setparam/sched_setparam01.c | 2 +- .../syscalls/sched_setparam/sched_setparam02.c | 2 +- .../syscalls/sched_setparam/sched_setparam03.c | 2 +- .../syscalls/sched_setparam/sched_setparam04.c | 4 +- .../syscalls/sched_setparam/sched_setparam05.c | 2 +- .../sched_setscheduler/sched_setscheduler01.c | 4 +- .../sched_setscheduler/sched_setscheduler02.c | 4 +- .../kernel/syscalls/sched_yield/sched_yield01.c | 4 +- testcases/kernel/syscalls/select/select01.c | 2 +- testcases/kernel/syscalls/select/select02.c | 2 +- testcases/kernel/syscalls/select/select03.c | 2 +- testcases/kernel/syscalls/send/send01.c | 2 +- testcases/kernel/syscalls/sendfile/sendfile02.c | 2 +- testcases/kernel/syscalls/sendfile/sendfile03.c | 2 +- testcases/kernel/syscalls/sendfile/sendfile04.c | 2 +- testcases/kernel/syscalls/sendfile/sendfile05.c | 2 +- testcases/kernel/syscalls/sendfile/sendfile06.c | 2 +- testcases/kernel/syscalls/sendfile/sendfile07.c | 2 +- testcases/kernel/syscalls/sendmsg/sendmsg01.c | 2 +- testcases/kernel/syscalls/sendto/sendto01.c | 2 +- .../syscalls/set_robust_list/set_robust_list01.c | 2 +- .../syscalls/set_tid_address/set_tid_address01.c | 2 +- .../syscalls/setdomainname/setdomainname01.c | 2 +- .../syscalls/setdomainname/setdomainname02.c | 4 +- .../syscalls/setdomainname/setdomainname03.c | 2 +- testcases/kernel/syscalls/setfsgid/setfsgid01.c | 4 +- testcases/kernel/syscalls/setfsgid/setfsgid02.c | 4 +- testcases/kernel/syscalls/setfsgid/setfsgid03.c | 4 +- testcases/kernel/syscalls/setfsuid/setfsuid01.c | 4 +- testcases/kernel/syscalls/setfsuid/setfsuid02.c | 4 +- testcases/kernel/syscalls/setfsuid/setfsuid03.c | 4 +- testcases/kernel/syscalls/setfsuid/setfsuid04.c | 2 +- testcases/kernel/syscalls/setgid/setgid01.c | 2 +- testcases/kernel/syscalls/setgid/setgid02.c | 4 +- testcases/kernel/syscalls/setgid/setgid03.c | 4 +- testcases/kernel/syscalls/setgroups/setgroups01.c | 2 +- testcases/kernel/syscalls/setgroups/setgroups02.c | 2 +- testcases/kernel/syscalls/setgroups/setgroups03.c | 2 +- testcases/kernel/syscalls/setgroups/setgroups04.c | 2 +- .../kernel/syscalls/sethostname/sethostname01.c | 2 +- .../kernel/syscalls/sethostname/sethostname02.c | 2 +- .../kernel/syscalls/sethostname/sethostname03.c | 2 +- testcases/kernel/syscalls/setitimer/setitimer01.c | 4 +- testcases/kernel/syscalls/setitimer/setitimer02.c | 4 +- testcases/kernel/syscalls/setitimer/setitimer03.c | 4 +- testcases/kernel/syscalls/setpgid/setpgid01.c | 2 +- testcases/kernel/syscalls/setpgid/setpgid02.c | 4 +- testcases/kernel/syscalls/setpgid/setpgid03.c | 4 +- testcases/kernel/syscalls/setpgrp/setpgrp01.c | 2 +- testcases/kernel/syscalls/setpgrp/setpgrp02.c | 4 +- .../kernel/syscalls/setpriority/setpriority01.c | 4 +- .../kernel/syscalls/setpriority/setpriority02.c | 4 +- .../kernel/syscalls/setpriority/setpriority03.c | 4 +- .../kernel/syscalls/setpriority/setpriority04.c | 4 +- .../kernel/syscalls/setpriority/setpriority05.c | 4 +- testcases/kernel/syscalls/setregid/setregid01.c | 2 +- testcases/kernel/syscalls/setregid/setregid02.c | 4 +- testcases/kernel/syscalls/setregid/setregid03.c | 4 +- testcases/kernel/syscalls/setregid/setregid04.c | 4 +- testcases/kernel/syscalls/setresgid/setresgid01.c | 4 +- testcases/kernel/syscalls/setresgid/setresgid02.c | 4 +- testcases/kernel/syscalls/setresgid/setresgid03.c | 4 +- testcases/kernel/syscalls/setresuid/setresuid01.c | 4 +- testcases/kernel/syscalls/setresuid/setresuid02.c | 4 +- testcases/kernel/syscalls/setresuid/setresuid03.c | 4 +- testcases/kernel/syscalls/setresuid/setresuid04.c | 6 +- testcases/kernel/syscalls/setreuid/setreuid01.c | 2 +- testcases/kernel/syscalls/setreuid/setreuid02.c | 4 +- testcases/kernel/syscalls/setreuid/setreuid03.c | 4 +- testcases/kernel/syscalls/setreuid/setreuid04.c | 4 +- testcases/kernel/syscalls/setreuid/setreuid05.c | 4 +- testcases/kernel/syscalls/setreuid/setreuid06.c | 4 +- testcases/kernel/syscalls/setreuid/setreuid07.c | 6 +- testcases/kernel/syscalls/setrlimit/setrlimit01.c | 4 +- testcases/kernel/syscalls/setrlimit/setrlimit02.c | 2 +- testcases/kernel/syscalls/setrlimit/setrlimit03.c | 2 +- testcases/kernel/syscalls/setsid/setsid01.c | 4 +- .../kernel/syscalls/setsockopt/setsockopt01.c | 2 +- .../kernel/syscalls/settimeofday/settimeofday01.c | 4 +- .../kernel/syscalls/settimeofday/settimeofday02.c | 4 +- testcases/kernel/syscalls/setuid/setuid01.c | 2 +- testcases/kernel/syscalls/setuid/setuid02.c | 2 +- testcases/kernel/syscalls/setuid/setuid03.c | 4 +- testcases/kernel/syscalls/setuid/setuid04.c | 4 +- testcases/kernel/syscalls/setxattr/setxattr01.c | 2 +- testcases/kernel/syscalls/setxattr/setxattr02.c | 2 +- testcases/kernel/syscalls/setxattr/setxattr03.c | 2 +- testcases/kernel/syscalls/sgetmask/sgetmask01.c | 2 +- testcases/kernel/syscalls/sigaction/sigaction01.c | 4 +- .../kernel/syscalls/sigaltstack/sigaltstack01.c | 4 +- .../kernel/syscalls/sigaltstack/sigaltstack02.c | 4 +- testcases/kernel/syscalls/sighold/sighold02.c | 6 +- testcases/kernel/syscalls/signal/signal01.c | 18 ++-- testcases/kernel/syscalls/signal/signal02.c | 6 +- testcases/kernel/syscalls/signal/signal03.c | 4 +- testcases/kernel/syscalls/signal/signal04.c | 4 +- testcases/kernel/syscalls/signal/signal05.c | 4 +- testcases/kernel/syscalls/signalfd/signalfd01.c | 2 +- testcases/kernel/syscalls/signalfd4/signalfd4_01.c | 2 +- testcases/kernel/syscalls/signalfd4/signalfd4_02.c | 2 +- .../kernel/syscalls/sigpending/sigpending02.c | 2 +- .../kernel/syscalls/sigprocmask/sigprocmask01.c | 4 +- testcases/kernel/syscalls/sigrelse/sigrelse01.c | 2 +- .../kernel/syscalls/sigsuspend/sigsuspend01.c | 4 +- .../kernel/syscalls/sigwaitinfo/sigwaitinfo01.c | 10 +- testcases/kernel/syscalls/socket/socket01.c | 2 +- testcases/kernel/syscalls/socket/socket02.c | 2 +- testcases/kernel/syscalls/socket/socket03.c | 2 +- .../kernel/syscalls/socketcall/socketcall01.c | 2 +- .../kernel/syscalls/socketcall/socketcall02.c | 2 +- .../kernel/syscalls/socketcall/socketcall03.c | 2 +- .../kernel/syscalls/socketcall/socketcall04.c | 2 +- .../kernel/syscalls/socketpair/socketpair01.c | 2 +- testcases/kernel/syscalls/sockioctl/sockioctl01.c | 2 +- testcases/kernel/syscalls/splice/splice01.c | 2 +- testcases/kernel/syscalls/ssetmask/ssetmask01.c | 2 +- testcases/kernel/syscalls/stat/stat01.c | 4 +- testcases/kernel/syscalls/stat/stat02.c | 4 +- testcases/kernel/syscalls/stat/stat03.c | 4 +- testcases/kernel/syscalls/stat/stat05.c | 2 +- testcases/kernel/syscalls/stat/stat06.c | 4 +- testcases/kernel/syscalls/statfs/statfs01.c | 2 +- testcases/kernel/syscalls/statfs/statfs02.c | 2 +- testcases/kernel/syscalls/statfs/statfs03.c | 2 +- testcases/kernel/syscalls/statvfs/statvfs01.c | 2 +- testcases/kernel/syscalls/stime/stime01.c | 2 +- testcases/kernel/syscalls/stime/stime02.c | 4 +- testcases/kernel/syscalls/swapoff/swapoff01.c | 2 +- testcases/kernel/syscalls/swapoff/swapoff02.c | 2 +- testcases/kernel/syscalls/swapon/swapon01.c | 2 +- testcases/kernel/syscalls/swapon/swapon02.c | 2 +- testcases/kernel/syscalls/swapon/swapon03.c | 2 +- testcases/kernel/syscalls/symlink/symlink01.c | 68 +++++----- testcases/kernel/syscalls/symlink/symlink02.c | 2 +- testcases/kernel/syscalls/symlink/symlink03.c | 4 +- testcases/kernel/syscalls/symlink/symlink04.c | 4 +- testcases/kernel/syscalls/symlink/symlink05.c | 4 +- testcases/kernel/syscalls/symlinkat/symlinkat01.c | 2 +- testcases/kernel/syscalls/sync/sync01.c | 2 +- testcases/kernel/syscalls/sync/sync02.c | 4 +- testcases/kernel/syscalls/sysctl/sysctl01.c | 4 +- testcases/kernel/syscalls/sysctl/sysctl03.c | 4 +- testcases/kernel/syscalls/sysctl/sysctl04.c | 4 +- testcases/kernel/syscalls/sysctl/sysctl05.c | 4 +- testcases/kernel/syscalls/sysfs/sysfs01.c | 2 +- testcases/kernel/syscalls/sysfs/sysfs02.c | 2 +- testcases/kernel/syscalls/sysfs/sysfs03.c | 2 +- testcases/kernel/syscalls/sysfs/sysfs04.c | 2 +- testcases/kernel/syscalls/sysfs/sysfs05.c | 2 +- testcases/kernel/syscalls/sysfs/sysfs06.c | 2 +- testcases/kernel/syscalls/sysinfo/sysinfo01.c | 4 +- testcases/kernel/syscalls/sysinfo/sysinfo02.c | 4 +- testcases/kernel/syscalls/syslog/syslog11.c | 4 +- testcases/kernel/syscalls/syslog/syslog12.c | 4 +- testcases/kernel/syscalls/tee/tee01.c | 2 +- testcases/kernel/syscalls/time/time01.c | 2 +- testcases/kernel/syscalls/time/time02.c | 4 +- .../syscalls/timer_getoverrun/timer_getoverrun01.c | 12 +- .../syscalls/timer_gettime/timer_gettime01.c | 16 ++-- testcases/kernel/syscalls/timerfd/timerfd02.c | 2 +- testcases/kernel/syscalls/timerfd/timerfd03.c | 2 +- testcases/kernel/syscalls/times/times01.c | 2 +- testcases/kernel/syscalls/tkill/tkill01.c | 2 +- testcases/kernel/syscalls/truncate/truncate01.c | 4 +- testcases/kernel/syscalls/truncate/truncate02.c | 4 +- testcases/kernel/syscalls/truncate/truncate03.c | 4 +- testcases/kernel/syscalls/truncate/truncate04.c | 2 +- testcases/kernel/syscalls/ulimit/ulimit01.c | 2 +- testcases/kernel/syscalls/umask/umask01.c | 2 +- testcases/kernel/syscalls/umask/umask02.c | 4 +- testcases/kernel/syscalls/umask/umask03.c | 4 +- testcases/kernel/syscalls/umount/umount01.c | 2 +- testcases/kernel/syscalls/umount/umount02.c | 2 +- testcases/kernel/syscalls/umount/umount03.c | 2 +- testcases/kernel/syscalls/uname/uname01.c | 2 +- testcases/kernel/syscalls/uname/uname02.c | 2 +- testcases/kernel/syscalls/uname/uname03.c | 4 +- testcases/kernel/syscalls/unlink/unlink05.c | 2 +- testcases/kernel/syscalls/unlink/unlink06.c | 4 +- testcases/kernel/syscalls/unlink/unlink07.c | 4 +- testcases/kernel/syscalls/unlink/unlink08.c | 6 +- testcases/kernel/syscalls/unlinkat/unlinkat01.c | 2 +- testcases/kernel/syscalls/unshare/unshare01.c | 2 +- testcases/kernel/syscalls/unshare/unshare02.c | 2 +- testcases/kernel/syscalls/ustat/ustat01.c | 2 +- testcases/kernel/syscalls/ustat/ustat02.c | 2 +- testcases/kernel/syscalls/utime/utime01.c | 4 +- testcases/kernel/syscalls/utime/utime02.c | 4 +- testcases/kernel/syscalls/utime/utime03.c | 4 +- testcases/kernel/syscalls/utime/utime04.c | 4 +- testcases/kernel/syscalls/utime/utime05.c | 4 +- testcases/kernel/syscalls/utime/utime06.c | 4 +- testcases/kernel/syscalls/utimes/utimes01.c | 2 +- testcases/kernel/syscalls/vfork/vfork01.c | 4 +- testcases/kernel/syscalls/vfork/vfork02.c | 4 +- testcases/kernel/syscalls/vhangup/vhangup01.c | 4 +- testcases/kernel/syscalls/vhangup/vhangup02.c | 4 +- testcases/kernel/syscalls/vmsplice/vmsplice01.c | 2 +- testcases/kernel/syscalls/wait/wait02.c | 2 +- testcases/kernel/syscalls/wait4/wait401.c | 2 +- testcases/kernel/syscalls/wait4/wait402.c | 2 +- testcases/kernel/syscalls/waitid/waitid01.c | 2 +- testcases/kernel/syscalls/waitid/waitid02.c | 2 +- testcases/kernel/syscalls/waitpid/waitpid01.c | 4 +- testcases/kernel/syscalls/waitpid/waitpid02.c | 4 +- testcases/kernel/syscalls/waitpid/waitpid03.c | 4 +- testcases/kernel/syscalls/waitpid/waitpid04.c | 4 +- testcases/kernel/syscalls/waitpid/waitpid05.c | 4 +- testcases/kernel/syscalls/waitpid/waitpid06.c | 4 +- testcases/kernel/syscalls/waitpid/waitpid07.c | 4 +- testcases/kernel/syscalls/waitpid/waitpid08.c | 4 +- testcases/kernel/syscalls/waitpid/waitpid09.c | 4 +- testcases/kernel/syscalls/waitpid/waitpid10.c | 4 +- testcases/kernel/syscalls/waitpid/waitpid11.c | 2 +- testcases/kernel/syscalls/waitpid/waitpid12.c | 2 +- testcases/kernel/syscalls/waitpid/waitpid13.c | 2 +- testcases/kernel/syscalls/write/write01.c | 2 +- testcases/kernel/syscalls/write/write02.c | 4 +- testcases/kernel/syscalls/write/write03.c | 4 +- testcases/kernel/syscalls/write/write04.c | 4 +- testcases/kernel/syscalls/write/write05.c | 4 +- testcases/kernel/syscalls/writev/writev01.c | 2 +- testcases/kernel/syscalls/writev/writev02.c | 2 +- testcases/kernel/syscalls/writev/writev03.c | 2 +- testcases/kernel/syscalls/writev/writev04.c | 4 +- testcases/kernel/syscalls/writev/writev05.c | 4 +- testcases/kernel/syscalls/writev/writev06.c | 4 +- .../kernel/timers/clock_gettime/clock_gettime02.c | 2 +- .../kernel/timers/clock_gettime/clock_gettime03.c | 2 +- .../kernel/timers/clock_settime/clock_settime02.c | 2 +- .../kernel/timers/clock_settime/clock_settime03.c | 2 +- testcases/kernel/timers/leapsec/leapsec_timer.c | 2 +- .../kernel/timers/timer_create/timer_create02.c | 2 +- .../kernel/timers/timer_create/timer_create03.c | 2 +- .../kernel/timers/timer_create/timer_create04.c | 2 +- .../kernel/timers/timer_delete/timer_delete02.c | 4 +- .../kernel/timers/timer_delete/timer_delete03.c | 2 +- .../kernel/timers/timer_settime/timer_settime02.c | 2 +- .../kernel/timers/timer_settime/timer_settime03.c | 2 +- testcases/misc/crash/crash01.c | 2 +- testcases/misc/crash/crash02.c | 2 +- testcases/misc/tcore_patch_test_suites/tcore.c | 2 +- tools/apicmds/ltpapicmd.c | 18 ++-- 840 files changed, 1342 insertions(+), 1434 deletions(-) diff --git a/doc/examples/quickhit.c b/doc/examples/quickhit.c index 3eabcdb..d662b03 100644 --- a/doc/examples/quickhit.c +++ b/doc/examples/quickhit.c @@ -216,8 +216,8 @@ int main(int ac, char **av) */ for (lc = 0; TEST_LOOPING(lc); lc++) { - /* reset Tst_count in case we are looping. */ - Tst_count = 0; + /* reset tst_count in case we are looping. */ + tst_count = 0; if (Nlinks) nlinks = Nlinks; @@ -292,7 +292,7 @@ int main(int ac, char **av) nlinks, fbuf.st_nlink); } } else - Tst_count++; + tst_count++; /* Here we clean up after the test case so we can do another * iteration. diff --git a/doc/man3/tst_res.3 b/doc/man3/tst_res.3 index 90159aa..0c1fe6c 100644 --- a/doc/man3/tst_res.3 +++ b/doc/man3/tst_res.3 @@ -66,9 +66,9 @@ char *\fItmesg, [arg ...]\fR) .P \fBint tst_environ() .P -\fBextern int Tst_count; +\fBextern int tst_count; .br -extern int Tst_range; +extern int tst_range; .br \fR .SH DESCRIPTION @@ -79,7 +79,7 @@ library have a distinct number of test cases, and that each test case is distinct and uniquely identified by the test case number. It is also assumed that test case results are printed in consecutive order, starting with 1. The library maintains a set of global variables (\fBTCID\fR, \fBTST_TOTAL\fR, -\fBTst_count\fR), which are used by the various functions to format the +\fBtst_count\fR), which are used by the various functions to format the results and to keep track of the current result reporting state (i.e. how many total test cases there are, and how many have been reported so far) for the calling test. @@ -91,7 +91,7 @@ library, and MUST be defined/initialized by tests using the library. reported. .P The other global variables are available as externs to tests linked with -tst_res.o. \fBTst_count\fR is the running count of the number of test +tst_res.o. \fBtst_count\fR is the running count of the number of test results that have been reported so far. The library initializes it to 0, and it should not be modified by the test. The details are described below under the appropriate functions. @@ -156,11 +156,11 @@ correspond to a test case result and does not indicate a problem. \fBtst_res()\fR and \fBtst_resm()\fR are the basic result reporting functions. They report 1 or more test case results of the specified \fIttype\fR. All result types are valid for these functions. The -\fBTst_range\fR global variable indicates the number of results that will be +\fBtst_range\fR global variable indicates the number of results that will be reported for each call to one of these functions. It is initialized by the library to 1, but may be set to a value > 1 by the test. Each call to one of -these functions will result in \fBTst_range\fR test case results being -reported, each with an identical message (\fItmesg\fR). \fBTst_range\fR is +these functions will result in \fBtst_range\fR test case results being +reported, each with an identical message (\fItmesg\fR). \fBtst_range\fR is always reset to 1 by the library before returning to the caller. If \fBtst_res()\fR is called with a \fIfname\fR argument, the contents of the file will only be printed for the first reported result. \fBtst_res()\fR @@ -168,7 +168,7 @@ takes the \fIfname\fR argument whereas \fBtst_resm()\fR does not. .P NOTE: All calls to \fBtst_res()\fR specifying a \fIttype\fR of \fBTWARN\fR or \fBTINFO\fR will be printed with a test case number of zero. Because of -this, a \fBTst_range\fR value > 1 is not valid for these types. +this, a \fBtst_range\fR value > 1 is not valid for these types. .P \fBtst_brk()\fR and \fBtst_brkm()\fR are used to report results for all test cases remaining in the test, and then call a cleanup function. The only @@ -306,7 +306,7 @@ A WARN result message will be printed if any of the following occur: .P If an invalid test type is specified. .P -If \fBTst_count\fR is negative. +If \fBtst_count\fR is negative. .P If one of the \fBtst_brk[m]()\fR routines is called with a test type other than \fBTFAIL, TBROK, TCONF\fR, or \fBTRETR\fR. @@ -319,5 +319,5 @@ will be empty. This allows a test to not print a message for a result, but it is not advised. .SH BUGS .P -The programmer is free to alter the value of \fBTst_count\fR causing possible +The programmer is free to alter the value of \fBtst_count\fR causing possible test result order problems. diff --git a/doc/man3/tst_set_error.3 b/doc/man3/tst_set_error.3 index 29becd3..44f6f26 100644 --- a/doc/man3/tst_set_error.3 +++ b/doc/man3/tst_set_error.3 @@ -33,9 +33,9 @@ .\" .TH TST_SET_ERROR 3 07/25/2000 "Linux Test Project" .SH NAME -tst_set_error \- Sets global Tst_error values +tst_set_error \- Sets global tst_error values .br -tst_clear_error \- clears global Tst_error values +tst_clear_error \- clears global tst_error values .SH SYNOPSIS .nf \fB @@ -56,14 +56,14 @@ tst_clear_error() .SH DESCRIPTION These two functions provide a simple interface to allow a programmer set and clear the global variables in -\fBTst_error\fR defined in \fItest_error.c\fR. +\fBtst_error\fR defined in \fItest_error.c\fR. The purpose of these global variables to provide space for error messages passing. Functions within our library can use this space and these routines to a pass error messages and some debug data to the caller. -\fBTst_error\fR is a global variable, which is really a structure +\fBtst_error\fR is a global variable, which is really a structure of five elements. The structure is defined \fItest.h\fR and looks like: @@ -97,7 +97,7 @@ This does not say that for long error messages, that there can not be newlines in the message. \fBtst_set_error()\fR will not overwrite these global variables if -\fBTst_error.te_level\fR is not zero. +\fBtst_error.te_level\fR is not zero. \fBtst_clear_error()\fR will make all strings zero length and set all integers to zero. @@ -106,7 +106,7 @@ method for determining if there is an error. The functions that use \fBtst_set_error\fR, should provide another way to indicating that an error has occurred. These variables should be used reporting the error message. Although, if you use \fBtst_clear_error()\fR prior to calling any functions -and \fBTst_error.te_mesg\fR[0] != '\0', you know someone reported an error or +and \fBtst_error.te_mesg\fR[0] != '\0', you know someone reported an error or at least used the space. .RE @@ -136,7 +136,7 @@ To access the error information an issue an error messag... [truncated message content] |
From: Cyril H. <su...@li...> - 2013-03-06 15:56:21
|
The branch, master, has been updated via a5cc30c425040cb352aa185993afac0c846f18d4 (commit) from 91706f270eeaa2236e19813d9ed1d52ca2256553 (commit) - Log ----------------------------------------------------------------- commit a5cc30c425040cb352aa185993afac0c846f18d4 Author: Cyril Hrubis <ch...@su...> Date: Wed Mar 6 16:39:03 2013 +0100 syscalls/sysctl03: Change TWARN to TINFO. The TWARN is propagated to the test return value and interpreted as a test (internal) failure, moreover the rest of the testcases seems to use TWARN this way. So this replaces TWARN with TINFO which makes the testcase to PASS. Signed-off-by: Cyril Hrubis <ch...@su...> ----------------------------------------------------------------------- Summary of changes: testcases/kernel/syscalls/sysctl/sysctl03.c | 2 +- 1 files changed, 1 insertions(+), 1 deletions(-) diff --git a/testcases/kernel/syscalls/sysctl/sysctl03.c b/testcases/kernel/syscalls/sysctl/sysctl03.c index 6caaa72..6a2cae8 100644 --- a/testcases/kernel/syscalls/sysctl/sysctl03.c +++ b/testcases/kernel/syscalls/sysctl/sysctl03.c @@ -117,7 +117,7 @@ int main(int ac, char **av) exp_eno = EPERM; } else { /* ^^ Look above this warning. ^^ */ - tst_resm(TWARN, + tst_resm(TINFO, "this test's results are based on potentially undocumented behavior in the kernel. read the NOTE in the source file for more details"); exp_eno = EACCES; exp_enos[0] = EACCES; hooks/post-receive -- ltp |
From: Cyril H. <su...@li...> - 2013-03-05 14:56:37
|
The branch, master, has been updated via 91706f270eeaa2236e19813d9ed1d52ca2256553 (commit) via 0fa47391d4e4a58745b5f4292912815662182ef2 (commit) via a457ec6aff4dd51fda98ed4c2a6fa32128ee11c4 (commit) via fe8ea1d0cd4658e0ef879729dff91292086281f9 (commit) via 16ff905602c086cec2330242b33ca762e6449c8a (commit) via 523015f92f6712a2745d08fe3a14a48f48c0fa50 (commit) via 965a6e9199ca0ecb66919b96a60027f47adfcbda (commit) via 302b3c9cc03b522cedaedc24ce9292f39ba2fa2b (commit) via c588d3d9778d3b177648b627a5bd077b3892e50c (commit) via f662f433c1054d35dc023544fde70a7e3e355827 (commit) via d92aec3a086876ecdb479328ab5e338d7d106e52 (commit) via d9bb6cb68137a003cd3775114f40de65705fe633 (commit) via 7d90b262ef52ed409ad1698eb2bc14fac434c8e7 (commit) via 72cd533a69828ef390b26ffe153cce6cf1d4177a (commit) via 2a196e14614dad6119b55d90195f7cb2f621eba7 (commit) from a3fdf48e1444049ff9185c069c365872892522a0 (commit) - Log ----------------------------------------------------------------- commit 91706f270eeaa2236e19813d9ed1d52ca2256553 Author: Cyril Hrubis <ch...@su...> Date: Tue Mar 5 15:31:01 2013 +0100 openposix/.../aio_fsync: Remove stubs. Remove testcases that just returns UNTESTED. Signed-off-by: Cyril Hrubis <ch...@su...> commit 0fa47391d4e4a58745b5f4292912815662182ef2 Author: Cyril Hrubis <ch...@su...> Date: Tue Mar 5 15:23:45 2013 +0100 openposix/.../aio_write: Remove stubs. Remove testcases that just returns UNTESTED. Signed-off-by: Cyril Hrubis <ch...@su...> commit a457ec6aff4dd51fda98ed4c2a6fa32128ee11c4 Author: Cyril Hrubis <ch...@su...> Date: Tue Mar 5 15:19:46 2013 +0100 openposix/.../mq_send: Remove stub. Remove testcase that just returns UNTESTED. Signed-off-by: Cyril Hrubis <ch...@su...> commit fe8ea1d0cd4658e0ef879729dff91292086281f9 Author: Cyril Hrubis <ch...@su...> Date: Tue Mar 5 15:18:22 2013 +0100 openposix/.../aio_read: Remove stubs. Remove testcases that just returns UNTESTED. Signed-off-by: Cyril Hrubis <ch...@su...> commit 16ff905602c086cec2330242b33ca762e6449c8a Author: Cyril Hrubis <ch...@su...> Date: Tue Mar 5 15:12:35 2013 +0100 openposix/.../sched_getscheduler: Remove stub. Remove testcase that just prints UNTESTED. Signed-off-by: Cyril Hrubis <ch...@su...> commit 523015f92f6712a2745d08fe3a14a48f48c0fa50 Author: Cyril Hrubis <ch...@su...> Date: Tue Mar 5 15:10:40 2013 +0100 openposix/.../shm_open: Remove stubs. Remove testcases that just returns UNTESTED. Signed-off-by: Cyril Hrubis <ch...@su...> commit 965a6e9199ca0ecb66919b96a60027f47adfcbda Author: Cyril Hrubis <ch...@su...> Date: Tue Mar 5 14:51:42 2013 +0100 openposix/.../aio_suspend: Remove stub. Remove testcase that just returns UNTESTED. Signed-off-by: Cyril Hrubis <ch...@su...> commit 302b3c9cc03b522cedaedc24ce9292f39ba2fa2b Author: Cyril Hrubis <ch...@su...> Date: Tue Mar 5 14:50:26 2013 +0100 openposix/.../mq_unlink: Remove stub. Remove testcase that just returns UNTESTED. Signed-off-by: Cyril Hrubis <ch...@su...> commit c588d3d9778d3b177648b627a5bd077b3892e50c Author: Cyril Hrubis <ch...@su...> Date: Tue Mar 5 14:48:43 2013 +0100 openposix/.../mq_close: Remove stub. Remove testcase that just returns UNTESTED. Signed-off-by: Cyril Hrubis <ch...@su...> commit f662f433c1054d35dc023544fde70a7e3e355827 Author: Cyril Hrubis <ch...@su...> Date: Tue Mar 5 14:38:39 2013 +0100 openposix/.../sched_setscheduler: Remove stubs. Remove testcases that just returns UNTESTED. Signed-off-by: Cyril Hrubis <ch...@su...> commit d92aec3a086876ecdb479328ab5e338d7d106e52 Author: Cyril Hrubis <ch...@su...> Date: Tue Mar 5 14:03:46 2013 +0100 openposix/.../mq_timedsend: Remove stubs. Remove testcases that just returns UNTESTED. Signed-off-by: Cyril Hrubis <ch...@su...> commit d9bb6cb68137a003cd3775114f40de65705fe633 Author: Cyril Hrubis <ch...@su...> Date: Tue Mar 5 13:58:57 2013 +0100 openposix/.../timer_getoverrun: Remove stub. Remove testcase that just returns UNTESTED. Signed-off-by: Cyril Hrubis <ch...@su...> commit 7d90b262ef52ed409ad1698eb2bc14fac434c8e7 Author: Cyril Hrubis <ch...@su...> Date: Tue Mar 5 13:56:27 2013 +0100 openposix/.../mq_open: Remove stubs. Remove testcases that just returns UNTESTED. Signed-off-by: Cyril Hrubis <ch...@su...> commit 72cd533a69828ef390b26ffe153cce6cf1d4177a Author: Cyril Hrubis <ch...@su...> Date: Tue Mar 5 12:48:30 2013 +0100 openposix/.../sched_setparam: Remove stubs. Remove testcases that just reuturn UNTESTED. Signed-off-by: Cyril Hrubis <ch...@su...> commit 2a196e14614dad6119b55d90195f7cb2f621eba7 Author: Cyril Hrubis <ch...@su...> Date: Tue Mar 5 12:26:56 2013 +0100 openposix/.../lio_listio/: remove stubs. Remove testcases that just return UNTESTED. Signed-off-by: Cyril Hrubis <ch...@su...> ----------------------------------------------------------------------- Summary of changes: .../conformance/interfaces/aio_fsync/1-1.c | 19 ---------- .../conformance/interfaces/aio_fsync/10-1.c | 33 ----------------- .../conformance/interfaces/aio_fsync/11-1.c | 19 ---------- .../conformance/interfaces/aio_fsync/13-1.c | 19 ---------- .../conformance/interfaces/aio_fsync/6-1.c | 19 ---------- .../conformance/interfaces/aio_fsync/7-1.c | 19 ---------- .../conformance/interfaces/aio_read/12-1.c | 32 ----------------- .../conformance/interfaces/aio_read/13-1.c | 31 ---------------- .../conformance/interfaces/aio_read/14-1.c | 32 ----------------- .../conformance/interfaces/aio_read/15-1.c | 32 ----------------- .../conformance/interfaces/aio_read/2-1.c | 31 ---------------- .../conformance/interfaces/aio_read/6-1.c | 32 ----------------- .../conformance/interfaces/aio_suspend/2-1.c | 31 ---------------- .../conformance/interfaces/aio_write/10-1.c | 32 ----------------- .../conformance/interfaces/aio_write/11-1.c | 32 ----------------- .../conformance/interfaces/aio_write/12-1.c | 31 ---------------- .../conformance/interfaces/aio_write/13-1.c | 32 ----------------- .../conformance/interfaces/lio_listio/16-1.c | 32 ----------------- .../conformance/interfaces/lio_listio/17-1.c | 21 ----------- .../conformance/interfaces/lio_listio/19-1.c | 19 ---------- .../conformance/interfaces/lio_listio/20-1.c | 19 ---------- .../conformance/interfaces/lio_listio/21-1.c | 19 ---------- .../conformance/interfaces/lio_listio/22-1.c | 19 ---------- .../conformance/interfaces/lio_listio/23-1.c | 19 ---------- .../conformance/interfaces/lio_listio/24-1.c | 19 ---------- .../conformance/interfaces/lio_listio/25-1.c | 19 ---------- .../conformance/interfaces/mq_close/5-1.c | 25 ------------- .../conformance/interfaces/mq_open/10-1.c | 32 ----------------- .../conformance/interfaces/mq_open/14-1.c | 22 ------------ .../conformance/interfaces/mq_open/17-1.c | 22 ------------ .../conformance/interfaces/mq_open/22-1.c | 22 ------------ .../conformance/interfaces/mq_open/24-1.c | 23 ------------ .../conformance/interfaces/mq_open/25-1.c | 24 ------------- .../conformance/interfaces/mq_open/28-1.c | 24 ------------- .../conformance/interfaces/mq_open/30-1.c | 24 ------------- .../conformance/interfaces/mq_open/4-1.c | 25 ------------- .../conformance/interfaces/mq_send/6-1.c | 24 ------------- .../conformance/interfaces/mq_timedsend/17-1.c | 21 ----------- .../conformance/interfaces/mq_timedsend/6-1.c | 24 ------------- .../conformance/interfaces/mq_unlink/2-3.c | 24 ------------- .../interfaces/sched_getscheduler/2-1.c | 22 ------------ .../conformance/interfaces/sched_setparam/12-1.c | 35 ------------------ .../conformance/interfaces/sched_setparam/13-1.c | 35 ------------------ .../conformance/interfaces/sched_setparam/14-1.c | 37 -------------------- .../conformance/interfaces/sched_setparam/15-1.c | 37 -------------------- .../conformance/interfaces/sched_setparam/16-1.c | 36 ------------------- .../conformance/interfaces/sched_setparam/17-1.c | 22 ------------ .../conformance/interfaces/sched_setparam/18-1.c | 22 ------------ .../conformance/interfaces/sched_setparam/19-1.c | 22 ------------ .../conformance/interfaces/sched_setparam/3-1.c | 22 ------------ .../conformance/interfaces/sched_setparam/6-1.c | 23 ------------ .../conformance/interfaces/sched_setparam/7-1.c | 23 ------------ .../conformance/interfaces/sched_setparam/8-1.c | 23 ------------ .../interfaces/sched_setscheduler/10-1.c | 28 --------------- .../interfaces/sched_setscheduler/11-1.c | 29 --------------- .../interfaces/sched_setscheduler/12-1.c | 22 ------------ .../interfaces/sched_setscheduler/13-1.c | 22 ------------ .../interfaces/sched_setscheduler/14-1.c | 22 ------------ .../interfaces/sched_setscheduler/2-1.c | 22 ------------ .../interfaces/sched_setscheduler/5-1.c | 23 ------------ .../interfaces/sched_setscheduler/6-1.c | 23 ------------ .../interfaces/sched_setscheduler/7-1.c | 23 ------------ .../interfaces/sched_setscheduler/9-1.c | 35 ------------------ .../conformance/interfaces/shm_open/10-1.c | 21 ----------- .../conformance/interfaces/shm_open/12-1.c | 28 --------------- .../conformance/interfaces/shm_open/19-1.c | 23 ------------ .../conformance/interfaces/shm_open/2-1.c | 23 ------------ .../conformance/interfaces/shm_open/24-1.c | 22 ------------ .../conformance/interfaces/shm_open/27-1.c | 22 ------------ .../conformance/interfaces/shm_open/29-1.c | 22 ------------ .../conformance/interfaces/shm_open/3-1.c | 22 ------------ .../conformance/interfaces/shm_open/36-1.c | 24 ------------- .../conformance/interfaces/shm_open/42-1.c | 22 ------------ .../conformance/interfaces/shm_open/6-1.c | 22 ------------ .../conformance/interfaces/shm_open/7-1.c | 22 ------------ .../conformance/interfaces/shm_open/9-1.c | 21 ----------- .../conformance/interfaces/timer_getoverrun/3-1.c | 26 -------------- 77 files changed, 0 insertions(+), 1926 deletions(-) delete mode 100644 testcases/open_posix_testsuite/conformance/interfaces/aio_fsync/1-1.c delete mode 100644 testcases/open_posix_testsuite/conformance/interfaces/aio_fsync/10-1.c delete mode 100644 testcases/open_posix_testsuite/conformance/interfaces/aio_fsync/11-1.c delete mode 100644 testcases/open_posix_testsuite/conformance/interfaces/aio_fsync/13-1.c delete mode 100644 testcases/open_posix_testsuite/conformance/interfaces/aio_fsync/6-1.c delete mode 100644 testcases/open_posix_testsuite/conformance/interfaces/aio_fsync/7-1.c delete mode 100644 testcases/open_posix_testsuite/conformance/interfaces/aio_read/12-1.c delete mode 100644 testcases/open_posix_testsuite/conformance/interfaces/aio_read/13-1.c delete mode 100644 testcases/open_posix_testsuite/conformance/interfaces/aio_read/14-1.c delete mode 100644 testcases/open_posix_testsuite/conformance/interfaces/aio_read/15-1.c delete mode 100644 testcases/open_posix_testsuite/conformance/interfaces/aio_read/2-1.c delete mode 100644 testcases/open_posix_testsuite/conformance/interfaces/aio_read/6-1.c delete mode 100644 testcases/open_posix_testsuite/conformance/interfaces/aio_suspend/2-1.c delete mode 100644 testcases/open_posix_testsuite/conformance/interfaces/aio_write/10-1.c delete mode 100644 testcases/open_posix_testsuite/conformance/interfaces/aio_write/11-1.c delete mode 100644 testcases/open_posix_testsuite/conformance/interfaces/aio_write/12-1.c delete mode 100644 testcases/open_posix_testsuite/conformance/interfaces/aio_write/13-1.c delete mode 100644 testcases/open_posix_testsuite/conformance/interfaces/lio_listio/16-1.c delete mode 100644 testcases/open_posix_testsuite/conformance/interfaces/lio_listio/17-1.c delete mode 100644 testcases/open_posix_testsuite/conformance/interfaces/lio_listio/19-1.c delete mode 100644 testcases/open_posix_testsuite/conformance/interfaces/lio_listio/20-1.c delete mode 100644 testcases/open_posix_testsuite/conformance/interfaces/lio_listio/21-1.c delete mode 100644 testcases/open_posix_testsuite/conformance/interfaces/lio_listio/22-1.c delete mode 100644 testcases/open_posix_testsuite/conformance/interfaces/lio_listio/23-1.c delete mode 100644 testcases/open_posix_testsuite/conformance/interfaces/lio_listio/24-1.c delete mode 100644 testcases/open_posix_testsuite/conformance/interfaces/lio_listio/25-1.c delete mode 100644 testcases/open_posix_testsuite/conformance/interfaces/mq_close/5-1.c delete mode 100644 testcases/open_posix_testsuite/conformance/interfaces/mq_open/10-1.c delete mode 100644 testcases/open_posix_testsuite/conformance/interfaces/mq_open/14-1.c delete mode 100644 testcases/open_posix_testsuite/conformance/interfaces/mq_open/17-1.c delete mode 100644 testcases/open_posix_testsuite/conformance/interfaces/mq_open/22-1.c delete mode 100644 testcases/open_posix_testsuite/conformance/interfaces/mq_open/24-1.c delete mode 100644 testcases/open_posix_testsuite/conformance/interfaces/mq_open/25-1.c delete mode 100644 testcases/open_posix_testsuite/conformance/interfaces/mq_open/28-1.c delete mode 100644 testcases/open_posix_testsuite/conformance/interfaces/mq_open/30-1.c delete mode 100644 testcases/open_posix_testsuite/conformance/interfaces/mq_open/4-1.c delete mode 100644 testcases/open_posix_testsuite/conformance/interfaces/mq_send/6-1.c delete mode 100644 testcases/open_posix_testsuite/conformance/interfaces/mq_timedsend/17-1.c delete mode 100644 testcases/open_posix_testsuite/conformance/interfaces/mq_timedsend/6-1.c delete mode 100644 testcases/open_posix_testsuite/conformance/interfaces/mq_unlink/2-3.c delete mode 100644 testcases/open_posix_testsuite/conformance/interfaces/sched_getscheduler/2-1.c delete mode 100644 testcases/open_posix_testsuite/conformance/interfaces/sched_setparam/12-1.c delete mode 100644 testcases/open_posix_testsuite/conformance/interfaces/sched_setparam/13-1.c delete mode 100644 testcases/open_posix_testsuite/conformance/interfaces/sched_setparam/14-1.c delete mode 100644 testcases/open_posix_testsuite/conformance/interfaces/sched_setparam/15-1.c delete mode 100644 testcases/open_posix_testsuite/conformance/interfaces/sched_setparam/16-1.c delete mode 100644 testcases/open_posix_testsuite/conformance/interfaces/sched_setparam/17-1.c delete mode 100644 testcases/open_posix_testsuite/conformance/interfaces/sched_setparam/18-1.c delete mode 100644 testcases/open_posix_testsuite/conformance/interfaces/sched_setparam/19-1.c delete mode 100644 testcases/open_posix_testsuite/conformance/interfaces/sched_setparam/3-1.c delete mode 100644 testcases/open_posix_testsuite/conformance/interfaces/sched_setparam/6-1.c delete mode 100644 testcases/open_posix_testsuite/conformance/interfaces/sched_setparam/7-1.c delete mode 100644 testcases/open_posix_testsuite/conformance/interfaces/sched_setparam/8-1.c delete mode 100644 testcases/open_posix_testsuite/conformance/interfaces/sched_setscheduler/10-1.c delete mode 100644 testcases/open_posix_testsuite/conformance/interfaces/sched_setscheduler/11-1.c delete mode 100644 testcases/open_posix_testsuite/conformance/interfaces/sched_setscheduler/12-1.c delete mode 100644 testcases/open_posix_testsuite/conformance/interfaces/sched_setscheduler/13-1.c delete mode 100644 testcases/open_posix_testsuite/conformance/interfaces/sched_setscheduler/14-1.c delete mode 100644 testcases/open_posix_testsuite/conformance/interfaces/sched_setscheduler/2-1.c delete mode 100644 testcases/open_posix_testsuite/conformance/interfaces/sched_setscheduler/5-1.c delete mode 100644 testcases/open_posix_testsuite/conformance/interfaces/sched_setscheduler/6-1.c delete mode 100644 testcases/open_posix_testsuite/conformance/interfaces/sched_setscheduler/7-1.c delete mode 100644 testcases/open_posix_testsuite/conformance/interfaces/sched_setscheduler/9-1.c delete mode 100644 testcases/open_posix_testsuite/conformance/interfaces/shm_open/10-1.c delete mode 100644 testcases/open_posix_testsuite/conformance/interfaces/shm_open/12-1.c delete mode 100644 testcases/open_posix_testsuite/conformance/interfaces/shm_open/19-1.c delete mode 100644 testcases/open_posix_testsuite/conformance/interfaces/shm_open/2-1.c delete mode 100644 testcases/open_posix_testsuite/conformance/interfaces/shm_open/24-1.c delete mode 100644 testcases/open_posix_testsuite/conformance/interfaces/shm_open/27-1.c delete mode 100644 testcases/open_posix_testsuite/conformance/interfaces/shm_open/29-1.c delete mode 100644 testcases/open_posix_testsuite/conformance/interfaces/shm_open/3-1.c delete mode 100644 testcases/open_posix_testsuite/conformance/interfaces/shm_open/36-1.c delete mode 100644 testcases/open_posix_testsuite/conformance/interfaces/shm_open/42-1.c delete mode 100644 testcases/open_posix_testsuite/conformance/interfaces/shm_open/6-1.c delete mode 100644 testcases/open_posix_testsuite/conformance/interfaces/shm_open/7-1.c delete mode 100644 testcases/open_posix_testsuite/conformance/interfaces/shm_open/9-1.c delete mode 100644 testcases/open_posix_testsuite/conformance/interfaces/timer_getoverrun/3-1.c diff --git a/testcases/open_posix_testsuite/conformance/interfaces/aio_fsync/1-1.c b/testcases/open_posix_testsuite/conformance/interfaces/aio_fsync/1-1.c deleted file mode 100644 index 79f4caf..0000000 --- a/testcases/open_posix_testsuite/conformance/interfaces/aio_fsync/1-1.c +++ /dev/null @@ -1,19 +0,0 @@ -/* - * Copyright (c) 2004, Bull SA. All rights reserved. - * Created by: Lau...@bu... - * This file is licensed under the GPL license. For the full content - * of this license, see the COPYING file at the top level of this - * source tree. - */ - -#define _XOPEN_SOURCE 600 -#include <stdlib.h> -#include <unistd.h> -#include "posixtest.h" - -int main() -{ - if (sysconf(_SC_ASYNCHRONOUS_IO) < 200112L) - exit(PTS_UNSUPPORTED); - exit(PTS_UNTESTED); -} diff --git a/testcases/open_posix_testsuite/conformance/interfaces/aio_fsync/10-1.c b/testcases/open_posix_testsuite/conformance/interfaces/aio_fsync/10-1.c deleted file mode 100644 index 8c6b07c..0000000 --- a/testcases/open_posix_testsuite/conformance/interfaces/aio_fsync/10-1.c +++ /dev/null @@ -1,33 +0,0 @@ -/* - * Copyright (c) 2004, Bull SA. All rights reserved. - * Created by: Lau...@bu... - * This file is licensed under the GPL license. For the full content - * of this license, see the COPYING file at the top level of this - * source tree. - */ - -/* - * assertion: - * - * aio_fsync() shall asynchronously force I/O operations associated - * with aio_fildes. - * - * method: - * - * UNTESTED - * - * We are not able to check if I/O operations have been forced. - * - */ - -#define _XOPEN_SOURCE 600 -#include <stdlib.h> -#include <unistd.h> -#include "posixtest.h" - -int main() -{ - if (sysconf(_SC_ASYNCHRONOUS_IO) < 200112L) - exit(PTS_UNSUPPORTED); - exit(PTS_UNTESTED); -} diff --git a/testcases/open_posix_testsuite/conformance/interfaces/aio_fsync/11-1.c b/testcases/open_posix_testsuite/conformance/interfaces/aio_fsync/11-1.c deleted file mode 100644 index 79f4caf..0000000 --- a/testcases/open_posix_testsuite/conformance/interfaces/aio_fsync/11-1.c +++ /dev/null @@ -1,19 +0,0 @@ -/* - * Copyright (c) 2004, Bull SA. All rights reserved. - * Created by: Lau...@bu... - * This file is licensed under the GPL license. For the full content - * of this license, see the COPYING file at the top level of this - * source tree. - */ - -#define _XOPEN_SOURCE 600 -#include <stdlib.h> -#include <unistd.h> -#include "posixtest.h" - -int main() -{ - if (sysconf(_SC_ASYNCHRONOUS_IO) < 200112L) - exit(PTS_UNSUPPORTED); - exit(PTS_UNTESTED); -} diff --git a/testcases/open_posix_testsuite/conformance/interfaces/aio_fsync/13-1.c b/testcases/open_posix_testsuite/conformance/interfaces/aio_fsync/13-1.c deleted file mode 100644 index 79f4caf..0000000 --- a/testcases/open_posix_testsuite/conformance/interfaces/aio_fsync/13-1.c +++ /dev/null @@ -1,19 +0,0 @@ -/* - * Copyright (c) 2004, Bull SA. All rights reserved. - * Created by: Lau...@bu... - * This file is licensed under the GPL license. For the full content - * of this license, see the COPYING file at the top level of this - * source tree. - */ - -#define _XOPEN_SOURCE 600 -#include <stdlib.h> -#include <unistd.h> -#include "posixtest.h" - -int main() -{ - if (sysconf(_SC_ASYNCHRONOUS_IO) < 200112L) - exit(PTS_UNSUPPORTED); - exit(PTS_UNTESTED); -} diff --git a/testcases/open_posix_testsuite/conformance/interfaces/aio_fsync/6-1.c b/testcases/open_posix_testsuite/conformance/interfaces/aio_fsync/6-1.c deleted file mode 100644 index 79f4caf..0000000 --- a/testcases/open_posix_testsuite/conformance/interfaces/aio_fsync/6-1.c +++ /dev/null @@ -1,19 +0,0 @@ -/* - * Copyright (c) 2004, Bull SA. All rights reserved. - * Created by: Lau...@bu... - * This file is licensed under the GPL license. For the full content - * of this license, see the COPYING file at the top level of this - * source tree. - */ - -#define _XOPEN_SOURCE 600 -#include <stdlib.h> -#include <unistd.h> -#include "posixtest.h" - -int main() -{ - if (sysconf(_SC_ASYNCHRONOUS_IO) < 200112L) - exit(PTS_UNSUPPORTED); - exit(PTS_UNTESTED); -} diff --git a/testcases/open_posix_testsuite/conformance/interfaces/aio_fsync/7-1.c b/testcases/open_posix_testsuite/conformance/interfaces/aio_fsync/7-1.c deleted file mode 100644 index 79f4caf..0000000 --- a/testcases/open_posix_testsuite/conformance/interfaces/aio_fsync/7-1.c +++ /dev/null @@ -1,19 +0,0 @@ -/* - * Copyright (c) 2004, Bull SA. All rights reserved. - * Created by: Lau...@bu... - * This file is licensed under the GPL license. For the full content - * of this license, see the COPYING file at the top level of this - * source tree. - */ - -#define _XOPEN_SOURCE 600 -#include <stdlib.h> -#include <unistd.h> -#include "posixtest.h" - -int main() -{ - if (sysconf(_SC_ASYNCHRONOUS_IO) < 200112L) - exit(PTS_UNSUPPORTED); - exit(PTS_UNTESTED); -} diff --git a/testcases/open_posix_testsuite/conformance/interfaces/aio_read/12-1.c b/testcases/open_posix_testsuite/conformance/interfaces/aio_read/12-1.c deleted file mode 100644 index 17e0675..0000000 --- a/testcases/open_posix_testsuite/conformance/interfaces/aio_read/12-1.c +++ /dev/null @@ -1,32 +0,0 @@ -/* - * Copyright (c) 2004, Bull SA. All rights reserved. - * Created by: Lau...@bu... - * This file is licensed under the GPL license. For the full content - * of this license, see the COPYING file at the top level of this - * source tree. - */ - -/* - * assertion: - * - * The error status of a succesfully queued operation shall be: - * [EBADF] if the aio_fildes argument is not a valid file descriptor open for - * reading. - * - * method: - * - * UNTESTED - * - */ - -#define _XOPEN_SOURCE 600 -#include <stdlib.h> -#include <unistd.h> -#include "posixtest.h" - -int main() -{ - if (sysconf(_SC_ASYNCHRONOUS_IO) < 200112L) - exit(PTS_UNSUPPORTED); - exit(PTS_UNTESTED); -} diff --git a/testcases/open_posix_testsuite/conformance/interfaces/aio_read/13-1.c b/testcases/open_posix_testsuite/conformance/interfaces/aio_read/13-1.c deleted file mode 100644 index a9a5a8c..0000000 --- a/testcases/open_posix_testsuite/conformance/interfaces/aio_read/13-1.c +++ /dev/null @@ -1,31 +0,0 @@ -/* - * Copyright (c) 2004, Bull SA. All rights reserved. - * Created by: Lau...@bu... - * This file is licensed under the GPL license. For the full content - * of this license, see the COPYING file at the top level of this - * source tree. - */ - -/* - * assertion: - * - * The error status of a succesfully queued operation shall be: - * [ECANCELED] if The requested I/O was canceled before the I/O completed. - * - * method: - * - * UNTESTED - * - */ - -#define _XOPEN_SOURCE 600 -#include <stdlib.h> -#include <unistd.h> -#include "posixtest.h" - -int main() -{ - if (sysconf(_SC_ASYNCHRONOUS_IO) < 200112L) - exit(PTS_UNSUPPORTED); - exit(PTS_UNTESTED); -} diff --git a/testcases/open_posix_testsuite/conformance/interfaces/aio_read/14-1.c b/testcases/open_posix_testsuite/conformance/interfaces/aio_read/14-1.c deleted file mode 100644 index 83ac9df..0000000 --- a/testcases/open_posix_testsuite/conformance/interfaces/aio_read/14-1.c +++ /dev/null @@ -1,32 +0,0 @@ -/* - * Copyright (c) 2004, Bull SA. All rights reserved. - * Created by: Lau...@bu... - * This file is licensed under the GPL license. For the full content - * of this license, see the COPYING file at the top level of this - * source tree. - */ - -/* - * assertion: - * - * The error status of a succesfully queued operation shall be: - * [EINVAL] if aio_offset would be invalid, or aio_reqprio is not a valid - * value, or aio_nbytes is an invalid value. - * - * method: - * - * UNTESTED - * - */ - -#define _XOPEN_SOURCE 600 -#include <stdlib.h> -#include <unistd.h> -#include "posixtest.h" - -int main() -{ - if (sysconf(_SC_ASYNCHRONOUS_IO) < 200112L) - exit(PTS_UNSUPPORTED); - exit(PTS_UNTESTED); -} diff --git a/testcases/open_posix_testsuite/conformance/interfaces/aio_read/15-1.c b/testcases/open_posix_testsuite/conformance/interfaces/aio_read/15-1.c deleted file mode 100644 index 151bbdf..0000000 --- a/testcases/open_posix_testsuite/conformance/interfaces/aio_read/15-1.c +++ /dev/null @@ -1,32 +0,0 @@ -/* - * Copyright (c) 2004, Bull SA. All rights reserved. - * Created by: Lau...@bu... - * This file is licensed under the GPL license. For the full content - * of this license, see the COPYING file at the top level of this - * source tree. - */ - -/* - * assertion: - * - * aio_read() shall fail with: - * [EOVERFLOW] if aio_nbytes is greater than 0, aio_offset is before EOF - * and is at or beyond the offset maximum associated with aio_fildes. - * - * method: - * - * UNTESTED - * - */ - -#define _XOPEN_SOURCE 600 -#include <stdlib.h> -#include <unistd.h> -#include "posixtest.h" - -int main() -{ - if (sysconf(_SC_ASYNCHRONOUS_IO) < 200112L) - exit(PTS_UNSUPPORTED); - exit(PTS_UNTESTED); -} diff --git a/testcases/open_posix_testsuite/conformance/interfaces/aio_read/2-1.c b/testcases/open_posix_testsuite/conformance/interfaces/aio_read/2-1.c deleted file mode 100644 index 913af48..0000000 --- a/testcases/open_posix_testsuite/conformance/interfaces/aio_read/2-1.c +++ /dev/null @@ -1,31 +0,0 @@ -/* - * Copyright (c) 2004, Bull SA. All rights reserved. - * Created by: Lau...@bu... - * This file is licensed under the GPL license. For the full content - * of this license, see the COPYING file at the top level of this - * source tree. - */ - -/* - * assertion: - * - * If prioritized I/O is supported asynchronous operation shall be - * submitted at priority equal to a base schedulling priority minus - * aio_reqprio. - * - * method: - * - */ - -#define _XOPEN_SOURCE 600 -#include <stdlib.h> -#include <unistd.h> -#include "posixtest.h" - -int main() -{ - if (sysconf(_SC_ASYNCHRONOUS_IO) != 200112L || - sysconf(_SC_PRIORITIZED_IO) < 200112L) - exit(PTS_UNSUPPORTED); - exit(PTS_UNTESTED); -} diff --git a/testcases/open_posix_testsuite/conformance/interfaces/aio_read/6-1.c b/testcases/open_posix_testsuite/conformance/interfaces/aio_read/6-1.c deleted file mode 100644 index 4bbbafb..0000000 --- a/testcases/open_posix_testsuite/conformance/interfaces/aio_read/6-1.c +++ /dev/null @@ -1,32 +0,0 @@ -/* - * Copyright (c) 2004, Bull SA. All rights reserved. - * Created by: Lau...@bu... - * This file is licensed under the GPL license. For the full content - * of this license, see the COPYING file at the top level of this - * source tree. - */ - -/* - * assertion: - * - * For regular files, no data transfer shall occur past the offset - * maximum established in the open file description associated with - * aio_fildes. - * - * method: - * - * UNTESTED - * - */ - -#define _XOPEN_SOURCE 600 -#include <stdlib.h> -#include <unistd.h> -#include "posixtest.h" - -int main() -{ - if (sysconf(_SC_ASYNCHRONOUS_IO) < 200112L) - exit(PTS_UNSUPPORTED); - exit(PTS_UNTESTED); -} diff --git a/testcases/open_posix_testsuite/conformance/interfaces/aio_suspend/2-1.c b/testcases/open_posix_testsuite/conformance/interfaces/aio_suspend/2-1.c deleted file mode 100644 index de8c23a..0000000 --- a/testcases/open_posix_testsuite/conformance/interfaces/aio_suspend/2-1.c +++ /dev/null @@ -1,31 +0,0 @@ -/* - * Copyright (c) 2004, Bull SA. All rights reserved. - * Created by: Lau...@bu... - * This file is licensed under the GPL license. For the full content - * of this license, see the COPYING file at the top level of this - * source tree. - */ - -/* - * assertion: - * - * If any of the aiocb structures in the list correspond to a completed - * AIO, the aio_suspend() shall return without suspending. - * - * method: - * - * UNTESTED - * - */ - -#define _XOPEN_SOURCE 600 -#include <stdlib.h> -#include <unistd.h> -#include "posixtest.h" - -int main() -{ - if (sysconf(_SC_ASYNCHRONOUS_IO) < 200112L) - exit(PTS_UNSUPPORTED); - exit(PTS_UNTESTED); -} diff --git a/testcases/open_posix_testsuite/conformance/interfaces/aio_write/10-1.c b/testcases/open_posix_testsuite/conformance/interfaces/aio_write/10-1.c deleted file mode 100644 index f95616a..0000000 --- a/testcases/open_posix_testsuite/conformance/interfaces/aio_write/10-1.c +++ /dev/null @@ -1,32 +0,0 @@ -/* - * Copyright (c) 2004, Bull SA. All rights reserved. - * Created by: Lau...@bu... - * This file is licensed under the GPL license. For the full content - * of this license, see the COPYING file at the top level of this - * source tree. - */ - -/* - * assertion: - * - * The error status of a succesfully queued operation shall be: - * [EBADF] if the aio_fildes argument is not a valid file descriptor open for - * writing. - * - * method: - * - * UNTESTED - * - */ - -#define _XOPEN_SOURCE 600 -#include <stdlib.h> -#include <unistd.h> -#include "posixtest.h" - -int main() -{ - if (sysconf(_SC_ASYNCHRONOUS_IO) < 200112L) - exit(PTS_UNSUPPORTED); - exit(PTS_UNTESTED); -} diff --git a/testcases/open_posix_testsuite/conformance/interfaces/aio_write/11-1.c b/testcases/open_posix_testsuite/conformance/interfaces/aio_write/11-1.c deleted file mode 100644 index 0a70486..0000000 --- a/testcases/open_posix_testsuite/conformance/interfaces/aio_write/11-1.c +++ /dev/null @@ -1,32 +0,0 @@ -/* - * Copyright (c) 2004, Bull SA. All rights reserved. - * Created by: Lau...@bu... - * This file is licensed under the GPL license. For the full content - * of this license, see the COPYING file at the top level of this - * source tree. - */ - -/* - * assertion: - * - * The error status of a succesfully queued operation shall be: - * [EINVAL] if aio_offset would be invalid, or aio_reqprio is not a valid - * value, or aio_nbytes is an invalid value. - * - * method: - * - * UNTESTED - * - */ - -#define _XOPEN_SOURCE 600 -#include <stdlib.h> -#include <unistd.h> -#include "posixtest.h" - -int main() -{ - if (sysconf(_SC_ASYNCHRONOUS_IO) < 200112L) - exit(PTS_UNSUPPORTED); - exit(PTS_UNTESTED); -} diff --git a/testcases/open_posix_testsuite/conformance/interfaces/aio_write/12-1.c b/testcases/open_posix_testsuite/conformance/interfaces/aio_write/12-1.c deleted file mode 100644 index d639564..0000000 --- a/testcases/open_posix_testsuite/conformance/interfaces/aio_write/12-1.c +++ /dev/null @@ -1,31 +0,0 @@ -/* - * Copyright (c) 2004, Bull SA. All rights reserved. - * Created by: Lau...@bu... - * This file is licensed under the GPL license. For the full content - * of this license, see the COPYING file at the top level of this - * source tree. - */ - -/* - * assertion: - * - * The error status of a succesfully queued operation shall be: - [ECANCELED] The requested I/O was canceled before the I/O completed. - * - * method: - * - * UNTESTED - * - */ - -#define _XOPEN_SOURCE 600 -#include <stdlib.h> -#include <unistd.h> -#include "posixtest.h" - -int main() -{ - if (sysconf(_SC_ASYNCHRONOUS_IO) < 200112L) - exit(PTS_UNSUPPORTED); - exit(PTS_UNTESTED); -} diff --git a/testcases/open_posix_testsuite/conformance/interfaces/aio_write/13-1.c b/testcases/open_posix_testsuite/conformance/interfaces/aio_write/13-1.c deleted file mode 100644 index cd1e29f..0000000 --- a/testcases/open_posix_testsuite/conformance/interfaces/aio_write/13-1.c +++ /dev/null @@ -1,32 +0,0 @@ -/* - * Copyright (c) 2004, Bull SA. All rights reserved. - * Created by: Lau...@bu... - * This file is licensed under the GPL license. For the full content - * of this license, see the COPYING file at the top level of this - * source tree. - */ - -/* - * assertion: - * - * aio_write() shall fail or the error status of the operation shall be [EFBIG]: - * if aio_nbytes is greater than 0 and aio_offset is at or beyond the - * offset maximum of aio_fildes. - * - * method: - * - * UNTESTED - * - */ - -#define _XOPEN_SOURCE 600 -#include <stdlib.h> -#include <unistd.h> -#include "posixtest.h" - -int main() -{ - if (sysconf(_SC_ASYNCHRONOUS_IO) < 200112L) - exit(PTS_UNSUPPORTED); - exit(PTS_UNTESTED); -} diff --git a/testcases/open_posix_testsuite/conformance/interfaces/lio_listio/16-1.c b/testcases/open_posix_testsuite/conformance/interfaces/lio_listio/16-1.c deleted file mode 100644 index 232edad..0000000 --- a/testcases/open_posix_testsuite/conformance/interfaces/lio_listio/16-1.c +++ /dev/null @@ -1,32 +0,0 @@ -/* - * Copyright (c) 2004, Bull SA. All rights reserved. - * Created by: Lau...@bu... - * This file is licensed under the GPL license. For the full content - * of this license, see the COPYING file at the top level of this - * source tree. - */ - -/* - * assertion: - * - * lio_listio() shall fail if: - * [EAGAIN] The resource necessary to queue all the I/O request were not - * available. - * - * method: - * - * UNTESTED - * - */ - -#define _XOPEN_SOURCE 600 -#include <stdlib.h> -#include <unistd.h> -#include "posixtest.h" - -int main(void) -{ - if (sysconf(_SC_ASYNCHRONOUS_IO) < 200112L) - exit(PTS_UNSUPPORTED); - exit(PTS_UNTESTED); -} diff --git a/testcases/open_posix_testsuite/conformance/interfaces/lio_listio/17-1.c b/testcases/open_posix_testsuite/conformance/interfaces/lio_listio/17-1.c deleted file mode 100644 index 9a34a9c..0000000 --- a/testcases/open_posix_testsuite/conformance/interfaces/lio_listio/17-1.c +++ /dev/null @@ -1,21 +0,0 @@ -/* - * Copyright (c) 2004, Bull SA. All rights reserved. - * Created by: Lau...@bu... - * This file is licensed under the GPL license. For the full content - * of this license, see the COPYING file at the top level of this - * source tree. - */ - -#define _XOPEN_SOURCE 600 -#include <aio.h> -#include <stdio.h> -#include <stdlib.h> -#include <unistd.h> -#include "posixtest.h" - -int main() -{ - if (sysconf(_SC_ASYNCHRONOUS_IO) < 200112L) - exit(PTS_UNSUPPORTED); - exit(PTS_UNTESTED); -} diff --git a/testcases/open_posix_testsuite/conformance/interfaces/lio_listio/19-1.c b/testcases/open_posix_testsuite/conformance/interfaces/lio_listio/19-1.c deleted file mode 100644 index fc82293..0000000 --- a/testcases/open_posix_testsuite/conformance/interfaces/lio_listio/19-1.c +++ /dev/null @@ -1,19 +0,0 @@ -/* - * Copyright (c) 2004, Bull SA. All rights reserved. - * Created by: Lau...@bu... - * This file is licensed under the GPL license. For the full content - * of this license, see the COPYING file at the top level of this - * source tree. - */ - -#define _XOPEN_SOURCE 600 -#include <stdlib.h> -#include <unistd.h> -#include "posixtest.h" - -int main(void) -{ - if (sysconf(_SC_ASYNCHRONOUS_IO) < 200112L) - exit(PTS_UNSUPPORTED); - exit(PTS_UNTESTED); -} diff --git a/testcases/open_posix_testsuite/conformance/interfaces/lio_listio/20-1.c b/testcases/open_posix_testsuite/conformance/interfaces/lio_listio/20-1.c deleted file mode 100644 index 79f4caf..0000000 --- a/testcases/open_posix_testsuite/conformance/interfaces/lio_listio/20-1.c +++ /dev/null @@ -1,19 +0,0 @@ -/* - * Copyright (c) 2004, Bull SA. All rights reserved. - * Created by: Lau...@bu... - * This file is licensed under the GPL license. For the full content - * of this license, see the COPYING file at the top level of this - * source tree. - */ - -#define _XOPEN_SOURCE 600 -#include <stdlib.h> -#include <unistd.h> -#include "posixtest.h" - -int main() -{ - if (sysconf(_SC_ASYNCHRONOUS_IO) < 200112L) - exit(PTS_UNSUPPORTED); - exit(PTS_UNTESTED); -} diff --git a/testcases/open_posix_testsuite/conformance/interfaces/lio_listio/21-1.c b/testcases/open_posix_testsuite/conformance/interfaces/lio_listio/21-1.c deleted file mode 100644 index 79f4caf..0000000 --- a/testcases/open_posix_testsuite/conformance/interfaces/lio_listio/21-1.c +++ /dev/null @@ -1,19 +0,0 @@ -/* - * Copyright (c) 2004, Bull SA. All rights reserved. - * Created by: Lau...@bu... - * This file is licensed under the GPL license. For the full content - * of this license, see the COPYING file at the top level of this - * source tree. - */ - -#define _XOPEN_SOURCE 600 -#include <stdlib.h> -#include <unistd.h> -#include "posixtest.h" - -int main() -{ - if (sysconf(_SC_ASYNCHRONOUS_IO) < 200112L) - exit(PTS_UNSUPPORTED); - exit(PTS_UNTESTED); -} diff --git a/testcases/open_posix_testsuite/conformance/interfaces/lio_listio/22-1.c b/testcases/open_posix_testsuite/conformance/interfaces/lio_listio/22-1.c deleted file mode 100644 index 79f4caf..0000000 --- a/testcases/open_posix_testsuite/conformance/interfaces/lio_listio/22-1.c +++ /dev/null @@ -1,19 +0,0 @@ -/* - * Copyright (c) 2004, Bull SA. All rights reserved. - * Created by: Lau...@bu... - * This file is licensed under the GPL license. For the full content - * of this license, see the COPYING file at the top level of this - * source tree. - */ - -#define _XOPEN_SOURCE 600 -#include <stdlib.h> -#include <unistd.h> -#include "posixtest.h" - -int main() -{ - if (sysconf(_SC_ASYNCHRONOUS_IO) < 200112L) - exit(PTS_UNSUPPORTED); - exit(PTS_UNTESTED); -} diff --git a/testcases/open_posix_testsuite/conformance/interfaces/lio_listio/23-1.c b/testcases/open_posix_testsuite/conformance/interfaces/lio_listio/23-1.c deleted file mode 100644 index 79f4caf..0000000 --- a/testcases/open_posix_testsuite/conformance/interfaces/lio_listio/23-1.c +++ /dev/null @@ -1,19 +0,0 @@ -/* - * Copyright (c) 2004, Bull SA. All rights reserved. - * Created by: Lau...@bu... - * This file is licensed under the GPL license. For the full content - * of this license, see the COPYING file at the top level of this - * source tree. - */ - -#define _XOPEN_SOURCE 600 -#include <stdlib.h> -#include <unistd.h> -#include "posixtest.h" - -int main() -{ - if (sysconf(_SC_ASYNCHRONOUS_IO) < 200112L) - exit(PTS_UNSUPPORTED); - exit(PTS_UNTESTED); -} diff --git a/testcases/open_posix_testsuite/conformance/interfaces/lio_listio/24-1.c b/testcases/open_posix_testsuite/conformance/interfaces/lio_listio/24-1.c deleted file mode 100644 index 79f4caf..0000000 --- a/testcases/open_posix_testsuite/conformance/interfaces/lio_listio/24-1.c +++ /dev/null @@ -1,19 +0,0 @@ -/* - * Copyright (c) 2004, Bull SA. All rights reserved. - * Created by: Lau...@bu... - * This file is licensed under the GPL license. For the full content - * of this license, see the COPYING file at the top level of this - * source tree. - */ - -#define _XOPEN_SOURCE 600 -#include <stdlib.h> -#include <unistd.h> -#include "posixtest.h" - -int main() -{ - if (sysconf(_SC_ASYNCHRONOUS_IO) < 200112L) - exit(PTS_UNSUPPORTED); - exit(PTS_UNTESTED); -} diff --git a/testcases/open_posix_testsuite/conformance/interfaces/lio_listio/25-1.c b/testcases/open_posix_testsuite/conformance/interfaces/lio_listio/25-1.c deleted file mode 100644 index 79f4caf..0000000 --- a/testcases/open_posix_testsuite/conformance/interfaces/lio_listio/25-1.c +++ /dev/null @@ -1,19 +0,0 @@ -/* - * Copyright (c) 2004, Bull SA. All rights reserved. - * Created by: Lau...@bu... - * This file is licensed under the GPL license. For the full content - * of this license, see the COPYING file at the top level of this - * source tree. - */ - -#define _XOPEN_SOURCE 600 -#include <stdlib.h> -#include <unistd.h> -#include "posixtest.h" - -int main() -{ - if (sysconf(_SC_ASYNCHRONOUS_IO) < 200112L) - exit(PTS_UNSUPPORTED); - exit(PTS_UNTESTED); -} diff --git a/testcases/open_posix_testsuite/conformance/interfaces/mq_close/5-1.c b/testcases/open_posix_testsuite/conformance/interfaces/mq_close/5-1.c deleted file mode 100644 index a9f3c79..0000000 --- a/testcases/open_posix_testsuite/conformance/interfaces/mq_close/5-1.c +++ /dev/null @@ -1,25 +0,0 @@ -/* - * Copyright (c) 2002, Intel Corporation. All rights reserved. - * Created by: geoffrey.r.gustafson REMOVE-THIS AT intel DOT com - * This file is licensed under the GPL license. For the full content - * of this license, see the COPYING file at the top level of this - * source tree. - */ - -/* - * Since it is undefined what will happen if mqdes is used after - * mq_close() is successfully called and mq_open() has not been - * called again, this will not be tested. (Eventually, this could - * be a speculative test) - */ - -#include <stdio.h> -#include "posixtest.h" - -int main() -{ - printf("Functionality of using mqdes after mq_close() and before\n"); - printf("mq_open() will not be tested as POSIX says this is "); - printf("undefined.\n"); - return PTS_UNTESTED; -} diff --git a/testcases/open_posix_testsuite/conformance/interfaces/mq_open/10-1.c b/testcases/open_posix_testsuite/conformance/interfaces/mq_open/10-1.c deleted file mode 100644 index 38dd1b0..0000000 --- a/testcases/open_posix_testsuite/conformance/interfaces/mq_open/10-1.c +++ /dev/null @@ -1,32 +0,0 @@ -/* - * Copyright (c) 2003, Intel Corporation. All rights reserved. - * Created by: julie.n.fleischer REMOVE-THIS AT intel DOT com - * This file is licensed under the GPL license. For the full content - * of this license, see the COPYING file at the top level of this - * source tree. - */ - -/* - * Will not test the user ID and group ID of the message queue as would - * need multiple users/groups for setup to test. - * - * Will also not test the file permissions as the implementation of the - * message queue is TBD and so it would not be possible to know how to - * check the file permissions. - * - * Will not test what happens if non-file permission bits are set as that - * is undefined. - */ - -#include <stdio.h> -#include "posixtest.h" - -int main() -{ - printf("Will not test the user ID and group ID of a created\n"); - printf("message queue as we would need multiple users and\n"); - printf("groups on the system to test.\n"); - printf("Will not test the file permissions as testing would\n"); - printf("be implementation defined.\n"); - return PTS_UNTESTED; -} diff --git a/testcases/open_posix_testsuite/conformance/interfaces/mq_open/14-1.c b/testcases/open_posix_testsuite/conformance/interfaces/mq_open/14-1.c deleted file mode 100644 index 36590bc..0000000 --- a/testcases/open_posix_testsuite/conformance/interfaces/mq_open/14-1.c +++ /dev/null @@ -1,22 +0,0 @@ -/* - * Copyright (c) 2003, Intel Corporation. All rights reserved. - * Created by: julie.n.fleischer REMOVE-THIS AT intel DOT com - * This file is licensed under the GPL license. For the full content - * of this license, see the COPYING file at the top level of this - * source tree. - */ - -/* - * Will not test calling process privileges on name as POSIX does not - * define when this error occurs. - */ - -#include <stdio.h> -#include "posixtest.h" - -int main() -{ - printf("Will not test calling process privileges on name\n"); - printf("as POSIX does not define when this error occurs.\n"); - return PTS_UNTESTED; -} diff --git a/testcases/open_posix_testsuite/conformance/interfaces/mq_open/17-1.c b/testcases/open_posix_testsuite/conformance/interfaces/mq_open/17-1.c deleted file mode 100644 index 9e40842..0000000 --- a/testcases/open_posix_testsuite/conformance/interfaces/mq_open/17-1.c +++ /dev/null @@ -1,22 +0,0 @@ -/* - * Copyright (c) 2003, Intel Corporation. All rights reserved. - * Created by: julie.n.fleischer REMOVE-THIS AT intel DOT com - * This file is licensed under the GPL license. For the full content - * of this license, see the COPYING file at the top level of this - * source tree. - */ - -/* - * Will not test setting O_EXCL without O_CREAT because results are - * undefined. - */ - -#include <stdio.h> -#include "posixtest.h" - -int main() -{ - printf("Will not test setting O_EXCL without O_CREAT because\n"); - printf("results are undefined.\n"); - return PTS_UNTESTED; -} diff --git a/testcases/open_posix_testsuite/conformance/interfaces/mq_open/22-1.c b/testcases/open_posix_testsuite/conformance/interfaces/mq_open/22-1.c deleted file mode 100644 index 630a33e..0000000 --- a/testcases/open_posix_testsuite/conformance/interfaces/mq_open/22-1.c +++ /dev/null @@ -1,22 +0,0 @@ -/* - * Copyright (c) 2003, Intel Corporation. All rights reserved. - * Created by: julie.n.fleischer REMOVE-THIS AT intel DOT com - * This file is licensed under the GPL license. For the full content - * of this license, see the COPYING file at the top level of this - * source tree. - */ - -/* - * Will not test returning EACCESS when privileges are denied as POSIX does not - * define when this error occurs. - */ - -#include <stdio.h> -#include "posixtest.h" - -int main() -{ - printf("Will not test returning EACCESS when privileges are denied\n"); - printf("as POSIX does not define when this error occurs.\n"); - return PTS_UNTESTED; -} diff --git a/testcases/open_posix_testsuite/conformance/interfaces/mq_open/24-1.c b/testcases/open_posix_testsuite/conformance/interfaces/mq_open/24-1.c deleted file mode 100644 index 7915f52..0000000 --- a/testcases/open_posix_testsuite/conformance/interfaces/mq_open/24-1.c +++ /dev/null @@ -1,23 +0,0 @@ -/* - * Copyright (c) 2003, Intel Corporation. All rights reserved. - * Created by: julie.n.fleischer REMOVE-THIS AT intel DOT com - * This file is licensed under the GPL license. For the full content - * of this license, see the COPYING file at the top level of this - * source tree. - */ - -/* - * Will not test mq_open() failing with EINTR since mq_open() does not have - * a blocking situation where we could predictably interrupt it with - * a signal. - */ - -#include <stdio.h> -#include "posixtest.h" - -int main() -{ - printf("Will not test mq_open() being interrupted as it is\n"); - printf("not possible to predictably interrupt an mq_open().\n"); - return PTS_UNTESTED; -} diff --git a/testcases/open_posix_testsuite/conformance/interfaces/mq_open/25-1.c b/testcases/open_posix_testsuite/conformance/interfaces/mq_open/25-1.c deleted file mode 100644 index c87d0fa..0000000 --- a/testcases/open_posix_testsuite/conformance/interfaces/mq_open/25-1.c +++ /dev/null @@ -1,24 +0,0 @@ -/* - * Copyright (c) 2003, Intel Corporation. All rights reserved. - * Created by: julie.n.fleischer REMOVE-THIS AT intel DOT com - * This file is licensed under the GPL license. For the full content - * of this license, see the COPYING file at the top level of this - * source tree. - */ - -/* - * Will not test mq_open() failing with EINVAL if mq_open() is not - * supported for the name parameter as unsupported names are implementation - * defined. - */ - -#include <stdio.h> -#include "posixtest.h" - -int main() -{ - printf("Will not test mq_open() failing with EINVAL if mq_open()\n"); - printf("is not supported for the name parameter as\n"); - printf("unsupported names are implementation defined.\n"); - return PTS_UNTESTED; -} diff --git a/testcases/open_posix_testsuite/conformance/interfaces/mq_open/28-1.c b/testcases/open_posix_testsuite/conformance/interfaces/mq_open/28-1.c deleted file mode 100644 index ea5dafa..0000000 --- a/testcases/open_posix_testsuite/conformance/interfaces/mq_open/28-1.c +++ /dev/null @@ -1,24 +0,0 @@ -/* - * Copyright (c) 2003, Intel Corporation. All rights reserved. - * Created by: julie.n.fleischer REMOVE-THIS AT intel DOT com - * This file is licensed under the GPL license. For the full content - * of this license, see the COPYING file at the top level of this - * source tree. - */ - -/* - * Will not test returning with ENFILE if the system has too many - * message queues open when mq_open() is called as we do not have - * control of the system's message queues from this test. - */ - -#include <stdio.h> -#include "posixtest.h" - -int main() -{ - printf("Will not test returning with ENFILE if the system has\n"); - printf("too many message queues as this is beyond this\n"); - printf("test's domain.\n"); - return PTS_UNTESTED; -} diff --git a/testcases/open_posix_testsuite/conformance/interfaces/mq_open/30-1.c b/testcases/open_posix_testsuite/conformance/interfaces/mq_open/30-1.c deleted file mode 100644 index aad6e73..0000000 --- a/testcases/open_posix_testsuite/conformance/interfaces/mq_open/30-1.c +++ /dev/null @@ -1,24 +0,0 @@ -/* - * Copyright (c) 2003, Intel Corporation. All rights reserved. - * Created by: julie.n.fleischer REMOVE-THIS AT intel DOT com - * This file is licensed under the GPL license. For the full content - * of this license, see the COPYING file at the top level of this - * source tree. - */ - -/* - * Will not test mq_open() failing with ENOSPC if there is not enough - * space to create the message queue as system space cannot be controled - * from this test. - */ - -#include <stdio.h> -#include "posixtest.h" - -int main() -{ - printf("Will not test mq_open() failing with ENOSPC when there\n"); - printf("is not enough space to create the message queue\n"); - printf("as system space cannot be controlled from this test.\n"); - return PTS_UNTESTED; -} diff --git a/testcases/open_posix_testsuite/conformance/interfaces/mq_open/4-1.c b/testcases/open_posix_testsuite/conformance/interfaces/mq_open/4-1.c deleted file mode 100644 index b3ebee2..0000000 --- a/testcases/open_posix_testsuite/conformance/interfaces/mq_open/4-1.c +++ /dev/null @@ -1,25 +0,0 @@ -/* - * Copyright (c) 2003, Intel Corporation. All rights reserved. - * Created by: julie.n.fleischer REMOVE-THIS AT intel DOT com - * This file is licensed under the GPL license. For the full content - * of this license, see the COPYING file at the top level of this - * source tree. - */ - -/* - * Will not test that if the message queue descriptor is implemented with - * a file descriptor then at least {OPEN_MAX} file and message queues - * can be opened as we cannot determine at run-time if a given implementation - * is implemented with a file descriptor. - */ - -#include <stdio.h> -#include "posixtest.h" - -int main() -{ - printf("Will not test that {OPEN_MAX} file and message queues can\n"); - printf("be opened as we cannot determine at run-time if a given\n"); - printf("implementation is implemented with a file descriptor.\n"); - return PTS_UNTESTED; -} diff --git a/testcases/open_posix_testsuite/conformance/interfaces/mq_send/6-1.c b/testcases/open_posix_testsuite/conformance/interfaces/mq_send/6-1.c deleted file mode 100644 index e0d8430..0000000 --- a/testcases/open_posix_testsuite/conformance/interfaces/mq_send/6-1.c +++ /dev/null @@ -1,24 +0,0 @@ -/* - * Copyright (c) 2002, Intel Corporation. All rights reserved. - * Created by: geoffrey.r.gustafson REMOVE-THIS AT intel DOT com - * This file is licensed under the GPL license. For the full content - * of this license, see the COPYING file at the top level of this - * source tree. - */ - -/* - * Since the implementation of the order in which items are placed into - * a message queue is undetermined unless Priority Scheduling is enabled, - * this test will not be written right now. It needs priority scheduling - * to complete. - */ - -#include <stdio.h> -#include "posixtest.h" - -int main() -{ - printf("Priority Scheduling needed to make a reliable test case\n"); - printf("for this instance. Will not be tested.\n"); - return PTS_UNTESTED; -} diff --git a/testcases/open_posix_testsuite/conformance/interfaces/mq_timedsend/17-1.c b/testcases/open_posix_testsuite/conformance/interfaces/mq_timedsend/17-1.c deleted file mode 100644 index 065b91c..0000000 --- a/testcases/open_posix_testsuite/conformance/interfaces/mq_timedsend/17-1.c +++ /dev/null @@ -1,21 +0,0 @@ -/* - * Copyright (c) 2003, Intel Corporation. All rights reserved. - * Created by: geoffrey.r.gustafson REMOVE-THIS AT intel DOT com - * This file is licensed under the GPL license. For the full content - * of this license, see the COPYING file at the top level of this - * source tree. - */ - -/* - * Since timeouts can happen at any time on the system, resolution of - * timeouts cannot be determined. Will not test timeout resolution. - */ - -#include <stdio.h> -#include "posixtest.h" - -int main() -{ - printf("Will not test timeout resolution.\n"); - return PTS_UNTESTED; -} diff --git a/testcases/open_posix_testsuite/conformance/interfaces/mq_timedsend/6-1.c b/testcases/open_posix_testsuite/conformance/interfaces/mq_timedsend/6-1.c deleted file mode 100644 index afae399..0000000 --- a/testcases/open_posix_testsuite/conformance/interfaces/mq_timedsend/6-1.c +++ /dev/null @@ -1,24 +0,0 @@ -/* - * Copyright (c) 2003, Intel Corporation. All rights reserved. - * Created by: geoffrey.r.gustafson REMOVE-THIS AT intel DOT com - * This file is licensed under the GPL license. For the full content - * of this license, see the COPYING file at the top level of this - * source tree. - */ - -/* - * Since the implementation of the order in which items are placed into - * a message queue is undetermined unless Priority Scheduling is enabled, - * this test will not be written right now. It needs priority scheduling - * to complete. - */ - -#include <stdio.h> -#include "posixtest.h" - -int main() -{ - printf("Priority Scheduling needed to make a reliable test case\n"); - printf("for this instance. Will not be tested.\n"); - return PTS_UNTESTED; -} diff --git a/testcases/open_posix_testsuite/conformance/interfaces/mq_unlink/2-3.c b/testcases/open_posix_testsuite/conformance/interfaces/mq_unlink/2-3.c deleted file mode 100644 index f073174..0000000 --- a/testcases/open_posix_testsuite/conformance/interfaces/mq_unlink/2-3.c +++ /dev/null @@ -1,24 +0,0 @@ -/* - * Copyright (c) 2003, Intel Corporation. All rights reserved. - * Created by: crystal.xiong REMOVE-THIS AT intel DOT com:wq - * This file is licensed under the GPL license. For the full content - * of this license, see the COPYING file at the top level of this - * source tree. - */ - -/* - * If one or more process have the message queue open, - * mq_unlink() may block until all the referneces have been closed. - * NOTE: It is difficult to detect such instance. so won't test. - */ - -#include <stdio.h> -#include "posixtest.h" - -int main() -{ - printf - ("Difficult to detect whether mq_unlink will block until all the reference have been closed\n"); - printf("for this instance. Will not be tested.\n"); - return PTS_UNTESTED; -} diff --git a/testcases/open_posix_testsuite/conformance/interfaces/sched_getscheduler/2-1.c b/testcases/open_posix_testsuite/conformance/interfaces/sched_getscheduler/2-1.c deleted file mode 100644 index 619445b..0000000 --- a/testcases/open_posix_testsuite/conformance/interfaces/sched_getscheduler/2-1.c +++ /dev/null @@ -1,22 +0,0 @@ -/* - * This program is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License version 2. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * Will not test the behavior of sched_getscheduler() when pid is negative - * because it is unspecified. - */ - -#include <stdio.h> -#include "posixtest.h" - -int main() -{ - printf("Will not test the behavior of sched_getscheduler() " - "when pid is negative\n because it is unspecified.\n"); - return PTS_UNTESTED; -} diff --git a/testcases/open_posix_testsuite/conformance/interfaces/sched_setparam/12-1.c b/testcases/open_posix_testsuite/conformance/interfaces/sched_setparam/12-1.c deleted file mode 100644 index 78c8013..0000000 --- a/testcases/open_posix_testsuite/conformance/interfaces/sched_setparam/12-1.c +++ /dev/null @@ -1,35 +0,0 @@ -/* - * This program is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License version 2. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * Test that the sched_ss_repl_period and sched_ss_init_budget members of the - * param argument represent the time parameters to be used by the sporadic - * server scheduling policy for the target process. - * - * @pt:SS - */ - -#include <stdio.h> -#include <unistd.h> -#include "posixtest.h" - -#ifdef _POSIX_SPORADIC_SERVER -int main() -{ - printf("Not yet tested.\n"); - return PTS_UNTESTED; -} - -#else -int main() -{ - printf("Does not support SS (SPORADIC SERVER)\n"); - return PTS_UNSUPPORTED; -} - -#endif diff --git a/testcases/open_posix_testsuite/conformance/interfaces/sched_setparam/13-1.c b/testcases/open_posix_testsuite/conformance/interfaces/sched_setparam/13-1.c deleted file mode 100644 index 6de32ad..0000000 --- a/testcases/open_posix_testsuite/conformance/interfaces/sched_setparam/13-1.c +++ /dev/null @@ -1,35 +0,0 @@ -/* - * This program is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License version 2. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * Test that the sched_ss_max_repl member of the param argument represent the - * maximum number of replenishments that are allowed to be pending - * simultaneously for the process scheduled under the SCHED_SPORADIC policy. - * - * @pt:SS - */ - -#include <stdio.h> -#include <unistd.h> -#include "posixtest.h" - -#ifdef _POSIX_SPORADIC_SERVER -int main() -{ - printf("Not yet tested.\n"); - return PTS_UNTESTED; -} - -#else -int main() -{ - printf("Does not support SS (SPORADIC SERVER)\n"); - return PTS_UNSUPPORTED; -} - -#endif diff --git a/testcases/open_posix_testsuite/conformance/interfaces/sched_setparam/14-1.c b/testcases/open_posix_testsuite/conformance/interfaces/sched_setparam/14-1.c deleted file mode 100644 index 44ce94c..0000000 --- a/testcases/open_posix_testsuite/conformance/interfaces/sched_setparam/14-1.c +++ /dev/null @@ -1,37 +0,0 @@ -/* - * This program is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License version 2. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * Test that the sched_ss_low_priority, sched_ss_repl_period, and - * sched_ss_init_budget members of the param argument have no effect on the - * scheduling beha... [truncated message content] |
From: Cyril H. <su...@li...> - 2013-02-27 07:56:44
|
The branch, master, has been updated via a3fdf48e1444049ff9185c069c365872892522a0 (commit) from f2f85f4e5886bec9d9e8e77e7dd09a59f5fd6bde (commit) - Log ----------------------------------------------------------------- commit a3fdf48e1444049ff9185c069c365872892522a0 Author: DAN LI <li...@cn...> Date: Wed Feb 27 11:34:39 2013 +0800 testfrmw/testfrmw.c : include head file Include stdarg.h, since va_start & va_end are called in this src file. Signed-off-by: DAN LI <li...@cn...> Signed-off-by: Wanlong Gao <gao...@cn...> ----------------------------------------------------------------------- Summary of changes: .../conformance/interfaces/testfrmw/testfrmw.c | 1 + 1 files changed, 1 insertions(+), 0 deletions(-) diff --git a/testcases/open_posix_testsuite/conformance/interfaces/testfrmw/testfrmw.c b/testcases/open_posix_testsuite/conformance/interfaces/testfrmw/testfrmw.c index b78115e..18cb636 100644 --- a/testcases/open_posix_testsuite/conformance/interfaces/testfrmw/testfrmw.c +++ b/testcases/open_posix_testsuite/conformance/interfaces/testfrmw/testfrmw.c @@ -29,6 +29,7 @@ #include <time.h> #include <sys/types.h> #include <pthread.h> +#include <stdarg.h> /* We use a mutex to avoid conflicts in traces */ static pthread_mutex_t m_trace = PTHREAD_MUTEX_INITIALIZER; hooks/post-receive -- ltp |
From: Cyril H. <su...@li...> - 2013-02-26 08:56:21
|
The branch, master, has been updated via f2f85f4e5886bec9d9e8e77e7dd09a59f5fd6bde (commit) from b26e6335f76a06557733e9fc7296625439f40de0 (commit) - Log ----------------------------------------------------------------- commit f2f85f4e5886bec9d9e8e77e7dd09a59f5fd6bde Author: DAN LI <li...@cn...> Date: Tue Feb 26 16:25:15 2013 +0800 pthread_kill/1-2.c: fix a trivial typo miss fix a trivial typo miss Signed-off-by: DAN LI <li...@cn...> Signed-off-by: Wanlong Gao <gao...@cn...> ----------------------------------------------------------------------- Summary of changes: .../conformance/interfaces/pthread_kill/1-2.c | 2 +- 1 files changed, 1 insertions(+), 1 deletions(-) diff --git a/testcases/open_posix_testsuite/conformance/interfaces/pthread_kill/1-2.c b/testcases/open_posix_testsuite/conformance/interfaces/pthread_kill/1-2.c index 3876bd1..cad281e 100644 --- a/testcases/open_posix_testsuite/conformance/interfaces/pthread_kill/1-2.c +++ b/testcases/open_posix_testsuite/conformance/interfaces/pthread_kill/1-2.c @@ -127,7 +127,7 @@ int main(int argc, char *argv[]) UNRESOLVED(ret, "Failed to empty signal set"); } - sigaction(SIGUSR2, &sa, 0); + ret = sigaction(SIGUSR2, &sa, 0); if (ret != 0) { UNRESOLVED(ret, "Failed to set signal handler"); hooks/post-receive -- ltp |
From: Caspar Z. <su...@li...> - 2013-02-25 06:06:29
|
The branch, master, has been updated via b26e6335f76a06557733e9fc7296625439f40de0 (commit) from f0750701efe6f2e95ce83d258529e70f78d0fc1a (commit) - Log ----------------------------------------------------------------- commit b26e6335f76a06557733e9fc7296625439f40de0 Author: Hangbin Liu <liu...@gm...> Date: Tue Oct 9 22:48:36 2012 +0800 testscripts: add appl test in networkstress.sh We have network_stress.appl in runtest dir. But we didn't include this test in networkstress.sh. Add a new parameter to support appl test. Signed-off-by: Hangbin Liu <liu...@gm...> ----------------------------------------------------------------------- Summary of changes: testscripts/networkstress.sh | 4 +++- 1 files changed, 3 insertions(+), 1 deletions(-) diff --git a/testscripts/networkstress.sh b/testscripts/networkstress.sh index 07e48b4..b40af72 100755 --- a/testscripts/networkstress.sh +++ b/testscripts/networkstress.sh @@ -59,6 +59,7 @@ usage () { echo "---------------------------------------------------------" echo -e "\033[31m $0 [options] \033[0m " echo "---------------------------------------------------------" + echo " -A|a: Stress test for appl" echo " -E|e: Stress test for interface" echo " -I|i: Stress test for ICMP protocol" echo " -T|t: Stress test for TCP/IP" @@ -76,9 +77,10 @@ usage () { exit 1 } -while getopts EeTtIiUuRrMmSsWwBbVvN:n:D:d: OPTION +while getopts AaEeTtIiUuRrMmSsWwBbVvN:n:D:d: OPTION do case $OPTION in + A|a) TEST_CASE="network_stress.appl";; E|e) TEST_CASE="network_stress.interface";; B|b) TEST_CASE="network_stress.broken_ip";; I|i) TEST_CASE="network_stress.icmp";; hooks/post-receive -- ltp |
From: Cyril H. <su...@li...> - 2013-02-21 20:56:21
|
The branch, master, has been updated via f0750701efe6f2e95ce83d258529e70f78d0fc1a (commit) from 07f4e5432dd3e7a60bc0235f13200640c82d8f89 (commit) - Log ----------------------------------------------------------------- commit f0750701efe6f2e95ce83d258529e70f78d0fc1a Author: Vinson Lee <vl...@tw...> Date: Thu Feb 21 10:10:50 2013 -0800 syscalls/getrusage04: Link rt through LDLIBS instead of LDFLAGS. Fixes this build error on Ubuntu introduced with commit 07f4e5432dd3e7a60bc0235f13200640c82d8f89. testcases/kernel/syscalls/getrusage/getrusage04.c:186: undefined reference to `clock_getres' Signed-off-by: Vinson Lee <vl...@tw...> ----------------------------------------------------------------------- Summary of changes: testcases/kernel/syscalls/getrusage/Makefile | 2 +- 1 files changed, 1 insertions(+), 1 deletions(-) diff --git a/testcases/kernel/syscalls/getrusage/Makefile b/testcases/kernel/syscalls/getrusage/Makefile index 6851383..6702f27 100644 --- a/testcases/kernel/syscalls/getrusage/Makefile +++ b/testcases/kernel/syscalls/getrusage/Makefile @@ -20,6 +20,6 @@ top_srcdir ?= ../../../.. include $(top_srcdir)/include/mk/testcases.mk -LDFLAGS += -lrt +LDLIBS += -lrt include $(top_srcdir)/include/mk/generic_leaf_target.mk hooks/post-receive -- ltp |
From: Cyril H. <su...@li...> - 2013-02-21 16:56:32
|
The branch, master, has been updated via 07f4e5432dd3e7a60bc0235f13200640c82d8f89 (commit) from 116a8c03828be8324ff0b402c33b591603883f7c (commit) - Log ----------------------------------------------------------------- commit 07f4e5432dd3e7a60bc0235f13200640c82d8f89 Author: Cyril Hrubis <ch...@su...> Date: Thu Feb 21 17:23:57 2013 +0100 syscalls/getrusage04: Try guess timer granularity. This patch adds timer granularity detection for the testcase. The granularity of getrusage timers depends on CONFIG_HZ kernel parameter. There is unfortunately no API to get getrusage timers resolution but there are linux specific POSIX timers that have exactly same granularity. These are now used to detect the expected timers resolution. Signed-off-by: Cyril Hrubis <ch...@su...> ----------------------------------------------------------------------- Summary of changes: testcases/kernel/syscalls/getrusage/Makefile | 2 + testcases/kernel/syscalls/getrusage/getrusage04.c | 54 ++++++++++++++++++++- 2 files changed, 55 insertions(+), 1 deletions(-) diff --git a/testcases/kernel/syscalls/getrusage/Makefile b/testcases/kernel/syscalls/getrusage/Makefile index bd617d8..6851383 100644 --- a/testcases/kernel/syscalls/getrusage/Makefile +++ b/testcases/kernel/syscalls/getrusage/Makefile @@ -20,4 +20,6 @@ top_srcdir ?= ../../../.. include $(top_srcdir)/include/mk/testcases.mk +LDFLAGS += -lrt + include $(top_srcdir)/include/mk/generic_leaf_target.mk diff --git a/testcases/kernel/syscalls/getrusage/getrusage04.c b/testcases/kernel/syscalls/getrusage/getrusage04.c index ceda15f..95c701d 100644 --- a/testcases/kernel/syscalls/getrusage/getrusage04.c +++ b/testcases/kernel/syscalls/getrusage/getrusage04.c @@ -17,6 +17,8 @@ * this test won't be executed on those platforms. * * Copyright (C) 2011 Red Hat, Inc. + * Copyright (C) 2013 Cyril Hrubis <ch...@su...> + * * 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. @@ -37,6 +39,7 @@ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA * 02110-1301, USA. */ + #define _GNU_SOURCE #include <sys/types.h> #include <sys/resource.h> @@ -44,6 +47,7 @@ #include <errno.h> #include <stdio.h> #include <stdlib.h> +#include <time.h> #include "test.h" #include "usctest.h" @@ -52,7 +56,6 @@ char *TCID = "getrusage04"; int TST_TOTAL = 1; -#define BIAS_MAX 1000 #define RECORD_MAX 20 #define FACTOR_MAX 10 @@ -60,6 +63,8 @@ int TST_TOTAL = 1; #define RUSAGE_THREAD 1 #endif +static long BIAS_MAX; + static int opt_factor; static char *factor_str; static long factor_nr = 1; @@ -136,6 +141,9 @@ int main(int argc, char *argv[]) busyloop(100000); } } + + tst_resm(TPASS, "Test Passed"); + cleanup(); tst_exit(); } @@ -151,10 +159,54 @@ static void busyloop(long wait) while (wait--) ; } +/* + * The resolution of getrusage timers currently depends on CONFIG_HZ settings, + * as they are measured in jiffies. + * + * The problem is that there is no reasonable API to get either getrusage + * timers resolution or duration of jiffie. + * + * Here we use clock_getres() with linux specific CLOCK_REALTIME_COARSE (added + * in 2.6.32) which is also based on jiffies. This timer has the same + * granularity as getrusage but it's not guaranteed and it may change in the + * future. + * + * The default value for resolution was choosen to be 4ms as it corresponds to + * CONFIG_HZ=250 which seems to be default value. + */ + +#ifndef CLOCK_REALTIME_COARSE +#define CLOCK_REALTIME_COARSE 5 +#endif + +static unsigned long guess_timer_resolution(void) +{ + struct timespec res; + + if (clock_getres(CLOCK_REALTIME_COARSE, &res)) { + tst_resm(TINFO, + "CLOCK_REALTIME_COARSE not supported, using 4000 us"); + return 4000; + } + + if (res.tv_nsec < 1000000 || res.tv_nsec > 10000000) { + tst_resm(TINFO, "Unexpected CLOCK_REALTIME_COARSE resolution," + " using 4000 us"); + return 4000; + } + + tst_resm(TINFO, "Expected timers granularity is %li us", + res.tv_nsec / 1000); + + return res.tv_nsec / 1000; +} + static void setup(void) { tst_sig(NOFORK, DEF_HANDLER, cleanup); + BIAS_MAX = guess_timer_resolution(); + TEST_PAUSE; } hooks/post-receive -- ltp |
From: Cyril H. <su...@li...> - 2013-02-20 16:56:19
|
The branch, master, has been updated via 116a8c03828be8324ff0b402c33b591603883f7c (commit) via 572f0e0d44fd24acfd232816af8eaae5312c0f05 (commit) via 94bca9cf30cd635213238b0def62b5ac16fabd3a (commit) via ed77dcc4d2a24f7b6d7c43fdd985fe56745ff4de (commit) from b596770ead42183158d22b9a3446372b804a71ce (commit) - Log ----------------------------------------------------------------- commit 116a8c03828be8324ff0b402c33b591603883f7c Author: Cyril Hrubis <ch...@su...> Date: Wed Feb 20 16:56:32 2013 +0100 syscalls/readlin04: Further fixes. Remove the fork as it's not needed at all. Also remove some uses of redundant \0 in strings, duplicate variables, unneeded curly braces etc. Signed-off-by: Cyril Hrubis <ch...@su...> commit 572f0e0d44fd24acfd232816af8eaae5312c0f05 Author: Cyril Hrubis <ch...@su...> Date: Wed Feb 20 16:20:25 2013 +0100 syscalls/readlink04: Simplify the code. This commit moves the creat_slink.c code into the readlink04 as there is no point in running the symlink in separate binary. Signed-off-by: Cyril Hrubis <ch...@su...> commit 94bca9cf30cd635213238b0def62b5ac16fabd3a Author: Cyril Hrubis <ch...@su...> Date: Wed Feb 20 16:04:22 2013 +0100 syscalls/readlink04: Cleanup. Signed-off-by: Cyril Hrubis <ch...@su...> commit ed77dcc4d2a24f7b6d7c43fdd985fe56745ff4de Author: Cyril Hrubis <ch...@su...> Date: Wed Feb 20 15:28:19 2013 +0100 syscalls/sockioctl01: Fix mknod(). The O_CREAT is wrong too, remove it. Signed-off-by: Cyril Hrubis <ch...@su...> ----------------------------------------------------------------------- Summary of changes: testcases/kernel/syscalls/readlink/creat_slink.c | 59 ------ testcases/kernel/syscalls/readlink/readlink04.c | 212 +++++---------------- testcases/kernel/syscalls/sockioctl/sockioctl01.c | 7 +- 3 files changed, 53 insertions(+), 225 deletions(-) delete mode 100644 testcases/kernel/syscalls/readlink/creat_slink.c diff --git a/testcases/kernel/syscalls/readlink/creat_slink.c b/testcases/kernel/syscalls/readlink/creat_slink.c deleted file mode 100644 index 1658eab..0000000 --- a/testcases/kernel/syscalls/readlink/creat_slink.c +++ /dev/null @@ -1,59 +0,0 @@ -/* - * - * Copyright (c) International Business Machines Corp., 2001 - * - * This program is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 2 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See - * the GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software - * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA - */ - -/* - * Description: This is a program invoked as nobody that will - * creat a testfile and a symlink to that testfile. - * - * This program exits with 0 or 1 depending upon the - * success or failure of each system call. - */ -#include <unistd.h> -#include <fcntl.h> -#include <sys/stat.h> -#include <errno.h> -#include <stdlib.h> -#include <stdio.h> - -#define FILE_MODE S_IRUSR | S_IWUSR | S_IRGRP | S_IROTH - -int main(int ac, char **av) -{ - int fd; /* file handle for testfile */ - - /* Create a testfile under temporary directory */ - if ((fd = open(av[1], O_RDWR | O_CREAT, FILE_MODE)) == -1) { - perror("creat_slink: open() failed"); - exit(1); - } - - /* Close the testfile created */ - if (close(fd) == -1) { - perror("creat_slink: close() failed"); - exit(1); - } - - /* Create a symlink of testfile under temporary directory */ - if (symlink(av[1], av[2]) < 0) { - perror("creat_slink: symlink() failed"); - exit(1); - } - - exit(0); -} diff --git a/testcases/kernel/syscalls/readlink/readlink04.c b/testcases/kernel/syscalls/readlink/readlink04.c index 5736ff7..abb43a0 100644 --- a/testcases/kernel/syscalls/readlink/readlink04.c +++ b/testcases/kernel/syscalls/readlink/readlink04.c @@ -1,20 +1,20 @@ /* + * Copyright (c) International Business Machines Corp., 2001 + * Copyright (c) 2013 Cyril Hrubis <ch...@su...> * - * 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 free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 2 of the License, or - * (at your option) any later version. + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See + * the GNU General Public License for more details. * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See - * the GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software - * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software + * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA */ /* @@ -28,43 +28,8 @@ * Expected Result: * readlink() should return the contents of symbolic link path in the * specified buffer on success. - * - * Algorithm: - * Setup: - * Setup signal handling. - * Create temporary directory. - * Pause for SIGUSR1 if option specified. - * - * Test: - * Loop if the proper options are given. - * Execute system call - * Check return code, if system call failed (return=-1) - * if errno set == expected errno - * Issue sys call fails with expected return value and errno. - * Otherwise, - * Issue sys call fails with unexpected errno. - * Otherwise, - * Issue sys call returns unexpected value. - * - * Cleanup: - * Print errno log and/or timing stats if options given - * Delete the temporary directory(s)/file(s) created. - * - * Usage: <for command-line> - * readlink04 [-c n] [-f] [-i n] [-I x] [-P x] [-t] - * where, -c n : Run n copies concurrently. - * -f : Turn off functionality Testing. - * -i n : Execute test n times. - * -I x : Execute test for x seconds. - * -P x : Pause for x seconds between iterations. - * -t : Turn on syscall timing. - * - * HISTORY - * 07/2001 Ported by Wayne Boyer - * - * RESTRICTIONS: - * This test should be executed by 'super-user' only. */ + #include <stdlib.h> #include <pwd.h> #include <sys/types.h> @@ -76,31 +41,25 @@ #include "test.h" #include "usctest.h" -char TESTFILE[] = "./testfile\0"; /* name of file to create */ -char SYMFILE[] = "slink_file\0"; /* name of symbolic link to create */ -char creat_slink[] = "/creat_slink"; /* name of executable to execvp() */ +char *TCID = "readlink04"; +int TST_TOTAL = 1; -char nobody[] = "nobody"; -char bin[] = "bin"; +static char *TESTFILE = "./testfile"; +static char *SYMFILE = "slink_file"; #define MAX_SIZE 256 -char *TCID = "readlink04"; /* Test program identifier. */ -int TST_TOTAL = 1; /* Total number of test cases. */ - -char *symfile_path; -int exp_val; /* strlen of testfile */ -char buffer[MAX_SIZE]; /* temporary buffer to hold symlink contents */ +static int exp_val; +static char buffer[MAX_SIZE]; -void setup(); /* Setup function for the test */ -void cleanup(); /* Cleanup function for the test */ +static void setup(void); +static void cleanup(void); int main(int ac, char **av) { int lc; char *msg; - /* Parse standard options given to run the test. */ if ((msg = parse_opts(ac, av, NULL, NULL)) != NULL) tst_brkm(TBROK, NULL, "OPTION PARSING ERROR - %s", msg); @@ -114,25 +73,15 @@ int main(int ac, char **av) * Call readlink(2) to read the contents of * symlink into a buffer. */ - TEST(readlink(symfile_path, buffer, sizeof(buffer))); + TEST(readlink(SYMFILE, buffer, sizeof(buffer))); if (TEST_RETURN == -1) { - tst_resm(TFAIL, "readlink() on %s failed, errno=%d : " - "%s", symfile_path, TEST_ERRNO, - strerror(TEST_ERRNO)); + tst_resm(TFAIL | TTERRNO, "readlink() on %s failed", + SYMFILE); continue; } - /* - * Perform functional verification if test - * executed without (-f) option. - */ if (STD_FUNCTIONAL_TEST) { - /* - * Compare the return value of readlink() - * with the expected value which is the - * strlen() of testfile. - */ if (TEST_RETURN == exp_val) { /* Check for the contents of buffer */ if (memcmp(buffer, TESTFILE, exp_val) != 0) { @@ -156,134 +105,69 @@ int main(int ac, char **av) cleanup(); tst_exit(); - } -/* - * setup() - performs all ONE TIME setup for this test. - * - * Create a temporary directory and change directory to it. - * - * execvp() the creat_slink program as bin to creat a file and symlink. - */ -void setup() +#define FILE_MODE S_IRUSR | S_IWUSR | S_IRGRP | S_IROTH + +static void setup(void) { - int pid; + int fd; char *tmp_dir = NULL; - char path_buffer[BUFSIZ]; /* Buffer to hold command string */ - char *cargv[4]; - char bin_dir[PATH_MAX]; /* variable to hold TESTHOME env */ struct passwd *pwent; - /* Check that the test process id is super/root */ - if (geteuid() != 0) { - tst_brkm(TBROK, NULL, "Must be root for this test!"); - } - - tst_sig(FORK, DEF_HANDLER, cleanup); + tst_require_root(NULL); TEST_PAUSE; - /* Get current bin directory */ - if (getcwd(bin_dir, sizeof(bin_dir)) == NULL) { - tst_brkm(TBROK, NULL, - "getcwd(3) fails to get working directory of process"); - } - tst_tmpdir(); /* get the name of the temporary directory */ - if ((tmp_dir = getcwd(tmp_dir, 0)) == NULL) { + if ((tmp_dir = getcwd(tmp_dir, 0)) == NULL) tst_brkm(TBROK, NULL, "getcwd failed"); - } - if ((pwent = getpwnam("bin")) == NULL) { + if ((pwent = getpwnam("bin")) == NULL) tst_brkm(TBROK, cleanup, "getpwname() failed"); - } /* make the tmp directory belong to bin */ - if (chown(tmp_dir, pwent->pw_uid, pwent->pw_gid) == -1) { + if (chown(tmp_dir, pwent->pw_uid, pwent->pw_gid) == -1) tst_brkm(TBROK, cleanup, "chown() failed"); - } - - if (chmod(tmp_dir, 0711) != 0) { - tst_brkm(TBROK, cleanup, "chmod() failed"); - } - /* create the full pathname of the executable to be execvp'ed */ - strcpy((char *)path_buffer, (char *)bin_dir); - strcat((char *)path_buffer, (char *)creat_slink); + if (chmod(tmp_dir, 0711) != 0) + tst_brkm(TBROK|TERRNO, cleanup, "chmod(%s) failed", tmp_dir); - symfile_path = "slink_file\0"; + /* create test file and symlink */ + if ((fd = open(TESTFILE, O_RDWR | O_CREAT, FILE_MODE)) == -1) + tst_brkm(TBROK|TERRNO, cleanup, "open(%s) failed", TESTFILE); - /* set up the argument vector to pass into the execvp call */ - cargv[0] = tmp_dir; - cargv[1] = TESTFILE; - cargv[2] = symfile_path; - cargv[3] = NULL; + if (close(fd)) + tst_brkm(TBROK|TERRNO, cleanup, "close(%s) failed", TESTFILE); - if ((pid = FORK_OR_VFORK()) == -1) { - tst_brkm(TBROK, cleanup, "fork failed"); + if (symlink(TESTFILE, SYMFILE) < 0) { + tst_brkm(TBROK|TERRNO, cleanup, "symlink(%s, %s) failed", + TESTFILE, SYMFILE); } - if (pid == 0) { /* child */ - /* - * execvp the process/program that will create the test file - * and set up the symlink - */ - execvp(path_buffer, cargv); - - /* on success, execvp will not return */ - perror("execvp"); - tst_brkm(TBROK, NULL, "execvp() failed"); - - /* - * In reality, the contents/functionality of the creat_slink - * program could be included right here. This would simplify - * the test a bit. For now, however, we'll leave it as is. - */ - } - - /* parent */ - - /* wait to let the execvp'ed process do its work */ - waitpid(pid, NULL, 0); - /* set up the expected return value from the readlink() call */ exp_val = strlen(TESTFILE); /* fill the buffer with a known value */ - (void)memset(buffer, 0, MAX_SIZE); + memset(buffer, 0, MAX_SIZE); /* finally, change the id of the parent process to "nobody" */ - if ((pwent = getpwnam("nobody")) == NULL) { + if ((pwent = getpwnam("nobody")) == NULL) tst_brkm(TBROK, cleanup, "getpwname() failed for nobody"); - } - if (seteuid(pwent->pw_uid) == -1) { + if (seteuid(pwent->pw_uid) == -1) tst_brkm(TBROK, cleanup, "seteuid() failed for nobody"); - } } -/* - * cleanup() - performs all ONE TIME cleanup for this test at - * completion or premature exit. - * - * Remove the test directory and testfile created in the setup. - */ -void cleanup() +static void cleanup(void) { - /* - * print timing stats if that option was specified. - * print errno log if that option was specified. - */ TEST_CLEANUP; /* set the process id back to root in order to remove the tmp dir */ - if (seteuid(0) == -1) { + if (seteuid(0) == -1) tst_brkm(TBROK, NULL, "failed to set process id to root"); - } tst_rmdir(); - } diff --git a/testcases/kernel/syscalls/sockioctl/sockioctl01.c b/testcases/kernel/syscalls/sockioctl/sockioctl01.c index 0cf2b78..badb5f3 100644 --- a/testcases/kernel/syscalls/sockioctl/sockioctl01.c +++ b/testcases/kernel/syscalls/sockioctl/sockioctl01.c @@ -184,13 +184,16 @@ static void setup0(void) } else { unlink("test"); - if ((mknod("test", S_IRWXU | O_CREAT | S_IFIFO, 0)) == -1) + if ((mknod("test", S_IRWXU | S_IFIFO, 0)) == -1) { tst_brkm(TBROK, cleanup, "Could not create test - " "errno: %s", strerror(errno)); + } - if ((s = open("test", O_RDWR)) == -1) + if ((s = open("test", O_RDWR)) == -1) { tst_brkm(TBROK, cleanup, "Could not open test - " "errno: %s", strerror(errno)); + } + /* * kernel commit 46ce341b2f176c2611f12ac390adf862e932eb02 * changed -EINVAL to -ENOIOCTLCMD, so vfs_ioctl now hooks/post-receive -- ltp |
From: Cyril H. <su...@li...> - 2013-02-19 17:56:38
|
The branch, master, has been updated via b596770ead42183158d22b9a3446372b804a71ce (commit) via 00b8b888b0683267d665e0e0a5e519ec18f5fe9b (commit) from 03dcbb0a1d7baacaba68c3a17e8bb6017af94a15 (commit) - Log ----------------------------------------------------------------- commit b596770ead42183158d22b9a3446372b804a71ce Author: Cyril Hrubis <ch...@su...> Date: Tue Feb 19 18:25:45 2013 +0100 syscalls/sockioctl01: Fixes. * Use the tst_tmpdir() only once in global setup. * Fix permission flags passed to mknod. Signed-off-by: Cyril Hrubis <ch...@su...> commit 00b8b888b0683267d665e0e0a5e519ec18f5fe9b Author: Cyril Hrubis <ch...@su...> Date: Tue Feb 19 18:08:28 2013 +0100 syscalls/sockioctl01: Cleanup first. Signed-off-by: Cyril Hrubis <ch...@su...> ----------------------------------------------------------------------- Summary of changes: testcases/kernel/syscalls/sockioctl/sockioctl01.c | 92 +++++++++------------ 1 files changed, 40 insertions(+), 52 deletions(-) diff --git a/testcases/kernel/syscalls/sockioctl/sockioctl01.c b/testcases/kernel/syscalls/sockioctl/sockioctl01.c index b2018c9..0cf2b78 100644 --- a/testcases/kernel/syscalls/sockioctl/sockioctl01.c +++ b/testcases/kernel/syscalls/sockioctl/sockioctl01.c @@ -23,23 +23,6 @@ * Test Description: * Verify that ioctl() on sockets returns the proper errno for various * failure cases - * - * Usage: <for command-line> - * sockioctl01 [-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. - * - * History - * 07/2001 John George - * -Ported - * - * Restrictions: - * None. - * */ #include <stdio.h> @@ -59,23 +42,30 @@ #include "test.h" #include "usctest.h" -char *TCID = "sockioctl01"; /* Test program identifier. */ +char *TCID = "sockioctl01"; int testno; -int s; /* socket descriptor */ -struct sockaddr_in sin0, fsin1; -struct ifconf ifc; -struct ifreq ifr; -int sinlen; -int optval; -int exp_enos[] = { EBADF, EINVAL, EFAULT, 0 }; +static int s; /* socket descriptor */ +static struct sockaddr_in sin0, fsin1; +static struct ifconf ifc; +static struct ifreq ifr; +static int sinlen; +static int optval; +static int exp_enos[] = {EBADF, EINVAL, EFAULT, 0}; + +static char buf[8192]; -char buf[8192]; +static void setup(void); +static void setup0(void); +static void setup1(void); +static void setup2(void); +static void setup3(void); -void setup(void), setup0(void), setup1(void), setup2(void), setup3(void), -cleanup(void), cleanup0(void), cleanup1(void); +static void cleanup(void); +static void cleanup0(void); +static void cleanup1(void); -struct test_case_t { /* test case structure */ +struct test_case_t { int domain; /* PF_INET, PF_UNIX, ... */ int type; /* SOCK_STREAM, SOCK_DGRAM ... */ int proto; /* protocol number (usually 0 = default) */ @@ -127,19 +117,16 @@ struct test_case_t { /* test case structure */ EFAULT, setup3, cleanup1, "SIOCSIFFLAGS with invalid ifr"} ,}; -int TST_TOTAL = sizeof(tdat) / sizeof(tdat[0]); /* Total number of test cases. */ +int TST_TOTAL = sizeof(tdat) / sizeof(tdat[0]); int main(int argc, char *argv[]) { int lc; char *msg; - /* Parse standard options given to run the test. */ msg = parse_opts(argc, argv, NULL, NULL); - if (msg != NULL) { + if (msg != NULL) tst_brkm(TBROK, NULL, "OPTION PARSING ERROR - %s", msg); - tst_exit(); - } setup(); @@ -165,39 +152,42 @@ int main(int argc, char *argv[]) tdat[testno].cleanup(); } } + cleanup(); tst_exit(); - } -void setup(void) +static void setup(void) { - /* set the expected errnos... */ TEST_EXP_ENOS(exp_enos); - TEST_PAUSE; /* if -P option specified */ + TEST_PAUSE; - /* initialize local sockaddr */ sin0.sin_family = AF_INET; sin0.sin_port = 0; sin0.sin_addr.s_addr = INADDR_ANY; + + tst_tmpdir(); } -void cleanup(void) +static void cleanup(void) { TEST_CLEANUP; + tst_rmdir(); } -void setup0(void) +static void setup0(void) { - if (tdat[testno].experrno == EBADF) + if (tdat[testno].experrno == EBADF) { s = 1025; /* anything not an open file */ - else { - tst_tmpdir(); - if ((mknod("test", O_RDWR | O_CREAT | S_IFIFO, 0)) == -1) + } else { + unlink("test"); + + if ((mknod("test", S_IRWXU | O_CREAT | S_IFIFO, 0)) == -1) tst_brkm(TBROK, cleanup, "Could not create test - " "errno: %s", strerror(errno)); + if ((s = open("test", O_RDWR)) == -1) tst_brkm(TBROK, cleanup, "Could not open test - " "errno: %s", strerror(errno)); @@ -211,17 +201,15 @@ void setup0(void) } } -void cleanup0(void) +static void cleanup0(void) { - /* delete the test directory created in setup0() */ if (tdat[testno].experrno != EBADF) { (void)close(s); s = -1; - tst_rmdir(); } } -void setup1(void) +static void setup1(void) { s = socket(tdat[testno].domain, tdat[testno].type, tdat[testno].proto); if (s < 0) { @@ -240,7 +228,7 @@ void setup1(void) } } -void setup2(void) +static void setup2(void) { s = socket(tdat[testno].domain, tdat[testno].type, tdat[testno].proto); if (s < 0) { @@ -251,7 +239,7 @@ void setup2(void) ifc.ifc_buf = buf; } -void setup3(void) +static void setup3(void) { setup2(); if (ioctl(s, SIOCGIFCONF, &ifc) < 0) { @@ -261,7 +249,7 @@ void setup3(void) ifr = *(struct ifreq *)ifc.ifc_buf; } -void cleanup1(void) +static void cleanup1(void) { (void)close(s); s = -1; hooks/post-receive -- ltp |
From: Cyril H. <su...@li...> - 2013-02-19 02:56:18
|
The branch, master, has been updated via 03dcbb0a1d7baacaba68c3a17e8bb6017af94a15 (commit) via 263f8b371cf2897f8077e610808f80f07afbe2e9 (commit) via eecee42404c961f6ee63ecaffd144b91fb1ca6a2 (commit) via 1f32f2780b637e15ecfd648e6dc587429fd971ac (commit) from 359980f68b19c77c698b121b57a071dfe6e3ca31 (commit) - Log ----------------------------------------------------------------- commit 03dcbb0a1d7baacaba68c3a17e8bb6017af94a15 Author: DAN LI <li...@cn...> Date: Mon Feb 18 11:05:31 2013 +0800 kill/1-2.c: fix potential bug If fork() fails,this case will cause unexpected problem when kill(-1,...) called by root. Signed-off-by: DAN LI <li...@cn...> Signed-off-by: Wanlong Gao <gao...@cn...> commit 263f8b371cf2897f8077e610808f80f07afbe2e9 Author: Jan Stancek <jst...@re...> Date: Mon Feb 18 15:05:17 2013 +0100 setns: add new syscall test setns02 functional test for setns(2) - reassociate thread with a namespace involving CLONE_NEWIPC and CLONE_NEWUTS. Signed-off-by: Jan Stancek <jst...@re...> Signed-off-by: Wanlong Gao <gao...@cn...> commit eecee42404c961f6ee63ecaffd144b91fb1ca6a2 Author: Jan Stancek <jst...@re...> Date: Mon Feb 18 15:05:16 2013 +0100 setns: add new syscall test setns01 errno tests for setns(2) - reassociate thread with a namespace Signed-off-by: Jan Stancek <jst...@re...> Signed-off-by: Wanlong Gao <gao...@cn...> commit 1f32f2780b637e15ecfd648e6dc587429fd971ac Author: Jan Stancek <jst...@re...> Date: Mon Feb 18 15:05:15 2013 +0100 setns: setup directory at kernel/syscalls/setns Signed-off-by: Jan Stancek <jst...@re...> Signed-off-by: Wanlong Gao <gao...@cn...> ----------------------------------------------------------------------- Summary of changes: runtest/syscalls | 3 + testcases/kernel/syscalls/.gitignore | 2 + .../kernel/syscalls/{accept4 => setns}/Makefile | 4 +- testcases/kernel/syscalls/setns/setns.h | 88 +++++++ testcases/kernel/syscalls/setns/setns01.c | 240 ++++++++++++++++++++ testcases/kernel/syscalls/setns/setns02.c | 231 +++++++++++++++++++ .../conformance/interfaces/kill/1-2.c | 35 ++- 7 files changed, 588 insertions(+), 15 deletions(-) copy testcases/kernel/syscalls/{accept4 => setns}/Makefile (89%) create mode 100644 testcases/kernel/syscalls/setns/setns.h create mode 100644 testcases/kernel/syscalls/setns/setns01.c create mode 100644 testcases/kernel/syscalls/setns/setns02.c diff --git a/runtest/syscalls b/runtest/syscalls index db5a075..c70bcbd 100644 --- a/runtest/syscalls +++ b/runtest/syscalls @@ -962,6 +962,9 @@ setitimer01 setitimer01 setitimer02 setitimer02 setitimer03 setitimer03 +setns01 setns01 +setns02 setns02 + setpgid01 setpgid01 setpgid02 setpgid02 setpgid03 setpgid03 diff --git a/testcases/kernel/syscalls/.gitignore b/testcases/kernel/syscalls/.gitignore index d661159..ce62f3f 100644 --- a/testcases/kernel/syscalls/.gitignore +++ b/testcases/kernel/syscalls/.gitignore @@ -764,6 +764,8 @@ /setitimer/setitimer01 /setitimer/setitimer02 /setitimer/setitimer03 +/setns/setns01 +/setns/setns02 /setpgid/setpgid01 /setpgid/setpgid02 /setpgid/setpgid03 diff --git a/testcases/kernel/syscalls/accept4/Makefile b/testcases/kernel/syscalls/setns/Makefile similarity index 89% copy from testcases/kernel/syscalls/accept4/Makefile copy to testcases/kernel/syscalls/setns/Makefile index 504042e..f1b5129 100644 --- a/testcases/kernel/syscalls/accept4/Makefile +++ b/testcases/kernel/syscalls/setns/Makefile @@ -1,5 +1,5 @@ # -# Copyright (c) International Business Machines Corp., 2008 +# Copyright (C) 2013 Linux Test Project, Inc. # # This program is free software; you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by @@ -19,5 +19,5 @@ top_srcdir ?= ../../../.. include $(top_srcdir)/include/mk/testcases.mk - +CPPFLAGS += -Wno-unused-function include $(top_srcdir)/include/mk/generic_leaf_target.mk diff --git a/testcases/kernel/syscalls/setns/setns.h b/testcases/kernel/syscalls/setns/setns.h new file mode 100644 index 0000000..23bdb2e --- /dev/null +++ b/testcases/kernel/syscalls/setns/setns.h @@ -0,0 +1,88 @@ +/* + * Copyright (C) 2013 Linux Test Project, Inc. + * + * This program is free software; you can redistribute it and/or + * modify it under the terms of version 2 of the GNU General Public + * License as published by the Free Software Foundation. + * + * This program is distributed in the hope that it would be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. + * + * Further, this software is distributed without any warranty that it + * is free of the rightful claim of any third person regarding + * infringement or the like. Any license provided herein, whether + * implied or otherwise, applies only to this software file. Patent + * licenses, if any, provided herein do not apply to combinations of + * this program with other software, or any other product whatsoever. + * + * You should have received a copy of the GNU General Public License + * along with this program; if not, write the Free Software + * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA + * 02110-1301, USA. + */ + +#define NS_MAX 5 +static int ns_types[NS_MAX]; +static int ns_fds[NS_MAX]; +static int ns_total; + +static int get_ns_fd(int pid, const char *ns) +{ + char tmp[PATH_MAX]; + struct stat st; + int fd = -1; + + sprintf(tmp, "/proc/%d/ns/%s", pid, ns); + if (stat(tmp, &st) == 0) { + fd = open(tmp, O_RDONLY); + if (fd == -1) + tst_brkm(TBROK|TERRNO, NULL, "failed to open %s", tmp); + } else { + if (errno != ENOENT) + tst_brkm(TBROK|TERRNO, NULL, "failed to stat %s", tmp); + } + return fd; +} + +static void init_ns_type(int clone_type, const char *proc_name) +{ + int fd; + + fd = get_ns_fd(getpid(), proc_name); + if (fd != -1) { + ns_types[ns_total] = clone_type; + ns_fds[ns_total] = fd; + tst_resm(TINFO, "ns_fds[%d]=%d, ns_types[%d]=0x%x", ns_total, + fd, ns_total, clone_type); + ns_total++; + } +} + +static void init_available_ns(void) +{ +#if defined(CLONE_NEWIPC) + init_ns_type(CLONE_NEWIPC, "ipc"); +#endif +#if defined(CLONE_NEWNS) + init_ns_type(CLONE_NEWNS, "mnt"); +#endif +#if defined(CLONE_NEWNET) + init_ns_type(CLONE_NEWNET, "net"); +#endif +#if defined(CLONE_NEWPID) + init_ns_type(CLONE_NEWPID, "pid"); +#endif +#if defined(CLONE_NEWUTS) + init_ns_type(CLONE_NEWUTS, "uts"); +#endif +} + +static void close_ns_fds(void) +{ + int i; + + for (i = 0; i < ns_total; i++) + if (ns_fds[i] != -1) + close(ns_fds[i]); +} diff --git a/testcases/kernel/syscalls/setns/setns01.c b/testcases/kernel/syscalls/setns/setns01.c new file mode 100644 index 0000000..74525b9 --- /dev/null +++ b/testcases/kernel/syscalls/setns/setns01.c @@ -0,0 +1,240 @@ +/* + * Copyright (C) 2013 Linux Test Project, Inc. + * + * This program is free software; you can redistribute it and/or + * modify it under the terms of version 2 of the GNU General Public + * License as published by the Free Software Foundation. + * + * This program is distributed in the hope that it would be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. + * + * Further, this software is distributed without any warranty that it + * is free of the rightful claim of any third person regarding + * infringement or the like. Any license provided herein, whether + * implied or otherwise, applies only to this software file. Patent + * licenses, if any, provided herein do not apply to combinations of + * this program with other software, or any other product whatsoever. + * + * You should have received a copy of the GNU General Public License + * along with this program; if not, write the Free Software + * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA + * 02110-1301, USA. + */ +/* + * errno tests for setns(2) - reassociate thread with a namespace + */ +#define _GNU_SOURCE +#include <sys/stat.h> +#include <sys/syscall.h> +#include <sys/types.h> +#include <errno.h> +#include <sched.h> +#include <pwd.h> +#include <string.h> +#include "config.h" +#include "test.h" +#include "usctest.h" +#include "linux_syscall_numbers.h" +#include "safe_macros.h" + +char *TCID = "setns01"; + +#if defined(__NR_setns) +#include "setns.h" + +struct testcase_t { + const char *msg; + int fd; + int ns_type; + int exp_ret; + int exp_errno; + int skip; + void (*setup) (struct testcase_t *, int i); + void (*cleanup) (struct testcase_t *); +}; + +static void setup(void); +static void cleanup(void); +static void setup0(struct testcase_t *, int); +static void setup1(struct testcase_t *, int); +static void setup2(struct testcase_t *, int); +static void setup3(struct testcase_t *, int); +static void setup4(struct testcase_t *, int); +static void cleanup1(struct testcase_t *); +static void cleanup4(struct testcase_t *); + +struct testcase_t tdat[] = { + { + .msg = "invalid fd", + .fd = -1, + .exp_ret = -1, + .exp_errno = EBADF, + .setup = setup0, + }, + { + .msg = "regular file fd", + .exp_ret = -1, + .exp_errno = EINVAL, + .setup = setup1, + .cleanup = cleanup1 + }, + { + .msg = "invalid ns_type", + .ns_type = -1, + .exp_ret = -1, + .exp_errno = EINVAL, + .setup = setup2, + }, + { + .msg = "mismatch ns_type/fd", + .exp_ret = -1, + .exp_errno = EINVAL, + .setup = setup3, + }, + { + .msg = "without CAP_SYS_ADMIN", + .exp_ret = -1, + .exp_errno = EPERM, + .setup = setup4, + .cleanup = cleanup4, + } +}; + +static int TST_TOTAL = sizeof(tdat) / sizeof(tdat[0]); +static const char nobody_uid[] = "nobody"; +static struct passwd *ltpuser; + +static void setup0(struct testcase_t *t, int i) +{ + t->ns_type = ns_types[i]; +} + +static void setup1(struct testcase_t *t, int i) +{ + t->ns_type = ns_types[i]; + t->fd = open("dummy", O_RDWR|O_CREAT, 0600); + if (t->fd == -1) + tst_brkm(TFAIL|TERRNO, cleanup, "setup1:open failed"); + unlink("dummy"); +} + +static void cleanup1(struct testcase_t *t) +{ + close(t->fd); +} + +static void setup2(struct testcase_t *t, int i) +{ + t->fd = ns_fds[i]; +} + +static void setup3(struct testcase_t *t, int i) +{ + if (ns_total < 2) { + t->skip = 1; + return; + } + + t->fd = ns_fds[i]; + t->ns_type = ns_types[(i+1) % ns_total]; +} + +static void setup4(struct testcase_t *t, int i) +{ + if (seteuid(ltpuser->pw_uid) == -1) + tst_brkm(TBROK | TERRNO, NULL, "seteuid failed"); + + t->fd = ns_fds[i]; + t->ns_type = ns_types[i]; +} + +static void cleanup4(struct testcase_t *t) +{ + if (seteuid(0) == -1) + tst_brkm(TBROK | TERRNO, NULL, "seteuid restore failed"); +} + +static void test_setns(struct testcase_t *t) +{ + int ret, i; + + for (i = 0; i < ns_total; i++) { + if (t->setup) + t->setup(t, i); + + if (t->skip) { + tst_resm(TINFO, "skip %s", tdat->msg); + continue; + } + + tst_resm(TINFO, "setns(%d, 0x%x)", t->fd, t->ns_type); + ret = syscall(__NR_setns, t->fd, t->ns_type); + if (ret == t->exp_ret) { + if (ret == -1 && errno == t->exp_errno) + tst_resm(TPASS, "%s exp_errno=%d", t->msg, + t->exp_errno); + else + tst_resm(TFAIL|TERRNO, "%s exp_errno=%d", + t->msg, t->exp_errno); + } else { + tst_resm(TFAIL, "%s ret=%d expected=%d", t->msg, + ret, t->exp_ret); + } + + if (t->cleanup) + t->cleanup(t); + } +} + +int main(int argc, char *argv[]) +{ + int lc, testno; + char *msg; + + msg = parse_opts(argc, argv, NULL, NULL); + if (msg != NULL) + tst_brkm(TBROK, tst_exit, "OPTION PARSING ERROR - %s", msg); + + setup(); + for (lc = 0; TEST_LOOPING(lc); lc++) { + for (testno = 0; testno < TST_TOTAL; testno++) + test_setns(&tdat[testno]); + } + cleanup(); + tst_exit(); +} + +static void setup(void) +{ + tst_require_root(NULL); + + /* runtime check if syscall is supported */ + ltp_syscall(__NR_setns, -1, 0); + + init_available_ns(); + if (ns_total == 0) + tst_brkm(TCONF, NULL, "no ns types/proc entries"); + + ltpuser = getpwnam(nobody_uid); + if (ltpuser == NULL) + tst_brkm(TBROK | TERRNO, NULL, "getpwnam failed"); + + + tst_tmpdir(); + TEST_PAUSE; +} + +static void cleanup(void) +{ + close_ns_fds(); + tst_rmdir(); + TEST_CLEANUP; +} +#else +int main(int argc, char *argv[]) +{ + tst_brkm(TCONF, NULL, "__NR_setns is not defined on your system."); + +} +#endif diff --git a/testcases/kernel/syscalls/setns/setns02.c b/testcases/kernel/syscalls/setns/setns02.c new file mode 100644 index 0000000..2033980 --- /dev/null +++ b/testcases/kernel/syscalls/setns/setns02.c @@ -0,0 +1,231 @@ +/* + * Copyright (C) 2013 Linux Test Project, Inc. + * + * This program is free software; you can redistribute it and/or + * modify it under the terms of version 2 of the GNU General Public + * License as published by the Free Software Foundation. + * + * This program is distributed in the hope that it would be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. + * + * Further, this software is distributed without any warranty that it + * is free of the rightful claim of any third person regarding + * infringement or the like. Any license provided herein, whether + * implied or otherwise, applies only to this software file. Patent + * licenses, if any, provided herein do not apply to combinations of + * this program with other software, or any other product whatsoever. + * + * You should have received a copy of the GNU General Public License + * along with this program; if not, write the Free Software + * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA + * 02110-1301, USA. + */ +/* + * functional test for setns(2) - reassociate thread with a namespace + * 1. create child with CLONE_NEWUTS, set different hostname in child, + * set namespace back to parent ns and check that hostname has changed + * 2. create child with CLONE_NEWIPC, set up shared memory in parent + * and verify that child can't shmat it, then set namespace + * back to parent one and verify that child is able to do shmat + */ +#define _GNU_SOURCE +#include <sys/ipc.h> +#include <sys/shm.h> +#include <sys/stat.h> +#include <sys/syscall.h> +#include <sys/types.h> +#include <sys/utsname.h> +#include <sys/wait.h> +#include <errno.h> +#include <sched.h> +#include <string.h> +#include "config.h" +#include "test.h" +#include "usctest.h" +#include "linux_syscall_numbers.h" +#include "safe_macros.h" + +#define CHILD_STACK_SIZE (1024*1024) +#define CP "(child) " +char *TCID = "setns02"; + +#if defined(__NR_setns) && defined(CLONE_NEWIPC) && defined(CLONE_NEWUTS) +#include "setns.h" + +static char *dummy_hostname = "setns_dummy_uts"; +static int ns_ipc_fd; +static int ns_uts_fd; +static key_t ipc_key; +static int shmid; + +static void setup(void); +static void cleanup(void); + +static int do_child_newuts(void *arg) +{ + struct utsname uts, uts_parent; + int ns_flag = *(int *)arg; + + if (uname(&uts_parent) == -1) + tst_resm(TFAIL|TERRNO, CP"uname"); + tst_resm(TINFO, CP"hostname (inherited from parent): %s", + uts_parent.nodename); + + if (sethostname(dummy_hostname, strlen(dummy_hostname)) == -1) + tst_resm(TFAIL|TERRNO, CP"sethostname"); + if (uname(&uts) == -1) + tst_resm(TFAIL|TERRNO, CP"uname"); + + tst_resm(TINFO, CP"hostname changed to: %s", uts.nodename); + if (strcmp(uts_parent.nodename, uts.nodename) == 0) { + tst_resm(TFAIL, CP"expected hostname to be different"); + return 1; + } else { + tst_resm(TPASS, CP"hostname is different in parent/child"); + } + + tst_resm(TINFO, CP"attempting to switch ns back to parent ns"); + if (syscall(__NR_setns, ns_uts_fd, ns_flag) == -1) { + tst_resm(TFAIL|TERRNO, CP"setns"); + return 2; + } + if (uname(&uts) == -1) + tst_resm(TFAIL|TERRNO, CP"uname"); + + tst_resm(TINFO, CP"hostname: %s", uts.nodename); + if (strcmp(uts_parent.nodename, uts.nodename) != 0) { + tst_resm(TFAIL, CP"expected hostname to match parent"); + return 3; + } else { + tst_resm(TPASS, CP"hostname now as expected"); + } + return 0; +} + +static int do_child_newipc(void *arg) +{ + void *p; + int ns_flag = *(int *)arg; + + p = shmat(shmid, NULL, 0); + if (p == (void *) -1) { + tst_resm(TPASS|TERRNO, CP"shmat failed as expected"); + } else { + tst_resm(TFAIL, CP"shmat unexpectedly suceeded"); + shmdt(p); + return 1; + } + + tst_resm(TINFO, CP"attempting to switch ns back to parent ns"); + if (syscall(__NR_setns, ns_ipc_fd, ns_flag) == -1) { + tst_resm(TFAIL|TERRNO, CP"setns"); + return 2; + } + + p = shmat(shmid, NULL, 0); + if (p == (void *) -1) { + tst_resm(TFAIL|TERRNO, CP"shmat failed after setns"); + return 3; + } else { + tst_resm(TPASS, CP"shmat suceeded"); + shmdt(p); + } + + return 0; +} + +static void test_flag(int clone_flag, int ns_flag, int (*fn) (void *arg)) +{ + void *child_stack; + int ret, status; + + child_stack = malloc(CHILD_STACK_SIZE); + if (child_stack == NULL) + tst_brkm(TBROK, cleanup, "Cannot allocate stack for child"); + + tst_resm(TINFO, "creating child with clone_flag=0x%x, ns_flag=0x%x", + clone_flag, ns_flag); + ret = ltp_clone(SIGCHLD|clone_flag, fn, &ns_flag, + CHILD_STACK_SIZE, child_stack); + if (ret == -1) + tst_brkm(TBROK|TERRNO, cleanup, "ltp_clone"); + + if (waitpid(ret, &status, 0) == -1) + tst_brkm(TBROK|TERRNO, cleanup, "waitpid"); + if (!WIFEXITED(status) || WEXITSTATUS(status) != 0) + tst_resm(TFAIL, "child returns %d", status); + else + tst_resm(TPASS, "child finished succesfully"); + free(child_stack); +} + +int main(int argc, char *argv[]) +{ + int lc; + char *msg; + + msg = parse_opts(argc, argv, NULL, NULL); + if (msg != NULL) + tst_brkm(TBROK, tst_exit, "OPTION PARSING ERROR - %s", msg); + + setup(); + for (lc = 0; TEST_LOOPING(lc); lc++) { + if (ns_uts_fd != -1) { + tst_resm(TINFO, "test_newuts"); + test_flag(CLONE_NEWUTS, CLONE_NEWUTS, do_child_newuts); + test_flag(CLONE_NEWUTS, 0, do_child_newuts); + } + if (ns_ipc_fd != -1) { + tst_resm(TINFO, "test_newipc"); + test_flag(CLONE_NEWIPC, CLONE_NEWIPC, do_child_newipc); + test_flag(CLONE_NEWIPC, 0, do_child_newipc); + } + } + cleanup(); + tst_exit(); +} + +static void setup(void) +{ + char tmp[PATH_MAX]; + + tst_require_root(NULL); + + /* runtime check if syscall is supported */ + ltp_syscall(__NR_setns, -1, 0); + + /* check if kernel has CONFIG_*_NS set and exports /proc entries */ + ns_ipc_fd = get_ns_fd(getpid(), "ipc"); + ns_uts_fd = get_ns_fd(getpid(), "uts"); + if (ns_ipc_fd == -1 && ns_uts_fd == -1) + tst_brkm(TCONF, NULL, "your kernel has CONFIG_IPC_NS, " + "CONFIG_UTS_NS or CONFIG_PROC disabled"); + + if (getcwd(tmp, PATH_MAX) == NULL) + tst_brkm(TBROK|TERRNO, NULL, "getcwd"); + ipc_key = ftok(tmp, 65); + shmid = shmget(ipc_key, getpagesize(), IPC_CREAT | 0666); + if (shmid == -1) + tst_brkm(TBROK|TERRNO, NULL, "shmget"); + + TEST_PAUSE; +} + +static void cleanup(void) +{ + if (ns_ipc_fd != -1) + close(ns_ipc_fd); + if (ns_uts_fd != -1) + close(ns_uts_fd); + + shmctl(shmid, IPC_RMID, NULL); + TEST_CLEANUP; +} +#else +int main(int argc, char *argv[]) +{ + tst_brkm(TCONF, NULL, "__NR_setns, CLONE_NEWIPC or CLONE_NEWUTS " + " is not defined on your system."); +} +#endif diff --git a/testcases/open_posix_testsuite/conformance/interfaces/kill/1-2.c b/testcases/open_posix_testsuite/conformance/interfaces/kill/1-2.c index 26580ec..18aad8a 100644 --- a/testcases/open_posix_testsuite/conformance/interfaces/kill/1-2.c +++ b/testcases/open_posix_testsuite/conformance/interfaces/kill/1-2.c @@ -1,10 +1,3 @@ -#include <signal.h> -#include <stdio.h> -#include <stdlib.h> -#include <unistd.h> -#include <sys/wait.h> -#include "posixtest.h" - /* * Copyright (c) 2002-2003, Intel Corporation. All rights reserved. * Created by: julie.n.fleischer REMOVE-THIS AT intel DOT com @@ -31,6 +24,13 @@ * the parent's signal. If that is not the case, this test will fail. */ +#include <signal.h> +#include <stdio.h> +#include <stdlib.h> +#include <unistd.h> +#include <sys/wait.h> +#include "posixtest.h" + #define SIGTOTEST SIGUSR1 void myhandler(int signo) @@ -44,16 +44,19 @@ int main() int sig; sigset_t set; + if (sigemptyset(&set) == -1) { perror("Error calling sigemptyset\n"); return PTS_UNRESOLVED; } + if (sigaddset(&set, SIGTOTEST) == -1) { perror("Error calling sigaddset\n"); return PTS_UNRESOLVED; } - if ((pid = fork()) == 0) { + pid = fork(); + if (pid == 0) { /* child here */ struct sigaction act; act.sa_handler = myhandler; @@ -62,16 +65,18 @@ int main() sigaction(SIGTOTEST, &act, 0); if (0 != sigwait(&set, &sig)) { - printf - ("Sigwait did not return 0. Possible problem with sigwait function\n"); - return 0; /* FAIL */ + printf("Sigwait did not return 0." + "Possible problem with sigwait function\n"); + /* FAIL */ + return 0; } if (sig != SIGTOTEST) - return 0; /* FAIL */ + /* FAIL */ + return 0; return 1; - } else { + } else if (pid > 0) { /* parent here */ int i; @@ -95,6 +100,10 @@ int main() printf("Test FAILED\n"); return PTS_FAIL; } + + } else { + printf("Error fork() a child\n"); + return PTS_UNRESOLVED; } printf("Should have exited from parent\n"); hooks/post-receive -- ltp |
From: Cyril H. <su...@li...> - 2013-02-18 03:56:31
|
The branch, master, has been updated via 359980f68b19c77c698b121b57a071dfe6e3ca31 (commit) from 3eca5e3f01d5807c4919f47fcfec4b4155dc04e4 (commit) - Log ----------------------------------------------------------------- commit 359980f68b19c77c698b121b57a071dfe6e3ca31 Author: Jan Stancek <jst...@re...> Date: Fri Feb 15 10:16:05 2013 +0100 rename syscall() macro to ltp_syscall() This patch renames syscall() macro defined in linux_syscall_numbers.h to reduce confusion with syscall(2). It also updates all places where it was previously in use. Signed-off-by: Jan Stancek <jst...@re...> Signed-off-by: Wanlong Gao <gao...@cn...> ----------------------------------------------------------------------- Summary of changes: testcases/kernel/containers/libclone/libclone.c | 2 +- testcases/kernel/containers/mqns/mqns_01.c | 11 +++---- testcases/kernel/containers/mqns/mqns_02.c | 6 ++-- testcases/kernel/containers/mqns/mqns_03.c | 5 +-- testcases/kernel/containers/mqns/mqns_04.c | 5 +-- .../kernel/containers/netns/check_netns_enabled.c | 2 +- testcases/kernel/containers/pidns/pidns30.c | 12 ++++---- testcases/kernel/containers/pidns/pidns31.c | 12 ++++---- .../controllers/cpuset/cpuset_lib/libcpuset.c | 7 +++-- .../cpuset_syscall_test/cpuset_syscall_test.c | 7 +++-- testcases/kernel/include/linux_syscall_numbers.h | 2 +- testcases/kernel/include/regen.sh | 2 +- testcases/kernel/lib/numa_helper.c | 2 +- .../performance_counters/performance_counter01.c | 4 +- .../performance_counters/performance_counter02.c | 2 +- testcases/kernel/syscalls/accept4/accept4_01.c | 4 +- testcases/kernel/syscalls/add_key/add_key01.c | 2 +- testcases/kernel/syscalls/add_key/add_key02.c | 11 ++++--- testcases/kernel/syscalls/bdflush/bdflush01.c | 2 +- .../kernel/syscalls/cacheflush/cacheflush01.c | 6 ++-- testcases/kernel/syscalls/capget/capget01.c | 2 +- testcases/kernel/syscalls/capget/capget02.c | 2 +- testcases/kernel/syscalls/capset/capset01.c | 6 +--- testcases/kernel/syscalls/capset/capset02.c | 6 +--- .../kernel/syscalls/clock_getres/clock_getres01.c | 6 +++- .../clock_nanosleep2/clock_nanosleep2_01.c | 2 +- testcases/kernel/syscalls/dup3/dup3_01.c | 4 +- .../syscalls/epoll_create1/epoll_create1_01.c | 4 +- testcases/kernel/syscalls/eventfd/eventfd01.c | 2 +- testcases/kernel/syscalls/eventfd2/eventfd2_01.c | 4 +- testcases/kernel/syscalls/eventfd2/eventfd2_02.c | 4 +- testcases/kernel/syscalls/eventfd2/eventfd2_03.c | 2 +- .../kernel/syscalls/exit_group/exit_group01.c | 2 +- testcases/kernel/syscalls/faccessat/faccessat01.c | 2 +- testcases/kernel/syscalls/fallocate/fallocate01.c | 4 +- testcases/kernel/syscalls/fallocate/fallocate02.c | 4 +- testcases/kernel/syscalls/fallocate/fallocate03.c | 4 +- testcases/kernel/syscalls/fchmodat/fchmodat01.c | 2 +- testcases/kernel/syscalls/fchownat/fchownat01.c | 2 +- testcases/kernel/syscalls/fstatat/fstatat01.c | 6 ++-- testcases/kernel/syscalls/futimesat/futimesat01.c | 2 +- .../syscalls/get_mempolicy/get_mempolicy01.c | 29 ++++++++++--------- .../syscalls/get_robust_list/get_robust_list01.c | 11 +++---- testcases/kernel/syscalls/getegid/compat_16.h | 2 +- testcases/kernel/syscalls/geteuid/compat_16.h | 2 +- testcases/kernel/syscalls/getgid/compat_16.h | 4 +- testcases/kernel/syscalls/getuid/compat_16.h | 4 +- .../syscalls/inotify_init/inotify_init1_01.c | 4 +- .../syscalls/inotify_init/inotify_init1_02.c | 4 +- testcases/kernel/syscalls/keyctl/keyctl01.c | 7 +++-- testcases/kernel/syscalls/linkat/linkat01.c | 2 +- testcases/kernel/syscalls/mbind/mbind01.c | 14 +++++----- .../syscalls/migrate_pages/migrate_pages01.c | 20 +++++++------- .../syscalls/migrate_pages/migrate_pages02.c | 7 +++-- testcases/kernel/syscalls/mkdirat/mkdirat01.c | 2 +- testcases/kernel/syscalls/mknodat/mknodat01.c | 2 +- testcases/kernel/syscalls/mq_open/mq_open01.c | 2 +- testcases/kernel/syscalls/newuname/newuname01.c | 2 +- testcases/kernel/syscalls/openat/openat01.c | 2 +- testcases/kernel/syscalls/pipe2/pipe2_01.c | 4 +- testcases/kernel/syscalls/pipe2/pipe2_02.c | 4 +- testcases/kernel/syscalls/ppoll/ppoll01.c | 3 +- testcases/kernel/syscalls/quotactl/quotactl01.c | 5 +-- testcases/kernel/syscalls/readahead/readahead01.c | 10 +++--- testcases/kernel/syscalls/readahead/readahead02.c | 5 ++- .../kernel/syscalls/readlinkat/readlinkat01.c | 2 +- testcases/kernel/syscalls/renameat/renameat01.c | 2 +- .../kernel/syscalls/rt_sigaction/rt_sigaction01.c | 2 +- .../kernel/syscalls/rt_sigaction/rt_sigaction02.c | 2 +- .../kernel/syscalls/rt_sigaction/rt_sigaction03.c | 2 +- .../syscalls/rt_sigprocmask/rt_sigprocmask01.c | 10 +++--- .../syscalls/rt_sigprocmask/rt_sigprocmask02.c | 2 +- .../syscalls/rt_sigqueueinfo/rt_sigqueueinfo01.c | 4 +- .../syscalls/rt_sigsuspend/rt_sigsuspend01.c | 11 ++++--- .../syscalls/set_thread_area/set_thread_area01.c | 2 +- .../syscalls/set_tid_address/set_tid_address01.c | 2 +- testcases/kernel/syscalls/setgid/compat_16.h | 2 +- testcases/kernel/syscalls/setgroups/compat_16.h | 2 +- testcases/kernel/syscalls/sgetmask/sgetmask01.c | 8 +++-- testcases/kernel/syscalls/signalfd/signalfd01.c | 2 +- testcases/kernel/syscalls/signalfd4/signalfd4_01.c | 5 ++- testcases/kernel/syscalls/signalfd4/signalfd4_02.c | 5 ++- .../kernel/syscalls/sigwaitinfo/sigwaitinfo01.c | 2 +- testcases/kernel/syscalls/splice/splice01.c | 3 +- testcases/kernel/syscalls/splice/splice02.c | 3 +- testcases/kernel/syscalls/ssetmask/ssetmask01.c | 6 ++-- testcases/kernel/syscalls/swapoff/swapoff01.c | 4 +- testcases/kernel/syscalls/swapoff/swapoff02.c | 9 +++--- testcases/kernel/syscalls/swapon/swapon01.c | 4 +- testcases/kernel/syscalls/swapon/swapon02.c | 10 ++++--- testcases/kernel/syscalls/swapon/swapon03.c | 11 ++++--- testcases/kernel/syscalls/symlinkat/symlinkat01.c | 2 +- .../syscalls/sync_file_range/sync_file_range01.c | 11 ++++--- testcases/kernel/syscalls/tee/tee01.c | 5 ++- .../syscalls/timer_getoverrun/timer_getoverrun01.c | 7 +++-- .../syscalls/timer_gettime/timer_gettime01.c | 8 +++--- testcases/kernel/syscalls/timerfd/timerfd01.c | 6 ++-- testcases/kernel/syscalls/timerfd/timerfd02.c | 5 ++- testcases/kernel/syscalls/timerfd/timerfd03.c | 5 ++- testcases/kernel/syscalls/tkill/tkill01.c | 4 +- testcases/kernel/syscalls/tkill/tkill02.c | 2 +- testcases/kernel/syscalls/unlinkat/unlinkat01.c | 2 +- testcases/kernel/syscalls/utimensat/utimensat01.c | 2 +- testcases/kernel/syscalls/vmsplice/vmsplice01.c | 5 ++- .../kernel/timers/clock_gettime/clock_gettime02.c | 2 +- .../kernel/timers/clock_gettime/clock_gettime03.c | 2 +- .../kernel/timers/clock_settime/clock_settime02.c | 4 +- .../kernel/timers/clock_settime/clock_settime03.c | 6 ++-- .../kernel/timers/timer_create/timer_create02.c | 5 ++- .../kernel/timers/timer_create/timer_create03.c | 2 +- .../kernel/timers/timer_create/timer_create04.c | 2 +- .../kernel/timers/timer_delete/timer_delete02.c | 6 ++-- .../kernel/timers/timer_delete/timer_delete03.c | 2 +- .../kernel/timers/timer_settime/timer_settime02.c | 6 ++-- .../kernel/timers/timer_settime/timer_settime03.c | 4 +- 115 files changed, 285 insertions(+), 266 deletions(-) diff --git a/testcases/kernel/containers/libclone/libclone.c b/testcases/kernel/containers/libclone/libclone.c index 902f464..ebaac43 100644 --- a/testcases/kernel/containers/libclone/libclone.c +++ b/testcases/kernel/containers/libclone/libclone.c @@ -56,7 +56,7 @@ int do_unshare_tests(unsigned long clone_flags, } if (pid == 0) { close(retpipe[0]); - ret = syscall(SYS_unshare, clone_flags); + ret = ltp_syscall(SYS_unshare, clone_flags); if (ret == -1) { if (write(retpipe[1], "0", 2) < 0) { perror("unshare:write(retpipe[1], ..)"); diff --git a/testcases/kernel/containers/mqns/mqns_01.c b/testcases/kernel/containers/mqns/mqns_01.c index 5bdabf1..a8d2748 100644 --- a/testcases/kernel/containers/mqns/mqns_01.c +++ b/testcases/kernel/containers/mqns/mqns_01.c @@ -56,7 +56,7 @@ int check_mqueue(void *vtest) printf("read(p1[0], ...) failed: %s\n", strerror(errno)); exit(1); } - mqd = syscall(__NR_mq_open, NOSLASH_MQ1, O_RDONLY); + mqd = ltp_syscall(__NR_mq_open, NOSLASH_MQ1, O_RDONLY); if (mqd == -1) { if (write(p2[1], "notfnd", strlen("notfnd") + 1) < 0) { perror("write(p2[1], ...) failed"); @@ -94,9 +94,8 @@ int main(int argc, char *argv[]) tst_brkm(TBROK | TERRNO, NULL, "pipe failed"); } - mqd = - syscall(__NR_mq_open, NOSLASH_MQ1, O_RDWR | O_CREAT | O_EXCL, 0777, - NULL); + mqd = ltp_syscall(__NR_mq_open, NOSLASH_MQ1, O_RDWR | O_CREAT | O_EXCL, + 0777, NULL); if (mqd == -1) { perror("mq_open"); tst_resm(TFAIL, "mq_open failed"); @@ -109,7 +108,7 @@ int main(int argc, char *argv[]) if (r < 0) { tst_resm(TFAIL, "failed clone/unshare"); mq_close(mqd); - syscall(__NR_mq_unlink, NOSLASH_MQ1); + ltp_syscall(__NR_mq_unlink, NOSLASH_MQ1); tst_exit(); } @@ -133,7 +132,7 @@ int main(int argc, char *argv[]) if (mq_close(mqd) == -1) { tst_brkm(TBROK | TERRNO, NULL, "mq_close failed"); } - syscall(__NR_mq_unlink, NOSLASH_MQ1); + ltp_syscall(__NR_mq_unlink, NOSLASH_MQ1); tst_exit(); } diff --git a/testcases/kernel/containers/mqns/mqns_02.c b/testcases/kernel/containers/mqns/mqns_02.c index 65cff40..8fab439 100644 --- a/testcases/kernel/containers/mqns/mqns_02.c +++ b/testcases/kernel/containers/mqns/mqns_02.c @@ -61,7 +61,7 @@ int check_mqueue(void *vtest) } else { mqd = - syscall(__NR_mq_open, NOSLASH_MQ1, + ltp_syscall(__NR_mq_open, NOSLASH_MQ1, O_RDWR | O_CREAT | O_EXCL, 0777, NULL); if (mqd == -1) { if (write(p2[1], "mqfail", strlen("mqfail") + 1) < 0) { @@ -84,7 +84,7 @@ int check_mqueue(void *vtest) if (mq_close(mqd) < 0) { perror("mq_close(mqd) failed"); exit(1); - } else if (syscall(__NR_mq_unlink, + } else if (ltp_syscall(__NR_mq_unlink, NOSLASH_MQ1) < 0) { perror("mq_unlink(" NOSLASH_MQ1 ") failed"); @@ -150,7 +150,7 @@ int main(int argc, char *argv[]) tst_resm(TFAIL, "child process could not create mqueue"); umount(DEV_MQUEUE); } else { - mqd = syscall(__NR_mq_open, NOSLASH_MQ1, O_RDONLY); + mqd = ltp_syscall(__NR_mq_open, NOSLASH_MQ1, O_RDONLY); if (mqd == -1) { tst_resm(TPASS, "Parent process can't see the mqueue"); diff --git a/testcases/kernel/containers/mqns/mqns_03.c b/testcases/kernel/containers/mqns/mqns_03.c index 6650db4..f9b3cd4 100644 --- a/testcases/kernel/containers/mqns/mqns_03.c +++ b/testcases/kernel/containers/mqns/mqns_03.c @@ -68,9 +68,8 @@ int check_mqueue(void *vtest) exit(1); } - mqd = - syscall(__NR_mq_open, NOSLASH_MQ1, O_RDWR | O_CREAT | O_EXCL, 0755, - NULL); + mqd = ltp_syscall(__NR_mq_open, NOSLASH_MQ1, O_RDWR | O_CREAT | O_EXCL, + 0755, NULL); if (mqd == -1) { write(p2[1], "mqfail", 7); exit(1); diff --git a/testcases/kernel/containers/mqns/mqns_04.c b/testcases/kernel/containers/mqns/mqns_04.c index 3ecf3e5..80d25a6 100644 --- a/testcases/kernel/containers/mqns/mqns_04.c +++ b/testcases/kernel/containers/mqns/mqns_04.c @@ -61,9 +61,8 @@ int check_mqueue(void *vtest) read(p1[0], buf, 3); /* go */ - mqd = - syscall(__NR_mq_open, NOSLASH_MQ1, O_RDWR | O_CREAT | O_EXCL, 0755, - NULL); + mqd = ltp_syscall(__NR_mq_open, NOSLASH_MQ1, O_RDWR | O_CREAT | O_EXCL, + 0755, NULL); if (mqd == -1) { write(p2[1], "mqfail", 7); tst_exit(); diff --git a/testcases/kernel/containers/netns/check_netns_enabled.c b/testcases/kernel/containers/netns/check_netns_enabled.c index b60de19..ab8ee2f 100644 --- a/testcases/kernel/containers/netns/check_netns_enabled.c +++ b/testcases/kernel/containers/netns/check_netns_enabled.c @@ -45,7 +45,7 @@ int main(void) tst_resm(TBROK | TERRNO, "CLONE_NEWNET (%d) or CLONE_NEWNS (%d) not supported", CLONE_NEWNET, CLONE_NEWNS); - else if (syscall(__NR_unshare, CLONE_NEWNET | CLONE_NEWNS) == -1) + else if (ltp_syscall(__NR_unshare, CLONE_NEWNET | CLONE_NEWNS) == -1) tst_resm(TFAIL | TERRNO, "unshare syscall smoke test failed"); else tst_resm(TPASS, "unshare syscall smoke test passed"); diff --git a/testcases/kernel/containers/pidns/pidns30.c b/testcases/kernel/containers/pidns/pidns30.c index 75c736b..b29e6b7 100644 --- a/testcases/kernel/containers/pidns/pidns30.c +++ b/testcases/kernel/containers/pidns/pidns30.c @@ -93,7 +93,7 @@ static void remove_pipe(int *fd) static void remove_mqueue(mqd_t mqd) { mq_close(mqd); - syscall(__NR_mq_unlink, mqname); + ltp_syscall(__NR_mq_unlink, mqname); } static void cleanup(void) @@ -113,7 +113,7 @@ static void cleanup(void) static void cleanup_child(void) { if (mqd != -1) { - syscall(__NR_mq_notify, mqd, NULL); + ltp_syscall(__NR_mq_notify, mqd, NULL); } cleanup(); } @@ -186,7 +186,7 @@ int child_fn(void *arg) while (read(father_to_child[0], buf, 1) != 1) sleep(1); - mqd = syscall(__NR_mq_open, mqname, O_RDONLY, 0, NULL); + mqd = ltp_syscall(__NR_mq_open, mqname, O_RDONLY, 0, NULL); if (mqd == -1) { perror("mq_open failed"); return 1; @@ -197,7 +197,7 @@ int child_fn(void *arg) notif.sigev_notify = SIGEV_SIGNAL; notif.sigev_signo = SIGUSR1; notif.sigev_value.sival_int = mqd; - if (syscall(__NR_mq_notify, mqd, ¬if) == -1) { + if (ltp_syscall(__NR_mq_notify, mqd, ¬if) == -1) { perror("mq_notify failed"); return 1; } else @@ -244,7 +244,7 @@ int main(int argc, char *argv[]) tst_brkm(TBROK | TERRNO, cleanup, "pipe failed"); } - syscall(__NR_mq_unlink, mqname); + ltp_syscall(__NR_mq_unlink, mqname); /* container creation on PID namespace */ cpid = ltp_clone_quick(CLONE_NEWPID | SIGCHLD, child_fn, NULL); @@ -252,7 +252,7 @@ int main(int argc, char *argv[]) tst_brkm(TBROK | TERRNO, cleanup, "clone failed"); mqd = - syscall(__NR_mq_open, mqname, O_RDWR | O_CREAT | O_EXCL, 0777, + ltp_syscall(__NR_mq_open, mqname, O_RDWR | O_CREAT | O_EXCL, 0777, NULL); if (mqd == -1) tst_brkm(TBROK | TERRNO, cleanup, "mq_open failed"); diff --git a/testcases/kernel/containers/pidns/pidns31.c b/testcases/kernel/containers/pidns/pidns31.c index 1498d16..e87ef19 100644 --- a/testcases/kernel/containers/pidns/pidns31.c +++ b/testcases/kernel/containers/pidns/pidns31.c @@ -95,7 +95,7 @@ static void remove_pipe(int *fd) static void remove_mqueue(mqd_t mqd) { mq_close(mqd); - syscall(__NR_mq_unlink, mqname); + ltp_syscall(__NR_mq_unlink, mqname); } /* @@ -118,7 +118,7 @@ static void cleanup_resources(int step, mqd_t mqd) break; case F_STEP_2: - syscall(__NR_mq_notify, mqd, NULL); + ltp_syscall(__NR_mq_notify, mqd, NULL); /* fall through */ case F_STEP_1: remove_mqueue(mqd); @@ -177,7 +177,7 @@ int child_fn(void *arg) } tst_resm(TINFO, "cinit: my father is ready to receive a message"); - mqd = syscall(__NR_mq_open, mqname, O_WRONLY, 0, NULL); + mqd = ltp_syscall(__NR_mq_open, mqname, O_WRONLY, 0, NULL); if (mqd == (mqd_t) - 1) { tst_resm(TBROK, "cinit: mq_open() failed (%s)", strerror(errno)); @@ -261,9 +261,9 @@ int main(int argc, char *argv[]) cleanup_mqueue(TBROK, NO_STEP, 0); } - syscall(__NR_mq_unlink, mqname); + ltp_syscall(__NR_mq_unlink, mqname); mqd = - syscall(__NR_mq_open, mqname, O_RDWR | O_CREAT | O_EXCL, 0777, + ltp_syscall(__NR_mq_open, mqname, O_RDWR | O_CREAT | O_EXCL, 0777, NULL); if (mqd == (mqd_t) - 1) { tst_resm(TBROK, "parent: mq_open() failed (%s)", @@ -286,7 +286,7 @@ int main(int argc, char *argv[]) info.mqd = mqd; info.pid = cpid; notif.sigev_value.sival_ptr = &info; - if (syscall(__NR_mq_notify, mqd, ¬if) == (mqd_t) - 1) { + if (ltp_syscall(__NR_mq_notify, mqd, ¬if) == (mqd_t) -1) { tst_resm(TBROK, "parent: mq_notify() failed (%s)", strerror(errno)); cleanup_mqueue(TBROK, F_STEP_1, mqd); diff --git a/testcases/kernel/controllers/cpuset/cpuset_lib/libcpuset.c b/testcases/kernel/controllers/cpuset/cpuset_lib/libcpuset.c index b9cf67c..d2d3c12 100644 --- a/testcases/kernel/controllers/cpuset/cpuset_lib/libcpuset.c +++ b/testcases/kernel/controllers/cpuset/cpuset_lib/libcpuset.c @@ -3090,21 +3090,22 @@ done: static int sched_setaffinity(pid_t pid, unsigned len, unsigned long *mask) { - return syscall(__NR_sched_setaffinity, pid, len, mask); + return ltp_syscall(__NR_sched_setaffinity, pid, len, mask); } #if HAVE_DECL_MPOL_F_ADDR && HAVE_DECL_MPOL_F_NODE static int get_mempolicy(int *policy, unsigned long *nmask, unsigned long maxnode, void *addr, int flags) { - return syscall(__NR_get_mempolicy, policy, nmask, maxnode, addr, flags); + return ltp_syscall(__NR_get_mempolicy, policy, nmask, maxnode, + addr, flags); } #endif #if HAVE_DECL_MPOL_BIND || HAVE_DECL_MPOL_DEFAULT static int set_mempolicy(int mode, unsigned long *nmask, unsigned long maxnode) { - return syscall(__NR_set_mempolicy, mode, nmask, maxnode); + return ltp_syscall(__NR_set_mempolicy, mode, nmask, maxnode); } #endif 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 5469e9f..5c30763 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 @@ -62,7 +62,8 @@ int ret; static int get_mempolicy(int *policy, unsigned long *nmask, unsigned long maxnode, void *addr, int flags) { - return syscall(__NR_get_mempolicy, policy, nmask, maxnode, addr, flags); + return ltp_syscall(__NR_get_mempolicy, policy, nmask, maxnode, addr, + flags); } #endif @@ -70,14 +71,14 @@ static int get_mempolicy(int *policy, unsigned long *nmask, static int mbind(void *start, unsigned long len, int policy, unsigned long *nodemask, unsigned long maxnode, unsigned flags) { - return syscall(__NR_mbind, start, len, policy, nodemask, maxnode, + return ltp_syscall(__NR_mbind, start, len, policy, nodemask, maxnode, flags); } static int set_mempolicy(int policy, unsigned long *nodemask, unsigned long maxnode) { - return syscall(__NR_set_mempolicy, policy, nodemask, maxnode); + return ltp_syscall(__NR_set_mempolicy, policy, nodemask, maxnode); } #endif diff --git a/testcases/kernel/include/linux_syscall_numbers.h b/testcases/kernel/include/linux_syscall_numbers.h index 68ec70c..545b420 100644 --- a/testcases/kernel/include/linux_syscall_numbers.h +++ b/testcases/kernel/include/linux_syscall_numbers.h @@ -17,7 +17,7 @@ #include <sys/syscall.h> #include "cleanup.c" -#define syscall(NR, ...) ({ \ +#define ltp_syscall(NR, ...) ({ \ int __ret; \ if (NR == 0) { \ errno = ENOSYS; \ diff --git a/testcases/kernel/include/regen.sh b/testcases/kernel/include/regen.sh index 110f083..86cdc09 100755 --- a/testcases/kernel/include/regen.sh +++ b/testcases/kernel/include/regen.sh @@ -25,7 +25,7 @@ cat << EOF > "${output_pid}" #include <sys/syscall.h> #include "cleanup.c" -#define syscall(NR, ...) ({ \\ +#define ltp_syscall(NR, ...) ({ \\ int __ret; \\ if (NR == 0) { \\ errno = ENOSYS; \\ diff --git a/testcases/kernel/lib/numa_helper.c b/testcases/kernel/lib/numa_helper.c index 50d9e9a..4ab8e3c 100644 --- a/testcases/kernel/lib/numa_helper.c +++ b/testcases/kernel/lib/numa_helper.c @@ -83,7 +83,7 @@ static int filter_nodemask_mem(nodemask_t * nodemask, unsigned long max_node) * utility function in older versions: * http://www.spinics.net/lists/linux-numa/msg00849.html */ - if (syscall(__NR_get_mempolicy, NULL, nodemask->n, + if (ltp_syscall(__NR_get_mempolicy, NULL, nodemask->n, max_node, 0, MPOL_F_MEMS_ALLOWED) < 0) return -2; #else diff --git a/testcases/kernel/performance_counters/performance_counter01.c b/testcases/kernel/performance_counters/performance_counter01.c index 15ba337..4f56060 100644 --- a/testcases/kernel/performance_counters/performance_counter01.c +++ b/testcases/kernel/performance_counters/performance_counter01.c @@ -68,13 +68,13 @@ int main(void) unsigned long long count1, count2; int fd1, fd2, ret; - fd1 = syscall(__NR_perf_event_open, + fd1 = ltp_syscall(__NR_perf_event_open, PERF_COUNT_INSTRUCTIONS, 0, 0, 0, -1); if (fd1 < 0) { tst_brkm(TBROK | TERRNO, cleanup, "Failed to create PERF_COUNT_INSTRUCTIONS fd"); } - fd2 = syscall(__NR_perf_event_open, + fd2 = ltp_syscall(__NR_perf_event_open, PERF_COUNT_CACHE_MISSES, 0, 0, 0, -1); if (fd2 < 0) { tst_brkm(TBROK | TERRNO, cleanup, diff --git a/testcases/kernel/performance_counters/performance_counter02.c b/testcases/kernel/performance_counters/performance_counter02.c index 9f07732..5402b81 100644 --- a/testcases/kernel/performance_counters/performance_counter02.c +++ b/testcases/kernel/performance_counters/performance_counter02.c @@ -120,7 +120,7 @@ enum hw_event_types { int sys_perf_counter_open(struct perf_counter_hw_event *hw_event, pid_t pid, int cpu, int group_fd, unsigned long flags) { - return syscall(__NR_perf_event_open, hw_event, pid, cpu, group_fd, + return ltp_syscall(__NR_perf_event_open, hw_event, pid, cpu, group_fd, flags); } diff --git a/testcases/kernel/syscalls/accept4/accept4_01.c b/testcases/kernel/syscalls/accept4/accept4_01.c index 9449621..526be6e 100644 --- a/testcases/kernel/syscalls/accept4/accept4_01.c +++ b/testcases/kernel/syscalls/accept4/accept4_01.c @@ -163,9 +163,9 @@ accept4_01(int fd, struct sockaddr *sockaddr, socklen_t * addrlen, int flags) args[2] = (long)addrlen; args[3] = flags; - return syscall(__NR_socketcall, SYS_ACCEPT4, args); + return ltp_syscall(__NR_socketcall, SYS_ACCEPT4, args); #else - return syscall(__NR_accept4, fd, sockaddr, addrlen, flags); + return ltp_syscall(__NR_accept4, fd, sockaddr, addrlen, flags); #endif } #endif diff --git a/testcases/kernel/syscalls/add_key/add_key01.c b/testcases/kernel/syscalls/add_key/add_key01.c index 3920129..c31255f 100644 --- a/testcases/kernel/syscalls/add_key/add_key01.c +++ b/testcases/kernel/syscalls/add_key/add_key01.c @@ -112,7 +112,7 @@ int main(int ac, char **av) setup(); /* Call add_key. */ - TEST(syscall + TEST(ltp_syscall (__NR_add_key, "keyring", "wjkey", NULL, 0, KEY_SPEC_THREAD_KEYRING)); if (TEST_RETURN == -1) diff --git a/testcases/kernel/syscalls/add_key/add_key02.c b/testcases/kernel/syscalls/add_key/add_key02.c index dc8fec1..591fa0c 100644 --- a/testcases/kernel/syscalls/add_key/add_key02.c +++ b/testcases/kernel/syscalls/add_key/add_key02.c @@ -136,11 +136,12 @@ int main(int ac, char **av) for (i = 0; i < test_count; i++) { /* Call add_key. */ - TEST(syscall(__NR_add_key, test_cases[i].type, - test_cases[i].desc, - test_cases[i].payload, - test_cases[i].plen, - KEY_SPEC_USER_KEYRING)); + TEST(ltp_syscall(__NR_add_key, + test_cases[i].type, + test_cases[i].desc, + test_cases[i].payload, + test_cases[i].plen, + KEY_SPEC_USER_KEYRING)); if (TEST_RETURN != -1) { tst_resm(TINFO, diff --git a/testcases/kernel/syscalls/bdflush/bdflush01.c b/testcases/kernel/syscalls/bdflush/bdflush01.c index e424558..a0441a3 100644 --- a/testcases/kernel/syscalls/bdflush/bdflush01.c +++ b/testcases/kernel/syscalls/bdflush/bdflush01.c @@ -120,7 +120,7 @@ int main(int ac, char **av) data = 0; Tst_count = 1; for (testno = 0; testno < TST_TOTAL; ++testno) { - TEST(syscall(__NR_bdflush, 3, data)); + TEST(ltp_syscall(__NR_bdflush, 3, data)); if (TEST_RETURN == -1) tst_brkm(TFAIL | TTERRNO, cleanup, "bdflush failed"); else diff --git a/testcases/kernel/syscalls/cacheflush/cacheflush01.c b/testcases/kernel/syscalls/cacheflush/cacheflush01.c index 1ec2f5d..c197b74 100644 --- a/testcases/kernel/syscalls/cacheflush/cacheflush01.c +++ b/testcases/kernel/syscalls/cacheflush/cacheflush01.c @@ -143,21 +143,21 @@ int main(int ac, char **av) } /* Invokes cacheflush() with proper parameters */ - TEST(syscall(__NR_cacheflush, addr, getpagesize(), ICACHE)); + TEST(ltp_syscall(__NR_cacheflush, addr, getpagesize(), ICACHE)); if (TEST_RETURN == 0) { tst_resm(TPASS, "passed with no errno"); } else { tst_resm(TFAIL, "failed with unexpected errno"); } - TEST(syscall(__NR_cacheflush, addr, getpagesize(), DCACHE)); + TEST(ltp_syscall(__NR_cacheflush, addr, getpagesize(), DCACHE)); if (TEST_RETURN == 0) { tst_resm(TPASS, "passed with no errno"); } else { tst_resm(TFAIL, "failed with unexpected errno"); } - TEST(syscall(__NR_cacheflush, addr, getpagesize(), BCACHE)); + TEST(ltp_syscall(__NR_cacheflush, addr, getpagesize(), BCACHE)); if (TEST_RETURN == 0) { tst_resm(TPASS, "passed with no errno"); } else { diff --git a/testcases/kernel/syscalls/capget/capget01.c b/testcases/kernel/syscalls/capget/capget01.c index af934ff..0b66c1c 100644 --- a/testcases/kernel/syscalls/capget/capget01.c +++ b/testcases/kernel/syscalls/capget/capget01.c @@ -100,7 +100,7 @@ int main(int ac, char **av) Tst_count = 0; - TEST(syscall(__NR_capget, &header, &data)); + TEST(ltp_syscall(__NR_capget, &header, &data)); if (TEST_RETURN == 0) { tst_resm(TPASS, "capget() returned %ld", TEST_RETURN); diff --git a/testcases/kernel/syscalls/capget/capget02.c b/testcases/kernel/syscalls/capget/capget02.c index d41ed42..6fc955e 100644 --- a/testcases/kernel/syscalls/capget/capget02.c +++ b/testcases/kernel/syscalls/capget/capget02.c @@ -137,7 +137,7 @@ int main(int ac, char **av) for (i = 0; i < TST_TOTAL; ++i) { test_setup(i); - TEST(syscall(__NR_capget, test_cases[i].headerp, + TEST(ltp_syscall(__NR_capget, test_cases[i].headerp, test_cases[i].datap)); if (TEST_RETURN == -1 && diff --git a/testcases/kernel/syscalls/capset/capset01.c b/testcases/kernel/syscalls/capset/capset01.c index e9e3df1..09b37d2 100644 --- a/testcases/kernel/syscalls/capset/capset01.c +++ b/testcases/kernel/syscalls/capset/capset01.c @@ -111,7 +111,7 @@ int main(int ac, char **av) Tst_count = 0; - TEST(syscall(__NR_capset, &header, &data)); + TEST(ltp_syscall(__NR_capset, &header, &data)); if (TEST_RETURN == 0) { tst_resm(TPASS, "capset() returned %ld", TEST_RETURN); @@ -139,10 +139,8 @@ void setup() header.version = _LINUX_CAPABILITY_VERSION; header.pid = 0; - if (syscall(__NR_capget, &header, &data) == -1) { + if (ltp_syscall(__NR_capget, &header, &data) == -1) tst_brkm(TBROK | TERRNO, NULL, "capget() failed"); - } - } void cleanup() diff --git a/testcases/kernel/syscalls/capset/capset02.c b/testcases/kernel/syscalls/capset/capset02.c index e0c5246..b51594e 100644 --- a/testcases/kernel/syscalls/capset/capset02.c +++ b/testcases/kernel/syscalls/capset/capset02.c @@ -155,7 +155,7 @@ int main(int ac, char **av) for (; i < TST_TOTAL; i++) { test_setup(i, av[0]); - TEST(syscall(__NR_capset, test_cases[i].headerp, + TEST(ltp_syscall(__NR_capset, test_cases[i].headerp, test_cases[i].datap)); if (TEST_RETURN == -1 && @@ -188,10 +188,8 @@ void setup() * header.version must be _LINUX_CAPABILITY_VERSION */ header.version = _LINUX_CAPABILITY_VERSION; - if (syscall(__NR_capget, &header, &data) == -1) { + if (ltp_syscall(__NR_capget, &header, &data) == -1) tst_brkm(TBROK | TERRNO, NULL, "capget failed"); - } - } void cleanup() diff --git a/testcases/kernel/syscalls/clock_getres/clock_getres01.c b/testcases/kernel/syscalls/clock_getres/clock_getres01.c index 38512c7..63c25a1 100644 --- a/testcases/kernel/syscalls/clock_getres/clock_getres01.c +++ b/testcases/kernel/syscalls/clock_getres/clock_getres01.c @@ -215,9 +215,11 @@ static int do_test(struct test_case *tc) */ errno = 0; if (tc->ttype == NULL_POINTER) - TEST(sys_ret = syscall(__NR_clock_getres, tc->clk_id, NULL)); + TEST(sys_ret = ltp_syscall(__NR_clock_getres, tc->clk_id, + NULL)); else - TEST(sys_ret = syscall(__NR_clock_getres, tc->clk_id, &res)); + TEST(sys_ret = ltp_syscall(__NR_clock_getres, tc->clk_id, + &res)); sys_errno = errno; /* diff --git a/testcases/kernel/syscalls/clock_nanosleep2/clock_nanosleep2_01.c b/testcases/kernel/syscalls/clock_nanosleep2/clock_nanosleep2_01.c index 18be1aa..d1c3527 100644 --- a/testcases/kernel/syscalls/clock_nanosleep2/clock_nanosleep2_01.c +++ b/testcases/kernel/syscalls/clock_nanosleep2/clock_nanosleep2_01.c @@ -113,7 +113,7 @@ const clockid_t CLOCK_TO_USE = CLOCK_MONOTONIC; static int clock_nanosleep2(clockid_t clock_id, int flags, const struct timespec *req, struct timespec *rem) { - return syscall(__NR_clock_nanosleep, clock_id, flags, req, rem); + return ltp_syscall(__NR_clock_nanosleep, clock_id, flags, req, rem); } int main(int ac, char **av) diff --git a/testcases/kernel/syscalls/dup3/dup3_01.c b/testcases/kernel/syscalls/dup3/dup3_01.c index 657e6f7..8113f85 100644 --- a/testcases/kernel/syscalls/dup3/dup3_01.c +++ b/testcases/kernel/syscalls/dup3/dup3_01.c @@ -130,7 +130,7 @@ int main(int argc, char *argv[]) "This test can only run on kernels that are 2.6.27 and higher"); setup(); - fd = syscall(__NR_dup3, 1, 4, 0); + fd = ltp_syscall(__NR_dup3, 1, 4, 0); if (fd == -1) { tst_brkm(TFAIL | TERRNO, cleanup, "dup3(0) failed"); } @@ -143,7 +143,7 @@ int main(int argc, char *argv[]) } close(fd); - fd = syscall(__NR_dup3, 1, 4, O_CLOEXEC); + fd = ltp_syscall(__NR_dup3, 1, 4, O_CLOEXEC); if (fd == -1) { tst_brkm(TFAIL | TERRNO, cleanup, "dup3(O_CLOEXEC) failed"); } diff --git a/testcases/kernel/syscalls/epoll_create1/epoll_create1_01.c b/testcases/kernel/syscalls/epoll_create1/epoll_create1_01.c index 0282aee..9780321 100644 --- a/testcases/kernel/syscalls/epoll_create1/epoll_create1_01.c +++ b/testcases/kernel/syscalls/epoll_create1/epoll_create1_01.c @@ -139,7 +139,7 @@ int main(int argc, char *argv[]) setup(); - fd = syscall(__NR_epoll_create1, 0); + fd = ltp_syscall(__NR_epoll_create1, 0); if (fd == -1) { tst_brkm(TFAIL, cleanup, "epoll_create1(0) failed"); } @@ -152,7 +152,7 @@ int main(int argc, char *argv[]) "epoll_create1(0) set close-on-exec flag"); } close(fd); - fd = syscall(__NR_epoll_create1, EPOLL_CLOEXEC); + fd = ltp_syscall(__NR_epoll_create1, EPOLL_CLOEXEC); if (fd == -1) { tst_brkm(TFAIL, cleanup, "epoll_create1(EPOLL_CLOEXEC) failed"); } diff --git a/testcases/kernel/syscalls/eventfd/eventfd01.c b/testcases/kernel/syscalls/eventfd/eventfd01.c index b75843a..31c992d 100644 --- a/testcases/kernel/syscalls/eventfd/eventfd01.c +++ b/testcases/kernel/syscalls/eventfd/eventfd01.c @@ -74,7 +74,7 @@ int TST_TOTAL = 15; static int myeventfd(unsigned int initval, int flags) { /* eventfd2 uses FLAGS but eventfd doesn't take FLAGS. */ - return syscall(__NR_eventfd, initval); + return ltp_syscall(__NR_eventfd, initval); } /* diff --git a/testcases/kernel/syscalls/eventfd2/eventfd2_01.c b/testcases/kernel/syscalls/eventfd2/eventfd2_01.c index 5b0dd5a..e417597 100644 --- a/testcases/kernel/syscalls/eventfd2/eventfd2_01.c +++ b/testcases/kernel/syscalls/eventfd2/eventfd2_01.c @@ -138,7 +138,7 @@ int main(int argc, char *argv[]) } setup(); - fd = syscall(__NR_eventfd2, 1, 0); + fd = ltp_syscall(__NR_eventfd2, 1, 0); if (fd == -1) { tst_brkm(TFAIL, cleanup, "eventfd2(0) failed"); } @@ -151,7 +151,7 @@ int main(int argc, char *argv[]) } close(fd); - fd = syscall(__NR_eventfd2, 1, EFD_CLOEXEC); + fd = ltp_syscall(__NR_eventfd2, 1, EFD_CLOEXEC); if (fd == -1) { tst_brkm(TFAIL, cleanup, "eventfd2(EFD_CLOEXEC) failed"); } diff --git a/testcases/kernel/syscalls/eventfd2/eventfd2_02.c b/testcases/kernel/syscalls/eventfd2/eventfd2_02.c index 66e80f5..eb120a9 100644 --- a/testcases/kernel/syscalls/eventfd2/eventfd2_02.c +++ b/testcases/kernel/syscalls/eventfd2/eventfd2_02.c @@ -136,7 +136,7 @@ int main(int argc, char *argv[]) setup(); Tst_count = 0; - fd = syscall(__NR_eventfd2, 1, 0); + fd = ltp_syscall(__NR_eventfd2, 1, 0); if (fd == -1) { tst_brkm(TFAIL, cleanup, "eventfd2(0) failed"); } @@ -149,7 +149,7 @@ int main(int argc, char *argv[]) } close(fd); - fd = syscall(__NR_eventfd2, 1, EFD_NONBLOCK); + fd = ltp_syscall(__NR_eventfd2, 1, EFD_NONBLOCK); if (fd == -1) { tst_brkm(TFAIL, cleanup, "eventfd2(EFD_NONBLOCK) failed"); } diff --git a/testcases/kernel/syscalls/eventfd2/eventfd2_03.c b/testcases/kernel/syscalls/eventfd2/eventfd2_03.c index 375907e..59c6686 100644 --- a/testcases/kernel/syscalls/eventfd2/eventfd2_03.c +++ b/testcases/kernel/syscalls/eventfd2/eventfd2_03.c @@ -54,7 +54,7 @@ void cleanup() static int eventfd2(int count, int flags) { - return syscall(__NR_eventfd2, count, flags); + return ltp_syscall(__NR_eventfd2, count, flags); } static void xsem_wait(int fd) diff --git a/testcases/kernel/syscalls/exit_group/exit_group01.c b/testcases/kernel/syscalls/exit_group/exit_group01.c index 5802603..4db694c 100644 --- a/testcases/kernel/syscalls/exit_group/exit_group01.c +++ b/testcases/kernel/syscalls/exit_group/exit_group01.c @@ -118,7 +118,7 @@ int main(int ac, char **av) tst_brkm(TFAIL | TERRNO, cleanup, "fork failed"); } else if (cpid == 0) { sleep(5); - TEST(syscall(__NR_exit_group, 4)); + TEST(ltp_syscall(__NR_exit_group, 4)); } else { w = wait(&status); if (w == -1) diff --git a/testcases/kernel/syscalls/faccessat/faccessat01.c b/testcases/kernel/syscalls/faccessat/faccessat01.c index 76b1c79..45be493 100644 --- a/testcases/kernel/syscalls/faccessat/faccessat01.c +++ b/testcases/kernel/syscalls/faccessat/faccessat01.c @@ -78,7 +78,7 @@ int expected_errno[TEST_CASES] = { 0, 0, ENOTDIR, EBADF, 0, 0 }; int myfaccessat(int dirfd, const char *filename, int mode) { - return syscall(__NR_faccessat, dirfd, filename, mode); + return ltp_syscall(__NR_faccessat, dirfd, filename, mode); } int main(int ac, char **av) diff --git a/testcases/kernel/syscalls/fallocate/fallocate01.c b/testcases/kernel/syscalls/fallocate/fallocate01.c index d3cef1d..6270e37 100644 --- a/testcases/kernel/syscalls/fallocate/fallocate01.c +++ b/testcases/kernel/syscalls/fallocate/fallocate01.c @@ -244,13 +244,13 @@ int main(int ac, char **av) static inline long fallocate(int fd, int mode, loff_t offset, loff_t len) { #if __WORDSIZE == 32 - return (long)syscall(__NR_fallocate, fd, mode, + return (long)ltp_syscall(__NR_fallocate, fd, mode, __LONG_LONG_PAIR((off_t) (offset >> 32), (off_t) offset), __LONG_LONG_PAIR((off_t) (len >> 32), (off_t) len)); #else - return syscall(__NR_fallocate, fd, mode, offset, len); + return ltp_syscall(__NR_fallocate, fd, mode, offset, len); #endif } diff --git a/testcases/kernel/syscalls/fallocate/fallocate02.c b/testcases/kernel/syscalls/fallocate/fallocate02.c index c4578f8..b26ef70 100644 --- a/testcases/kernel/syscalls/fallocate/fallocate02.c +++ b/testcases/kernel/syscalls/fallocate/fallocate02.c @@ -235,13 +235,13 @@ void populate_file() static inline long fallocate(int fd, int mode, loff_t offset, loff_t len) { #if __WORDSIZE == 32 - return (long)syscall(__NR_fallocate, fd, mode, + return (long)ltp_syscall(__NR_fallocate, fd, mode, __LONG_LONG_PAIR((off_t) (offset >> 32), (off_t) offset), __LONG_LONG_PAIR((off_t) (len >> 32), (off_t) len)); #else - return syscall(__NR_fallocate, fd, mode, offset, len); + return ltp_syscall(__NR_fallocate, fd, mode, offset, len); #endif } diff --git a/testcases/kernel/syscalls/fallocate/fallocate03.c b/testcases/kernel/syscalls/fallocate/fallocate03.c index 2d81a36..ac044e0 100644 --- a/testcases/kernel/syscalls/fallocate/fallocate03.c +++ b/testcases/kernel/syscalls/fallocate/fallocate03.c @@ -230,13 +230,13 @@ void populate_file() static inline long fallocate(int fd, int mode, loff_t offset, loff_t len) { #if __WORDSIZE == 32 - return (long)syscall(__NR_fallocate, fd, mode, + return (long)ltp_syscall(__NR_fallocate, fd, mode, __LONG_LONG_PAIR((off_t) (offset >> 32), (off_t) offset), __LONG_LONG_PAIR((off_t) (len >> 32), (off_t) len)); #else - return syscall(__NR_fallocate, fd, mode, offset, len); + return ltp_syscall(__NR_fallocate, fd, mode, offset, len); #endif } diff --git a/testcases/kernel/syscalls/fchmodat/fchmodat01.c b/testcases/kernel/syscalls/fchmodat/fchmodat01.c index ba66e8c..2100eb8 100644 --- a/testcases/kernel/syscalls/fchmodat/fchmodat01.c +++ b/testcases/kernel/syscalls/fchmodat/fchmodat01.c @@ -78,7 +78,7 @@ int expected_errno[TEST_CASES] = { 0, 0, ENOTDIR, EBADF, 0, 0 }; int myfchmodat(int dirfd, const char *filename, mode_t mode) { - return syscall(__NR_fchmodat, dirfd, filename, mode); + return ltp_syscall(__NR_fchmodat, dirfd, filename, mode); } int main(int ac, char **av) diff --git a/testcases/kernel/syscalls/fchownat/fchownat01.c b/testcases/kernel/syscalls/fchownat/fchownat01.c index e7fbf12..7b3e8f2 100644 --- a/testcases/kernel/syscalls/fchownat/fchownat01.c +++ b/testcases/kernel/syscalls/fchownat/fchownat01.c @@ -83,7 +83,7 @@ gid_t gid; int myfchownat(int dirfd, const char *filename, uid_t owner, gid_t group, int flags) { - return syscall(__NR_fchownat, dirfd, filename, owner, group, flags); + return ltp_syscall(__NR_fchownat, dirfd, filename, owner, group, flags); } int main(int ac, char **av) diff --git a/testcases/kernel/syscalls/fstatat/fstatat01.c b/testcases/kernel/syscalls/fstatat/fstatat01.c index 54adf6f..7fea942 100644 --- a/testcases/kernel/syscalls/fstatat/fstatat01.c +++ b/testcases/kernel/syscalls/fstatat/fstatat01.c @@ -93,18 +93,18 @@ struct stat statbuf; int myfstatat(int dirfd, const char *filename, struct stat64 *statbuf, int flags) { - return syscall(__NR_fstatat64, dirfd, filename, statbuf, flags); + return ltp_syscall(__NR_fstatat64, dirfd, filename, statbuf, flags); } #elif (defined __NR_newfstatat) && (__NR_newfstatat != 0) int myfstatat(int dirfd, const char *filename, struct stat *statbuf, int flags) { - return syscall(__NR_newfstatat, dirfd, filename, statbuf, flags); + return ltp_syscall(__NR_newfstatat, dirfd, filename, statbuf, flags); } #else /* stub - will never run */ int myfstatat(int dirfd, const char *filename, struct stat *statbuf, int flags) { - return syscall(0, dirfd, filename, statbuf, flags); + return ltp_syscall(0, dirfd, filename, statbuf, flags); } #endif diff --git a/testcases/kernel/syscalls/futimesat/futimesat01.c b/testcases/kernel/syscalls/futimesat/futimesat01.c index 5a96f66..2aa8dfb 100644 --- a/testcases/kernel/syscalls/futimesat/futimesat01.c +++ b/testcases/kernel/syscalls/futimesat/futimesat01.c @@ -80,7 +80,7 @@ struct timeval times[2]; int myfutimesat(int dirfd, const char *filename, struct timeval *times) { - return syscall(__NR_futimesat, dirfd, filename, times); + return ltp_syscall(__NR_futimesat, dirfd, filename, times); } int main(int ac, char **av) diff --git a/testcases/kernel/syscalls/get_mempolicy/get_mempolicy01.c b/testcases/kernel/syscalls/get_mempolicy/get_mempolicy01.c index e51639d..f9b6232 100644 --- a/testcases/kernel/syscalls/get_mempolicy/get_mempolicy01.c +++ b/testcases/kernel/syscalls/get_mempolicy/get_mempolicy01.c @@ -251,14 +251,15 @@ static int do_test(struct test_case *tc) flags = 0; p = NULL; if (tc->from_node == NONE) - TEST(syscall(__NR_set_mempolicy, tc->policy, NULL, 0)); + TEST(ltp_syscall(__NR_set_mempolicy, tc->policy, + NULL, 0)); else #if !defined(LIBNUMA_API_VERSION) || LIBNUMA_API_VERSION < 2 - TEST(syscall(__NR_set_mempolicy, tc->policy, - nodemask, maxnode)); + TEST(ltp_syscall(__NR_set_mempolicy, tc->policy, + nodemask, maxnode)); #else - TEST(syscall(__NR_set_mempolicy, tc->policy, - nodemask->maskp, nodemask->size)); + TEST(ltp_syscall(__NR_set_mempolicy, tc->policy, + nodemask->maskp, nodemask->size)); #endif if (TEST_RETURN < 0) { tst_resm(TBROK | TERRNO, "set_mempolicy"); @@ -273,15 +274,15 @@ static int do_test(struct test_case *tc) if (p == MAP_FAILED) tst_brkm(TBROK | TERRNO, cleanup, "mmap"); if (tc->from_node == NONE) - TEST(syscall(__NR_mbind, p, len, tc->policy, - NULL, 0, 0)); + TEST(ltp_syscall(__NR_mbind, p, len, tc->policy, + NULL, 0, 0)); else #if !defined(LIBNUMA_API_VERSION) || LIBNUMA_API_VERSION < 2 - TEST(syscall(__NR_mbind, p, len, tc->policy, - nodemask, maxnode, 0)); + TEST(ltp_syscall(__NR_mbind, p, len, tc->policy, + nodemask, maxnode, 0)); #else - TEST(syscall(__NR_mbind, p, len, tc->policy, - nodemask->maskp, nodemask->size, 0)); + TEST(ltp_syscall(__NR_mbind, p, len, tc->policy, + nodemask->maskp, nodemask->size, 0)); #endif if (TEST_RETURN < 0) { tst_resm(TBROK | TERRNO, "mbind"); @@ -301,10 +302,10 @@ static int do_test(struct test_case *tc) errno = 0; cmp_ok = 1; #if !defined(LIBNUMA_API_VERSION) || LIBNUMA_API_VERSION < 2 - TEST(ret = syscall(__NR_get_mempolicy, &policy, getnodemask, + TEST(ret = ltp_syscall(__NR_get_mempolicy, &policy, getnodemask, maxnode, p, flags)); #else - TEST(ret = syscall(__NR_get_mempolicy, &policy, getnodemask->maskp, + TEST(ret = ltp_syscall(__NR_get_mempolicy, &policy, getnodemask->maskp, getnodemask->size, p, flags)); #endif err = TEST_ERRNO; @@ -339,7 +340,7 @@ static void cleanup(void) static void setup(void) { /* check syscall availability */ - syscall(__NR_get_mempolicy, NULL, NULL, 0, NULL, 0); + ltp_syscall(__NR_get_mempolicy, NULL, NULL, 0, NULL, 0); TEST_PAUSE; tst_tmpdir(); 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 4300588..d3ab244 100644 --- a/testcases/kernel/syscalls/get_robust_list/get_robust_list01.c +++ b/testcases/kernel/syscalls/get_robust_list/get_robust_list01.c @@ -78,7 +78,6 @@ int main(int argc, char **argv) char *msg; struct robust_list_head head; size_t len_ptr; /* size of structure struct robust_list_head */ - int retval; if ((msg = parse_opts(argc, argv, NULL, NULL)) != NULL) tst_brkm(TBROK, NULL, "OPTION PARSING ERROR - %s", msg); @@ -98,7 +97,7 @@ int main(int argc, char **argv) * argument. */ - TEST(retval = syscall(__NR_get_robust_list, 0, + TEST(ltp_syscall(__NR_get_robust_list, 0, (struct robust_list_head *)&head, (size_t *) NULL)); @@ -114,7 +113,7 @@ int main(int argc, char **argv) tst_resm(TFAIL, "get_robust_list succeeded unexpectedly"); - TEST(retval = syscall(__NR_get_robust_list, 0, + TEST(ltp_syscall(__NR_get_robust_list, 0, (struct robust_list_head **)NULL, &len_ptr)); @@ -135,7 +134,7 @@ int main(int argc, char **argv) * find the task specified by the pid argument. */ - TEST(retval = syscall(__NR_get_robust_list, UINT16_MAX, + TEST(ltp_syscall(__NR_get_robust_list, UINT16_MAX, (struct robust_list_head *)&head, &len_ptr)); @@ -151,7 +150,7 @@ int main(int argc, char **argv) tst_resm(TFAIL, "get_robust_list succeeded unexpectedly"); - TEST(retval = syscall(__NR_get_robust_list, 0, + TEST(ltp_syscall(__NR_get_robust_list, 0, (struct robust_list_head **)&head, &len_ptr)); @@ -164,7 +163,7 @@ int main(int argc, char **argv) if (setuid(1) == -1) tst_brkm(TBROK | TERRNO, cleanup, "setuid(1) failed"); - TEST(retval = syscall(__NR_get_robust_list, 1, + TEST(ltp_syscall(__NR_get_robust_list, 1, (struct robust_list_head *)&head, &len_ptr)); diff --git a/testcases/kernel/syscalls/getegid/compat_16.h b/testcases/kernel/syscalls/getegid/compat_16.h index 054ed19..a28289b 100644 --- a/testcases/kernel/syscalls/getegid/compat_16.h +++ b/testcases/kernel/syscalls/getegid/compat_16.h @@ -32,7 +32,7 @@ GID_T GETEGID(void) { - return syscall(__NR_getegid); + return ltp_syscall(__NR_getegid); } #else diff --git a/testcases/kernel/syscalls/geteuid/compat_16.h b/testcases/kernel/syscalls/geteuid/compat_16.h index 733ada5..9436cd5 100644 --- a/testcases/kernel/syscalls/geteuid/compat_16.h +++ b/testcases/kernel/syscalls/geteuid/compat_16.h @@ -32,7 +32,7 @@ UID_T GETEUID(void) { - return syscall(__NR_geteuid); + return ltp_syscall(__NR_geteuid); } #else diff --git a/testcases/kernel/syscalls/getgid/compat_16.h b/testcases/kernel/syscalls/getgid/compat_16.h index 9561a3d..249e270 100644 --- a/testcases/kernel/syscalls/getgid/compat_16.h +++ b/testcases/kernel/syscalls/getgid/compat_16.h @@ -32,13 +32,13 @@ GID_T GETGID(void) { - return syscall(__NR_getgid); + return ltp_syscall(__NR_getgid); } GID_T GETEGID(void) { - return syscall(__NR_getegid); + return ltp_syscall(__NR_getegid); } #else diff --git a/testcases/kernel/syscalls/getuid/compat_16.h b/testcases/kernel/syscalls/getuid/compat_16.h index 4b0c88a..db6f332 100644 --- a/testcases/kernel/syscalls/getuid/compat_16.h +++ b/testcases/kernel/syscalls/getuid/compat_16.h @@ -32,13 +32,13 @@ UID_T GETUID(void) { - return syscall(__NR_getuid); + return ltp_syscall(__NR_getuid); } UID_T GETEUID(void) { - return syscall(__NR_geteuid); + return ltp_syscall(__NR_geteuid); } #else diff --git a/testcases/kernel/syscalls/inotify_init/inotify_init1_01.c b/testcases/kernel/syscalls/inotify_init/inotify_init1_01.c index cf94652..08b4c12 100644 --- a/testcases/kernel/syscalls/inotify_init/inotify_init1_01.c +++ b/testcases/kernel/syscalls/inotify_init/inotify_init1_01.c @@ -148,7 +148,7 @@ int main(int argc, char *argv[]) for (lc = 0; TEST_LOOPING(lc); ++lc) { Tst_count = 0; for (testno = 0; testno < TST_TOTAL; ++testno) { - fd = syscall(__NR_inotify_init1, 0); + fd = ltp_syscall(__NR_inotify_init1, 0); if (fd == -1) { tst_brkm(TFAIL | TERRNO, cleanup, "inotify_init1(0) failed"); @@ -164,7 +164,7 @@ int main(int argc, char *argv[]) } close(fd); - fd = syscall(__NR_inotify_init1, IN_CLOEXEC); + fd = ltp_syscall(__NR_inotify_init1, IN_CLOEXEC); if (fd == -1) { tst_brkm(TFAIL | TERRNO, cleanup, "inotify_init1(IN_CLOEXEC) failed"); diff --git a/testcases/kernel/syscalls/inotify_init/inotify_init1_02.c b/testcases/kernel/syscalls/inotify_init/inotify_init1_02.c index a574650..0b80685 100644 --- a/testcases/kernel/syscalls/inotify_init/inotify_init1_02.c +++ b/testcases/kernel/syscalls/inotify_init/inotify_init1_02.c @@ -143,7 +143,7 @@ int main(int argc, char *argv[]) for (lc = 0; TEST_LOOPING(lc); ++lc) { Tst_count = 0; for (testno = 0; testno < TST_TOTAL; ++testno) { - fd = syscall(__NR_inotify_init1, 0); + fd = ltp_syscall(__NR_inotify_init1, 0); if (fd == -1) { tst_brkm(TFAIL | TERRNO, cleanup, "inotify_init1(0) failed"); @@ -160,7 +160,7 @@ int main(int argc, char *argv[]) } close(fd); - fd = syscall(__NR_inotify_init1, IN_NONBLOCK); + fd = ltp_syscall(__NR_inotify_init1, IN_NONBLOCK); if (fd == -1) { tst_brkm(TFAIL | TERRNO, cleanup, "inotify_init1(IN_NONBLOCK) failed"); diff --git a/testcases/kernel/syscalls/keyctl/keyctl01.c b/testcases/kernel/syscalls/keyctl/keyctl01.c index 9d329b5..2b7043e 100644 --- a/testcases/kernel/syscalls/keyctl/keyctl01.c +++ b/testcases/kernel/syscalls/keyctl/keyctl01.c @@ -136,7 +136,7 @@ int main(int ac, char **av) for (testno = 1; testno < TST_TOTAL; ++testno) { /* Call keyctl() and ask for a keyring's ID. */ - ret = syscall(__NR_keyctl, KEYCTL_GET_KEYRING_ID, + ret = ltp_syscall(__NR_keyctl, KEYCTL_GET_KEYRING_ID, KEY_SPEC_USER_SESSION_KEYRING); if (ret != -1) { tst_resm(TPASS, @@ -147,13 +147,14 @@ int main(int ac, char **av) } for (ne_key = INT32_MAX; ne_key > INT32_MIN; ne_key--) { - ret = syscall(__NR_keyctl, KEYCTL_READ, ne_key); + ret = ltp_syscall(__NR_keyctl, KEYCTL_READ, + ne_key); if (ret == -1 && errno == ENOKEY) break; } /* Call keyctl. */ - ret = syscall(__NR_keyctl, KEYCTL_REVOKE, ne_key); + ret = ltp_syscall(__NR_keyctl, KEYCTL_REVOKE, ne_key); if (ret != -1) { tst_resm(TFAIL | TERRNO, "KEYCTL_REVOKE succeeded unexpectedly"); diff --git a/testcases/kernel/syscalls/linkat/linkat01.c b/testcases/kernel/syscalls/linkat/linkat01.c index a1f435f..15e584f 100644 --- a/testcases/kernel/syscalls/linkat/linkat01.c +++ b/testcases/kernel/syscalls/linkat/linkat01.c @@ -203,7 +203,7 @@ int TST_TOTAL = sizeof(test_desc) / sizeof(*test_desc); static int mylinkat(int olddirfd, const char *oldfilename, int newdirfd, const char *newfilename, int flags) { - return syscall(__NR_linkat, olddirfd, oldfilename, newdirfd, + return ltp_syscall(__NR_linkat, olddirfd, oldfilename, newdirfd, newfilename, flags); } diff --git a/testcases/kernel/syscalls/mbind/mbind01.c b/testcases/kernel/syscalls/mbind/mbind01.c index 7668bdf..84937cb 100644 --- a/testcases/kernel/syscalls/mbind/mbind01.c +++ b/testcases/kernel/syscalls/mbind/mbind01.c @@ -243,17 +243,17 @@ static int do_test(struct test_case *tc) errno = 0; if (tc->from_node == NONE) - TEST(ret = syscall(__NR_mbind, p, len, tc->policy, + TEST(ret = ltp_syscall(__NR_mbind, p, len, tc->policy, NULL, 0, tc->flags)); else if (tc->ttype == INVALID_POINTER) - TEST(ret = syscall(__NR_mbind, p, len, tc->policy, + TEST(ret = ltp_syscall(__NR_mbind, p, len, tc->policy, invalid_nodemask, maxnode, tc->flags)); else #if !defined(LIBNUMA_API_VERSION) || LIBNUMA_API_VERSION < 2 - TEST(ret = syscall(__NR_mbind, p, len, tc->policy, + TEST(ret = ltp_syscall(__NR_mbind, p, len, tc->policy, nodemask, maxnode, tc->flags)); #else - TEST(ret = syscall(__NR_mbind, p, len, tc->policy, + TEST(ret = ltp_syscall(__NR_mbind, p, len, tc->policy, nodemask->maskp, nodemask->size, tc->flags)); #endif @@ -263,10 +263,10 @@ static int do_test(struct test_case *tc) /* Check policy of the allocated memory */ #if !defined(LIBNUMA_API_VERSION) || LIBNUMA_API_VERSION < 2 - TEST(syscall(__NR_get_mempolicy, &policy, getnodemask, + TEST(ltp_syscall(__NR_get_mempolicy, &policy, getnodemask, maxnode, p, MPOL_F_ADDR)); #else - TEST(syscall(__NR_get_mempolicy, &policy, getnodemask->maskp, + TEST(ltp_syscall(__NR_get_mempolicy, &policy, getnodemask->maskp, getnodemask->size, p, MPOL_F_ADDR)); #endif if (TEST_RETURN < 0) { @@ -300,7 +300,7 @@ TEST_END: static void setup(void) { /* check syscall availability */ - syscall(__NR_mbind, NULL, 0, 0, NULL, 0, 0); + ltp_syscall(__NR_mbind, NULL, 0, 0, NULL, 0, 0); TEST_PAUSE; tst_tmpdir(); diff --git a/testcases/kernel/syscalls/migrate_pages/migrate_pages01.c b/testcases/kernel/syscalls/migrate_pages/migrate_pages01.c index fb68b38..3896001 100644 --- a/testcases/kernel/syscalls/migrate_pages/migrate_pages01.c +++ b/testcases/kernel/syscalls/migrate_pages/migrate_pages01.c @@ -68,7 +68,7 @@ static void cleanup(void); static void test_sane_nodes(void) { tst_resm(TINFO, "test_empty_mask"); - TEST(syscall(__NR_migrate_pages, 0, sane_max_node, + TEST(ltp_syscall(__NR_migrate_pages, 0, sane_max_node, sane_old_nodes, sane_new_nodes)); check_ret(0); } @@ -81,7 +81,7 @@ static void test_invalid_pid(void) pid_t invalid_pid = -1; tst_resm(TINFO, "test_invalid_pid -1"); - TEST(syscall(__NR_migrate_pages, invalid_pid, sane_max_node, + TEST(ltp_syscall(__NR_migrate_pages, invalid_pid, sane_max_node, sane_old_nodes, sane_new_nodes)); check_ret(-1); check_errno(ESRCH); @@ -94,7 +94,7 @@ static void test_invalid_pid(void) tst_brkm(TBROK, cleanup, "Could not read %s", pid_max); fclose(fp); invalid_pid = atol(buff) + 1; - TEST(syscall(__NR_migrate_pages, invalid_pid, sane_max_node, + TEST(ltp_syscall(__NR_migrate_pages, invalid_pid, sane_max_node, sane_old_nodes, sane_new_nodes)); check_ret(-1); check_errno(ESRCH); @@ -103,7 +103,7 @@ static void test_invalid_pid(void) static void test_invalid_masksize(void) { tst_resm(TINFO, "test_invalid_masksize"); - TEST(syscall(__NR_migrate_pages, 0, -1, sane_old_nodes, + TEST(ltp_syscall(__NR_migrate_pages, 0, -1, sane_old_nodes, sane_new_nodes)); check_ret(-1); check_errno(EINVAL); @@ -114,7 +114,7 @@ static void test_invalid_mem(void) unsigned long *p; tst_resm(TINFO, "test_invalid_mem -1"); - TEST(syscall(__NR_migrate_pages, 0, sane_max_node, -1, -1)); + TEST(ltp_syscall(__NR_migrate_pages, 0, sane_max_node, -1, -1)); check_ret(-1); check_errno(EFAULT); @@ -123,14 +123,14 @@ static void test_invalid_mem(void) MAP_PRIVATE | MAP_ANONYMOUS, 0, 0); if (p == MAP_FAILED) tst_brkm(TBROK | TERRNO, cleanup, "mmap"); - TEST(syscall(__NR_migrate_pages, 0, sane_max_node, p, p)); + TEST(ltp_syscall(__NR_migrate_pages, 0, sane_max_node, p, p)); check_ret(-1); check_errno(EFAULT); if (munmap(p, getpagesize()) < 0) tst_brkm(TBROK | TERRNO, cleanup, "munmap"); tst_resm(TINFO, "test_invalid_mem unmmaped"); - TEST(syscall(__NR_migrate_pages, 0, sane_max_node, p, p)); + TEST(ltp_syscall(__NR_migrate_pages, 0, sane_max_node, p, p)); check_ret(-1); check_errno(EFAULT); } @@ -159,7 +159,7 @@ static void test_invalid_nodes(void) memset(new_nodes, 0, sane_nodemask_size); set_bit(new_nodes, invalid_node, 1); - TEST(syscall(__NR_migrate_pages, 0, sane_max_node, + TEST(ltp_syscall(__NR_migrate_pages, 0, sane_max_node, old_nodes, new_nodes)); check_ret(-1); check_errno(EINVAL); @@ -196,7 +196,7 @@ static void test_invalid_perm(void) if (setuid(ltpuser->pw_uid) == -1) tst_brkm(TBROK | TERRNO, NULL, "setuid(%u) failed", ltpuser->pw_uid); - TEST(syscall(__NR_migrate_pages, parent_pid, + TEST(ltp_syscall(__NR_migrate_pages, parent_pid, sane_max_node, sane_old_nodes, sane_new_nodes)); ret |= check_ret(-1); ret |= check_errno(EPERM); @@ -237,7 +237,7 @@ static void setup(void) int node, ret; tst_require_root(NULL); - TEST(syscall(__NR_migrate_pages, 0, 0, NULL, NULL)); + TEST(ltp_syscall(__NR_migrate_pages, 0, 0, NULL, NULL)); if (numa_available() == -1) tst_brkm(TCONF, NULL, "NUMA not available"); diff --git a/testcases/kernel/syscalls/migrate_pages/migrate_pages02.c b/testcases/kernel/syscalls/migrate_pages/migrate_pages02.c index 12affab..1eadc49 100644 --- a/testcases/kernel/syscalls/migrate_pages/migrate_pages02.c +++ b/testcases/kernel/syscalls/migrate_pages/migrate_pages02.c @@ -120,7 +120,8 @@ static int migrate_to_node(pid_t pid, int node) set_bit(old_nodes, nodes[i], 1); set_bit(new_nodes, node, 1); - TEST(syscall(__NR_migrate_pages, pid, max_node, old_nodes, new_nodes)); + TEST(ltp_syscall(__NR_migrate_pages, pid, max_node, old_nodes, + new_nodes)); if (TEST_RETURN != 0) { if (TEST_RETURN < 0) tst_resm(TFAIL | TERRNO, "migrate_pages failed " @@ -140,7 +141,7 @@ static int addr_on_node(void *addr) int node; int ret; - ret = syscall(__NR_get_mempolicy, &node, NULL, (unsigned long)0, + ret = ltp_syscall(__NR_get_mempolicy, &node, NULL, (unsigned long)0, (unsigned long)addr, MPOL_F_NODE | MPOL_F_ADDR); if (ret == -1) { tst_resm(TBROK | TERRNO, "error getting memory policy " @@ -343,7 +344,7 @@ static void setup(void) void *p; tst_require_root(NULL); - TEST(syscall(__NR_migrate_pages, 0, 0, NULL, NULL)); + TEST(ltp_syscall(__NR_migrate_pages, 0, 0, NULL, NULL)); if (numa_available() == -1) tst_brkm(TCONF, NULL, "NUMA not available"); diff --git a/testcases/kernel/syscalls/mkdirat/mkdirat01.c b/testcases/kernel/syscalls/mkdirat/mkdirat01.c index 2a11094..508c960 100644 --- a/testcases/kernel/syscalls/mkdirat/mkdirat01.c +++ b/testcases/kernel/syscalls/mkdirat/mkdirat01.c @@ -77,7 +77,7 @@ int expected_errno[TEST_CASES] = { 0, 0, ENOTDIR, EBADF, 0 }; int mymkdirat(int dirfd, const char *dirname, int mode) { - return syscall(__NR_mkdirat, dirfd, dirname, mode); + return ltp_syscall(__NR_mkdirat, dirfd, dirname, mode); } int main(int ac, char **av) diff --git a/testcases/kernel/syscalls/mknodat/mknodat01.c b/testcases/kernel/syscalls/mknodat/mknodat01.c index dca8913..6cce851 100644 --- a/testcases/kernel/syscalls/mknodat/mknodat01.c +++ b/testcases/kernel/syscalls/mknodat/mknodat01.c @@ -79,7 +79,7 @@ dev_t dev; int mymknodat(int dirfd, const char *filename, mode_t mode, dev_t dev) { - return syscall(__NR_mknodat, dirfd, filename, mode, dev); + return ltp_syscall(__NR_mknodat, dirfd, filename, mode, dev); } int main(int ac, char **av) diff --git a/testcases/kernel/syscalls/mq_open/mq_open01.c b/testcases/kernel/syscalls/mq_open/mq_open01.c index 640c7bf..d7bd4ba 100644 --- a/testcases/kernel/syscalls/mq_open/mq_open01.c +++ b/testcases/kernel/syscalls/mq_open/mq_open01.c @@ -345,7 +345,7 @@ static int do_test(struct test_case *tc) fd2 = sys_ret; if (p_attr) { - TEST(rc = syscall(__NR_mq_getsetattr, fd2, NULL, &old)); + TEST(rc = ltp_syscall(__NR_mq_getsetattr, fd2, NULL, &old)); if (TEST_RETURN < 0) { tst_resm(TFAIL, "mq_getsetattr failed - errno = %d : %s", diff --git a/testcases/kernel/syscalls/newuname/newuname01.c b/testcases/kernel/syscalls/newuname/newuname01.c index db24f46..cc5c61a 100644 --- a/testcases/kernel/syscalls/newuname/newuname01.c +++ b/testcases/kernel/syscalls/newuname/newuname01.c @@ -125,7 +125,7 @@ int main(int ac, char **av) for (lc = 0; TEST_LOOPING(lc); ++lc) { Tst_count = 0; for (testno = 0; testno < TST_TOTAL; ++testno) { - TEST(syscall(__NR_uname, &name)); //call newuname() + TEST(ltp_syscall(__NR_uname, &name)); if (TEST_RETURN == -1) { tst_resm(TFAIL, "%s failed - errno = %d : %s", TCID, TEST_ERRNO, diff --git a/testcases/kernel/syscalls/openat/openat01.c b/testcases/kernel/syscalls/openat/openat01.c index 9c909df..2280b96 100644 --- a/testcases/kernel/syscalls/openat/openat01.c +++ b/testcases/kernel/syscalls/openat/openat01.c @@ -77,7 +77,7 @@ int expected_errno[TEST_CASES] = { 0, 0, ENOTDIR, EBADF, 0 }; int myopenat(int dirfd, const char *filename, int flags, int mode) { - return syscall(__NR_openat, dirfd, filename, flags, mode); + return ltp_syscall(__NR_openat, dirfd, filename, flags, mode); } int main(int ac, char **av) diff --git a/testcases/kernel/syscalls/pipe2/pipe2_01.c b/testcases/kernel/syscalls/pipe2/pipe2_01.c index 026ef3c..5601c73 100644 --- a/testcases/kernel/syscalls/pipe2/pipe2_01.c +++ b/testcases/kernel/syscalls/pipe2/pipe2_01.c @@ -157,7 +157,7 @@ int main(int argc, char *argv[]) for (lc = 0; TEST_LOOPING(lc); ++lc) { Tst_count = 0; for (testno = 0; testno < TST_TOTAL; ++testno) { - if (syscall(__NR_pipe2, fd, 0) != 0) { + if (ltp_syscall(__NR_pipe2, fd, 0) != 0) { tst_resm(TFAIL, "pipe2(0) failed"); cleanup(); tst_exit(); @@ -180,7 +180,7 @@ int main(int argc, char *argv[]) close(fd[0]); close(fd[1]); - if (syscall(__NR_pipe2, fd, O_CLOEXEC) != 0) { + if (ltp_syscall(__NR_pipe2, fd, O_CLOEXEC) != 0) { tst_resm(TFAIL, "pipe2(O_CLOEXEC) failed"); cleanup(); tst_exit(); diff --git a/testcases/kernel/syscalls/pipe2/pipe2_02.c b/testcases/kernel/syscalls/pipe2/pipe2_02.c index 26f5d9c..f172480 100644 --- a/testcases/kernel/syscalls/pipe2/pipe2_02.c +++ b/testcases/kernel/syscalls/pipe2/pipe2_02.c @@ -148,7 +148,7 @@ int main(int argc, char *argv[]) for (lc = 0; TEST_LOOPING(lc); ++lc) { Tst_count = 0; for (testno = 0; testno < TST_TOTAL; ++testno) { - if (syscall(__NR_pipe2, fds, 0) == -1) { + if (ltp_syscall(__NR_pipe2, fds, 0) == -1) { tst_resm(TFAIL, "pipe2(0) failed"); cleanup(); tst_exit(); @@ -170,7 +170,7 @@ int main(int argc, char *argv[]) close(fds[i]); } - if (syscall(__NR_pipe2, fds, O_NON... [truncated message content] |