aboutsummaryrefslogtreecommitdiffstats
path: root/tests
diff options
context:
space:
mode:
authorBjoern Brandenburg <bbb@mpi-sws.org>2015-07-27 09:05:06 -0400
committerBjoern Brandenburg <bbb@mpi-sws.org>2015-07-27 09:05:06 -0400
commit86468257446cf8639bc1e0d3b4cbe382321582a5 (patch)
treeaeb4f0585144c3fd3586a02a91f3e8d78c4a174c /tests
parent64d80eb87d7c0136ad23bf7421fac19dbe0036bd (diff)
Testcases: create PCP and DFLP locks with invalid CPU parameters
Diffstat (limited to 'tests')
-rw-r--r--tests/locks.c17
-rw-r--r--tests/pcp.c17
2 files changed, 34 insertions, 0 deletions
diff --git a/tests/locks.c b/tests/locks.c
index 6156532..be72b7c 100644
--- a/tests/locks.c
+++ b/tests/locks.c
@@ -141,6 +141,23 @@ TESTCASE(lock_dflp, P_FP,
141 SYSCALL( remove(".dflp_locks") ); 141 SYSCALL( remove(".dflp_locks") );
142} 142}
143 143
144TESTCASE(dflp_bad_cpu, P_FP,
145 "DFLP reject bad CPU parameter")
146{
147 int fd, cpu = 0xbadca5e;
148
149 SYSCALL( fd = open(".dflp_locks", O_RDONLY | O_CREAT, S_IRUSR) );
150
151 SYSCALL( sporadic_partitioned(ms2ns(10), ms2ns(100), 0) );
152 SYSCALL( task_mode(LITMUS_RT_TASK) );
153
154 SYSCALL_FAILS(EINVAL, open_dflp_sem(fd, 0, cpu) );
155
156 SYSCALL( close(fd) );
157
158 SYSCALL( remove(".dflp_locks") );
159}
160
144TESTCASE(srp_lock_mode_change, P_FP | PSN_EDF, 161TESTCASE(srp_lock_mode_change, P_FP | PSN_EDF,
145 "SRP task becomes non-RT task while holding lock") 162 "SRP task becomes non-RT task while holding lock")
146{ 163{
diff --git a/tests/pcp.c b/tests/pcp.c
index 9cafd27..9c9b6f2 100644
--- a/tests/pcp.c
+++ b/tests/pcp.c
@@ -40,6 +40,23 @@ TESTCASE(lock_pcp, P_FP,
40 SYSCALL( remove(".pcp_locks") ); 40 SYSCALL( remove(".pcp_locks") );
41} 41}
42 42
43TESTCASE(pcp_bad_cpu, P_FP,
44 "PCP reject bad CPU parameter")
45{
46 int fd, cpu = 0xbadca5e;
47
48 SYSCALL( fd = open(".pcp_locks", O_RDONLY | O_CREAT, S_IRUSR) );
49
50 SYSCALL( sporadic_partitioned(ms2ns(10), ms2ns(100), 0) );
51 SYSCALL( task_mode(LITMUS_RT_TASK) );
52
53 SYSCALL_FAILS(EINVAL, open_pcp_sem(fd, 0, cpu) );
54
55 SYSCALL( close(fd) );
56
57 SYSCALL( remove(".pcp_locks") );
58}
59
43TESTCASE(pcp_inheritance, P_FP, 60TESTCASE(pcp_inheritance, P_FP,
44 "PCP priority inheritance") 61 "PCP priority inheritance")
45{ 62{