plars | 865695b | 2001-08-27 22:15:12 +0000 | [diff] [blame] | 1 | /* |
| 2 | * |
| 3 | * Copyright (c) International Business Machines Corp., 2001 |
| 4 | * |
| 5 | * This program is free software; you can redistribute it and/or modify |
| 6 | * it under the terms of the GNU General Public License as published by |
| 7 | * the Free Software Foundation; either version 2 of the License, or |
| 8 | * (at your option) any later version. |
| 9 | * |
| 10 | * This program is distributed in the hope that it will be useful, |
| 11 | * but WITHOUT ANY WARRANTY; without even the implied warranty of |
| 12 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See |
| 13 | * the GNU General Public License for more details. |
| 14 | * |
| 15 | * You should have received a copy of the GNU General Public License |
| 16 | * along with this program; if not, write to the Free Software |
Wanlong Gao | 4548c6c | 2012-10-19 18:03:36 +0800 | [diff] [blame] | 17 | * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA |
plars | 865695b | 2001-08-27 22:15:12 +0000 | [diff] [blame] | 18 | */ |
| 19 | |
| 20 | /* |
| 21 | * NAME |
subrata_modak | 56207ce | 2009-03-23 13:35:39 +0000 | [diff] [blame] | 22 | * fcntl16.c |
plars | 865695b | 2001-08-27 22:15:12 +0000 | [diff] [blame] | 23 | * |
| 24 | * DESCRIPTION |
subrata_modak | 56207ce | 2009-03-23 13:35:39 +0000 | [diff] [blame] | 25 | * Additional file locking test cases for checking proper notifictaion |
| 26 | * of processes on lock change |
plars | 865695b | 2001-08-27 22:15:12 +0000 | [diff] [blame] | 27 | * |
| 28 | * ALGORITHM |
subrata_modak | 56207ce | 2009-03-23 13:35:39 +0000 | [diff] [blame] | 29 | * Various test cases are used to lock a file opened without mandatory |
| 30 | * locking, with madatory locking and mandatory locking with NOBLOCK. |
| 31 | * Checking that processes waiting on lock boundaries are notified |
| 32 | * properly when boundaries change |
plars | 865695b | 2001-08-27 22:15:12 +0000 | [diff] [blame] | 33 | * |
| 34 | * USAGE |
nstraz | fa31d55 | 2002-05-14 16:50:06 +0000 | [diff] [blame] | 35 | * fcntl16 |
plars | 865695b | 2001-08-27 22:15:12 +0000 | [diff] [blame] | 36 | * |
| 37 | * HISTORY |
| 38 | * 07/2001 Ported by Wayne Boyer |
robbiew | 4644c7e | 2002-04-26 14:33:32 +0000 | [diff] [blame] | 39 | * 04/2002 wjhuie sigset cleanups |
plars | 865695b | 2001-08-27 22:15:12 +0000 | [diff] [blame] | 40 | * |
| 41 | * RESTRICTIONS |
subrata_modak | 56207ce | 2009-03-23 13:35:39 +0000 | [diff] [blame] | 42 | * None |
plars | 865695b | 2001-08-27 22:15:12 +0000 | [diff] [blame] | 43 | */ |
| 44 | |
| 45 | #include <fcntl.h> |
plars | 865695b | 2001-08-27 22:15:12 +0000 | [diff] [blame] | 46 | #include <signal.h> |
| 47 | #include <errno.h> |
Garrett Cooper | 0a643cb | 2010-12-21 11:21:19 -0800 | [diff] [blame] | 48 | #include "test.h" |
robbiew | 5aab8a7 | 2003-03-26 18:05:30 +0000 | [diff] [blame] | 49 | #include <sys/stat.h> |
| 50 | #include <sys/types.h> |
mridge | db63921 | 2005-01-04 21:04:11 +0000 | [diff] [blame] | 51 | #include <sys/wait.h> |
plars | 865695b | 2001-08-27 22:15:12 +0000 | [diff] [blame] | 52 | |
Xiong Zhou | a2d860c | 2014-08-26 03:01:26 -0400 | [diff] [blame] | 53 | #include "tst_fs_type.h" |
| 54 | |
mridge | db63921 | 2005-01-04 21:04:11 +0000 | [diff] [blame] | 55 | #define SKIPVAL 0x0f00 |
subrata_modak | 56207ce | 2009-03-23 13:35:39 +0000 | [diff] [blame] | 56 | //#define SKIP SKIPVAL, 0, 0L, 0L, IGNORED |
mridge | 1902af9 | 2005-01-11 16:01:53 +0000 | [diff] [blame] | 57 | #define SKIP 0,0,0L,0L,0 |
mridge | db63921 | 2005-01-04 21:04:11 +0000 | [diff] [blame] | 58 | #if (SKIPVAL == F_RDLCK) || (SKIPVAL == F_WRLCK) |
| 59 | #error invalid SKIP, must not be F_RDLCK or F_WRLCK |
| 60 | #endif |
plars | 865695b | 2001-08-27 22:15:12 +0000 | [diff] [blame] | 61 | |
| 62 | #define IGNORED 0 |
| 63 | #define NOBLOCK 2 /* immediate success */ |
| 64 | #define WILLBLOCK 3 /* blocks, succeeds, parent unlocks records */ |
| 65 | #define TIME_OUT 10 |
Xiong Zhou | a2d860c | 2014-08-26 03:01:26 -0400 | [diff] [blame] | 66 | int NO_NFS = 1; /* Test on NFS or not */ |
plars | 865695b | 2001-08-27 22:15:12 +0000 | [diff] [blame] | 67 | |
| 68 | typedef struct { |
Cyril Hrubis | b87a83c | 2013-11-07 12:05:25 +0100 | [diff] [blame] | 69 | struct flock parent_a; |
| 70 | struct flock parent_b; |
| 71 | struct flock child_a; |
| 72 | struct flock child_b; |
| 73 | struct flock parent_c; |
| 74 | struct flock parent_d; |
plars | 865695b | 2001-08-27 22:15:12 +0000 | [diff] [blame] | 75 | } testcase; |
| 76 | |
| 77 | static testcase testcases[] = { |
| 78 | /* #1 Parent_a making a write lock on entire file */ |
subrata_modak | 56207ce | 2009-03-23 13:35:39 +0000 | [diff] [blame] | 79 | {{F_WRLCK, 0, 0L, 0L, IGNORED}, |
| 80 | /* Parent_b skipped */ |
| 81 | {SKIP}, |
| 82 | /* Child_a read lock on byte 1 to byte 5 */ |
| 83 | {F_RDLCK, 0, 0L, 5L, NOBLOCK}, |
| 84 | /* Child_b read lock on byte 6 to byte 10 */ |
| 85 | {F_RDLCK, 0, 6L, 5L, NOBLOCK}, |
| 86 | /* |
| 87 | * Parent_c read lock on entire file |
| 88 | */ |
| 89 | {F_RDLCK, 0, 0L, 0L, IGNORED}, |
| 90 | /* Parent_d skipped */ |
| 91 | {SKIP},}, |
plars | 865695b | 2001-08-27 22:15:12 +0000 | [diff] [blame] | 92 | |
| 93 | /* #2 Parent_a making a write lock on entire file */ |
| 94 | {{F_WRLCK, 0, 0L, 0L, IGNORED}, |
subrata_modak | 56207ce | 2009-03-23 13:35:39 +0000 | [diff] [blame] | 95 | /* Parent_b skipped */ |
| 96 | {SKIP}, |
| 97 | /* Child_a read lock on byte 1 to byte 5 */ |
| 98 | {F_RDLCK, 0, 0L, 5L, WILLBLOCK}, |
| 99 | /* Child_b read lock on byte 6 to byte 10 */ |
| 100 | {F_RDLCK, 0, 6L, 5L, WILLBLOCK}, |
| 101 | /* |
| 102 | * Parent_c write lock on entire |
| 103 | * file |
| 104 | */ |
| 105 | {F_WRLCK, 0, 0L, 0L, IGNORED}, |
| 106 | /* Parent_d skipped */ |
| 107 | {SKIP},}, |
plars | 865695b | 2001-08-27 22:15:12 +0000 | [diff] [blame] | 108 | |
| 109 | /* #3 Parent_a making a write lock on entire file */ |
| 110 | {{F_WRLCK, 0, 0L, 0L, IGNORED}, |
subrata_modak | 56207ce | 2009-03-23 13:35:39 +0000 | [diff] [blame] | 111 | /* Parent_b skipped */ |
| 112 | {SKIP}, |
| 113 | /* Child_a read lock on byte 2 to byte 4 */ |
| 114 | {F_RDLCK, 0, 2L, 3L, WILLBLOCK}, |
| 115 | /* Child_b read lock on byte 6 to byte 8 */ |
| 116 | {F_RDLCK, 0, 6L, 3L, WILLBLOCK}, |
| 117 | /* |
| 118 | * Parent_c read lock on byte 3 to |
| 119 | * byte 7 |
| 120 | */ |
| 121 | {F_RDLCK, 0, 3L, 5L, IGNORED}, |
| 122 | /* Parent_d skipped */ |
| 123 | {SKIP},}, |
plars | 865695b | 2001-08-27 22:15:12 +0000 | [diff] [blame] | 124 | |
| 125 | /* #4 Parent_a making a write lock on entire file */ |
| 126 | {{F_WRLCK, 0, 0L, 0L, IGNORED}, |
subrata_modak | 56207ce | 2009-03-23 13:35:39 +0000 | [diff] [blame] | 127 | /* Parent_b skipped */ |
| 128 | {SKIP}, |
| 129 | /* Child_a read lock on byte 2 to byte 4 */ |
| 130 | {F_RDLCK, 0, 2L, 3L, WILLBLOCK}, |
| 131 | /* Child_b read lock on byte 6 to byte 8 */ |
| 132 | {F_RDLCK, 0, 6L, 3L, NOBLOCK}, |
| 133 | /* |
| 134 | * Parent_c read lock on byte 5 to |
| 135 | * byte 9 |
| 136 | */ |
| 137 | {F_RDLCK, 0, 5L, 5L, IGNORED}, |
| 138 | /* Parent_d skipped */ |
| 139 | {SKIP},}, |
plars | 865695b | 2001-08-27 22:15:12 +0000 | [diff] [blame] | 140 | |
| 141 | /* #5 Parent_a making a write lock on entire file */ |
| 142 | {{F_WRLCK, 0, 0L, 0L, IGNORED}, |
subrata_modak | 56207ce | 2009-03-23 13:35:39 +0000 | [diff] [blame] | 143 | /* Parent_b skipped */ |
| 144 | {SKIP}, |
| 145 | /* Child_a read lock on byte 3 to byte 7 */ |
| 146 | {F_RDLCK, 0, 3L, 5L, NOBLOCK}, |
| 147 | /* Child_b read lock on byte 5 to byte 10 */ |
| 148 | {F_RDLCK, 0, 5L, 6L, WILLBLOCK}, |
| 149 | /* |
| 150 | * Parent_c read lock on byte 2 to |
| 151 | * byte 8 |
| 152 | */ |
| 153 | {F_RDLCK, 0, 2L, 7L, IGNORED}, |
| 154 | /* Parent_d skipped */ |
| 155 | {SKIP},}, |
plars | 865695b | 2001-08-27 22:15:12 +0000 | [diff] [blame] | 156 | |
| 157 | /* #6 Parent_a making a write lock on entire file */ |
| 158 | {{F_WRLCK, 0, 0L, 0L, IGNORED}, |
subrata_modak | 56207ce | 2009-03-23 13:35:39 +0000 | [diff] [blame] | 159 | /* Parent_b skipped */ |
| 160 | {SKIP}, |
| 161 | /* Child_a read lock on byte 2 to byte 4 */ |
| 162 | {F_RDLCK, 0, 2L, 3L, WILLBLOCK}, |
| 163 | /* Child_b write lock on byte 6 to byte 8 */ |
| 164 | {F_RDLCK, 0, 6L, 3L, NOBLOCK}, |
| 165 | /* Parent_c no lock on byte 3 to 9 */ |
| 166 | {F_UNLCK, 0, 3L, 7L, IGNORED}, |
| 167 | /* Parent_d skipped */ |
| 168 | {SKIP},}, |
plars | 865695b | 2001-08-27 22:15:12 +0000 | [diff] [blame] | 169 | |
| 170 | /* #7 Parent_a making a write lock on entire file */ |
| 171 | {{F_WRLCK, 0, 0L, 0L, IGNORED}, |
subrata_modak | 56207ce | 2009-03-23 13:35:39 +0000 | [diff] [blame] | 172 | /* Parent_b read lock on byte 3 to byte 7 */ |
| 173 | {F_RDLCK, 0, 3L, 5L, IGNORED}, |
| 174 | /* Child_a read lock on byte 2 to byte 4 */ |
| 175 | {F_RDLCK, 0, 2L, 3L, NOBLOCK}, |
| 176 | /* Child_b read lock on byte 6 to byte 8 */ |
| 177 | {F_RDLCK, 0, 6L, 3L, NOBLOCK}, |
| 178 | /* |
| 179 | * Parent_c read lock on byte 1 to |
| 180 | * byte 9 |
| 181 | */ |
| 182 | {F_RDLCK, 0, 1L, 9L, IGNORED}, |
| 183 | /* Parent_d skipped */ |
| 184 | {SKIP},}, |
plars | 865695b | 2001-08-27 22:15:12 +0000 | [diff] [blame] | 185 | |
| 186 | /* #8 Parent_a making a write lock on byte 2 to byte 4 */ |
| 187 | {{F_WRLCK, 0, 2L, 3L, IGNORED}, |
subrata_modak | 56207ce | 2009-03-23 13:35:39 +0000 | [diff] [blame] | 188 | /* Parent_b write lock on byte 6 to byte 8 */ |
| 189 | {F_WRLCK, 0, 6L, 3L, IGNORED}, |
| 190 | /* Child_a read lock on byte 3 to byte 7 */ |
| 191 | {F_RDLCK, 0, 3L, 5L, NOBLOCK}, |
| 192 | /* Child_b skipped */ |
| 193 | {SKIP}, |
| 194 | /* |
| 195 | * Parent_c read lock on byte 1 to |
| 196 | * byte 5 |
| 197 | */ |
| 198 | {F_RDLCK, 0, 1L, 5L, IGNORED}, |
| 199 | /* |
| 200 | * Parent_d read lock on |
| 201 | * byte 5 to byte 9 |
| 202 | */ |
| 203 | {F_RDLCK, 0, 5L, 5L, |
| 204 | IGNORED},}, |
plars | 865695b | 2001-08-27 22:15:12 +0000 | [diff] [blame] | 205 | |
| 206 | /* #9 Parent_a making a write lock on entire file */ |
| 207 | {{F_WRLCK, 0, 0L, 0L, IGNORED}, |
subrata_modak | 56207ce | 2009-03-23 13:35:39 +0000 | [diff] [blame] | 208 | /* Parent_b read lock on byte 3 to byte 7 */ |
| 209 | {F_RDLCK, 0, 3L, 5L, IGNORED}, |
| 210 | /* Child_a read lock on byte 2 to byte 4 */ |
| 211 | {F_RDLCK, 0, 2L, 3L, NOBLOCK}, |
| 212 | /* Child_b read lock on byte 6 to byte 8 */ |
| 213 | {F_RDLCK, 0, 6L, 3L, NOBLOCK}, |
| 214 | /* |
| 215 | * Parent_c read lock on byte 1 to |
| 216 | * byte 3 |
| 217 | */ |
| 218 | {F_RDLCK, 0, 1L, 3L, IGNORED}, |
| 219 | /* |
| 220 | * Parent_d read lock on |
| 221 | * byte 7 to byte 9 |
| 222 | */ |
| 223 | {F_RDLCK, 0, 7L, 3L, |
| 224 | IGNORED},}, |
plars | 865695b | 2001-08-27 22:15:12 +0000 | [diff] [blame] | 225 | |
| 226 | /* #10 Parent_a making a write lock on entire file */ |
| 227 | {{F_WRLCK, 0, 0L, 0L, IGNORED}, |
subrata_modak | 56207ce | 2009-03-23 13:35:39 +0000 | [diff] [blame] | 228 | /* Parent_b skipped */ |
| 229 | {SKIP}, |
| 230 | /* Child_a read lock on byte 2 to byte 4 */ |
| 231 | {F_RDLCK, 0, 2L, 3L, NOBLOCK}, |
| 232 | /* Child_b read lock on byte 6 to byte 8 */ |
| 233 | {F_RDLCK, 0, 6L, 3L, NOBLOCK}, |
| 234 | /* |
| 235 | * Parent_c read lock on byte 1 to |
| 236 | * byte 7 |
| 237 | */ |
| 238 | {F_RDLCK, 0, 1L, 7L, IGNORED}, |
| 239 | /* |
| 240 | * Parent_d read lock on |
| 241 | * byte 3 to byte 9 |
| 242 | */ |
| 243 | {F_RDLCK, 0, 3L, 7L, |
| 244 | IGNORED},}, |
plars | 865695b | 2001-08-27 22:15:12 +0000 | [diff] [blame] | 245 | |
| 246 | /* #11 Parent_a making a write lock on entire file */ |
| 247 | {{F_WRLCK, 0, 0L, 0L, IGNORED}, |
subrata_modak | 56207ce | 2009-03-23 13:35:39 +0000 | [diff] [blame] | 248 | /* Parent_b skipped */ |
| 249 | {SKIP}, |
| 250 | /* Child_a read lock on byte 3 to byte 7 */ |
| 251 | {F_RDLCK, 0, 3L, 5L, NOBLOCK}, |
| 252 | /* Child_b read lock on byte 3 to byte 7 */ |
| 253 | {F_RDLCK, 0, 3L, 5L, NOBLOCK}, |
| 254 | /* |
| 255 | * Parent_c read lock on byte 3 to |
| 256 | * byte 7 |
| 257 | */ |
| 258 | {F_RDLCK, 0, 3L, 5L, IGNORED}, |
| 259 | /* Parent_d skipped */ |
| 260 | {SKIP},}, |
plars | 865695b | 2001-08-27 22:15:12 +0000 | [diff] [blame] | 261 | }; |
| 262 | |
subrata_modak | 56207ce | 2009-03-23 13:35:39 +0000 | [diff] [blame] | 263 | static testcase *thiscase; |
Cyril Hrubis | b87a83c | 2013-11-07 12:05:25 +0100 | [diff] [blame] | 264 | static struct flock *thislock; |
subrata_modak | 56207ce | 2009-03-23 13:35:39 +0000 | [diff] [blame] | 265 | static int parent; |
| 266 | static int child_flag1 = 0; |
| 267 | static int child_flag2 = 0; |
| 268 | static int parent_flag = 0; |
| 269 | static int alarm_flag = 0; |
| 270 | static int child_pid[2], flag[2]; |
| 271 | static int fd; |
| 272 | static int test; |
| 273 | static char tmpname[40]; |
plars | 865695b | 2001-08-27 22:15:12 +0000 | [diff] [blame] | 274 | |
| 275 | #define FILEDATA "tenbytes!" |
| 276 | |
Mike Frysinger | e61ddba | 2014-04-09 23:24:32 -0400 | [diff] [blame] | 277 | extern void catch_int(int sig); /* signal catching subroutine */ |
plars | 865695b | 2001-08-27 22:15:12 +0000 | [diff] [blame] | 278 | |
nstraz | fa31d55 | 2002-05-14 16:50:06 +0000 | [diff] [blame] | 279 | char *TCID = "fcntl16"; |
plars | 865695b | 2001-08-27 22:15:12 +0000 | [diff] [blame] | 280 | int TST_TOTAL = 1; |
plars | 865695b | 2001-08-27 22:15:12 +0000 | [diff] [blame] | 281 | |
robbiew | d34d581 | 2005-07-11 22:28:09 +0000 | [diff] [blame] | 282 | #ifdef UCLINUX |
| 283 | static char *argv0; |
| 284 | #endif |
| 285 | |
robbiew | 5aab8a7 | 2003-03-26 18:05:30 +0000 | [diff] [blame] | 286 | /* |
| 287 | * cleanup - performs all the ONE TIME cleanup for this test at completion or |
subrata_modak | 56207ce | 2009-03-23 13:35:39 +0000 | [diff] [blame] | 288 | * premature exit |
robbiew | 5aab8a7 | 2003-03-26 18:05:30 +0000 | [diff] [blame] | 289 | */ |
subrata_modak | 56207ce | 2009-03-23 13:35:39 +0000 | [diff] [blame] | 290 | void cleanup(void) |
plars | 865695b | 2001-08-27 22:15:12 +0000 | [diff] [blame] | 291 | { |
robbiew | 5aab8a7 | 2003-03-26 18:05:30 +0000 | [diff] [blame] | 292 | tst_rmdir(); |
| 293 | |
robbiew | 5aab8a7 | 2003-03-26 18:05:30 +0000 | [diff] [blame] | 294 | } |
| 295 | |
robbiew | 5aab8a7 | 2003-03-26 18:05:30 +0000 | [diff] [blame] | 296 | void dochild(int kid) |
| 297 | { |
| 298 | /* child process */ |
robbiew | 9c8bd5c | 2005-02-07 20:03:09 +0000 | [diff] [blame] | 299 | struct sigaction sact; |
subrata_modak | 56207ce | 2009-03-23 13:35:39 +0000 | [diff] [blame] | 300 | sact.sa_flags = 0; |
| 301 | sact.sa_handler = catch_int; |
Jan Stancek | c5532e4 | 2013-05-14 11:59:33 +0200 | [diff] [blame] | 302 | sigemptyset(&sact.sa_mask); |
subrata_modak | bdbaec5 | 2009-02-26 12:14:51 +0000 | [diff] [blame] | 303 | (void)sigaction(SIGUSR1, &sact, NULL); |
robbiew | 5aab8a7 | 2003-03-26 18:05:30 +0000 | [diff] [blame] | 304 | |
| 305 | /* Lock should succeed after blocking and parent releases lock */ |
| 306 | if (kid) { |
| 307 | if ((kill(parent, SIGUSR2)) < 0) { |
| 308 | tst_resm(TFAIL, "Attempt to send signal to parent " |
| 309 | "failed"); |
| 310 | tst_resm(TFAIL, "Test case %d, child %d, errno = %d", |
| 311 | test + 1, kid, errno); |
| 312 | exit(1); |
| 313 | } |
| 314 | } else { |
| 315 | if ((kill(parent, SIGUSR1)) < 0) { |
| 316 | tst_resm(TFAIL, "Attempt to send signal to parent " |
| 317 | "failed"); |
| 318 | tst_resm(TFAIL, "Test case %d, child %d, errno = %d", |
| 319 | test + 1, kid, errno); |
| 320 | exit(1); |
| 321 | } |
| 322 | } |
| 323 | |
| 324 | if ((fcntl(fd, F_SETLKW, thislock)) < 0) { |
| 325 | if (errno == EINTR && parent_flag) { |
| 326 | /* |
| 327 | * signal received is waiting for lock to clear, |
| 328 | * this is expected if flag = WILLBLOCK |
| 329 | */ |
| 330 | exit(1); |
| 331 | } else { |
| 332 | tst_resm(TFAIL, "Attempt to set child BLOCKING lock " |
| 333 | "failed"); |
| 334 | tst_resm(TFAIL, "Test case %d, errno = %d", test + 1, |
| 335 | errno); |
| 336 | exit(2); |
| 337 | } |
| 338 | } |
| 339 | exit(0); |
subrata_modak | 56207ce | 2009-03-23 13:35:39 +0000 | [diff] [blame] | 340 | } /* end of child process */ |
robbiew | 5aab8a7 | 2003-03-26 18:05:30 +0000 | [diff] [blame] | 341 | |
robbiew | d34d581 | 2005-07-11 22:28:09 +0000 | [diff] [blame] | 342 | #ifdef UCLINUX |
| 343 | static int kid_uc; |
| 344 | |
Mike Frysinger | c57fba5 | 2014-04-09 18:56:30 -0400 | [diff] [blame] | 345 | void dochild_uc(void) |
robbiew | d34d581 | 2005-07-11 22:28:09 +0000 | [diff] [blame] | 346 | { |
| 347 | dochild(kid_uc); |
| 348 | } |
| 349 | #endif |
| 350 | |
Mike Frysinger | e61ddba | 2014-04-09 23:24:32 -0400 | [diff] [blame] | 351 | void catch_alarm(int sig) |
robbiew | 5aab8a7 | 2003-03-26 18:05:30 +0000 | [diff] [blame] | 352 | { |
| 353 | alarm_flag = 1; |
| 354 | } |
| 355 | |
Mike Frysinger | e61ddba | 2014-04-09 23:24:32 -0400 | [diff] [blame] | 356 | void catch_usr1(int sig) |
subrata_modak | 56207ce | 2009-03-23 13:35:39 +0000 | [diff] [blame] | 357 | { /* invoked on catching SIGUSR1 */ |
robbiew | 5aab8a7 | 2003-03-26 18:05:30 +0000 | [diff] [blame] | 358 | /* |
| 359 | * Set flag to let parent know that child #1 is ready to have the |
| 360 | * lock removed |
| 361 | */ |
| 362 | child_flag1 = 1; |
| 363 | } |
| 364 | |
Mike Frysinger | e61ddba | 2014-04-09 23:24:32 -0400 | [diff] [blame] | 365 | void catch_usr2(int sig) |
subrata_modak | 56207ce | 2009-03-23 13:35:39 +0000 | [diff] [blame] | 366 | { /* invoked on catching SIGUSR2 */ |
robbiew | 5aab8a7 | 2003-03-26 18:05:30 +0000 | [diff] [blame] | 367 | /* |
| 368 | * Set flag to let parent know that child #2 is ready to have the |
| 369 | * lock removed |
| 370 | */ |
| 371 | child_flag2 = 1; |
| 372 | } |
| 373 | |
Mike Frysinger | e61ddba | 2014-04-09 23:24:32 -0400 | [diff] [blame] | 374 | void catch_int(int sig) |
subrata_modak | 56207ce | 2009-03-23 13:35:39 +0000 | [diff] [blame] | 375 | { /* invoked on child catching SIGUSR1 */ |
robbiew | 5aab8a7 | 2003-03-26 18:05:30 +0000 | [diff] [blame] | 376 | /* |
| 377 | * Set flag to interrupt fcntl call in child and force a controlled |
| 378 | * exit |
| 379 | */ |
| 380 | parent_flag = 1; |
| 381 | } |
| 382 | |
| 383 | void child_sig(int sig, int nkids) |
| 384 | { |
| 385 | int i; |
| 386 | |
| 387 | for (i = 0; i < nkids; i++) { |
| 388 | if (kill(child_pid[i], 0) == 0) { |
| 389 | if ((kill(child_pid[i], sig)) < 0) { |
| 390 | tst_resm(TFAIL, "Attempt to signal child %d, " |
| 391 | "failed", i + 1); |
| 392 | } |
| 393 | } |
| 394 | } |
| 395 | } |
| 396 | |
| 397 | /* |
| 398 | * setup - performs all ONE TIME steup for this test |
| 399 | */ |
subrata_modak | 56207ce | 2009-03-23 13:35:39 +0000 | [diff] [blame] | 400 | void setup(void) |
robbiew | 5aab8a7 | 2003-03-26 18:05:30 +0000 | [diff] [blame] | 401 | { |
robbiew | 1e4cf0c | 2005-02-24 17:03:42 +0000 | [diff] [blame] | 402 | struct sigaction sact; |
mridge | db63921 | 2005-01-04 21:04:11 +0000 | [diff] [blame] | 403 | |
robbiew | 5aab8a7 | 2003-03-26 18:05:30 +0000 | [diff] [blame] | 404 | tst_sig(FORK, DEF_HANDLER, cleanup); |
| 405 | |
| 406 | umask(0); |
| 407 | |
| 408 | /* Pause if option was specified */ |
| 409 | TEST_PAUSE; |
| 410 | |
| 411 | parent = getpid(); |
| 412 | |
| 413 | tst_tmpdir(); |
subrata_modak | bdbaec5 | 2009-02-26 12:14:51 +0000 | [diff] [blame] | 414 | |
Xiong Zhou | a2d860c | 2014-08-26 03:01:26 -0400 | [diff] [blame] | 415 | /* On NFS or not */ |
| 416 | if (tst_fs_type(cleanup, ".") == TST_NFS_MAGIC) |
| 417 | NO_NFS = 0; |
| 418 | |
robbiew | 5aab8a7 | 2003-03-26 18:05:30 +0000 | [diff] [blame] | 419 | /* set up temp filename */ |
| 420 | sprintf(tmpname, "fcntl4.%d", parent); |
plars | 865695b | 2001-08-27 22:15:12 +0000 | [diff] [blame] | 421 | |
robbiew | 5aab8a7 | 2003-03-26 18:05:30 +0000 | [diff] [blame] | 422 | /* |
| 423 | * Set up signal handling functions |
| 424 | */ |
robbiew | 1e4cf0c | 2005-02-24 17:03:42 +0000 | [diff] [blame] | 425 | memset(&sact, 0, sizeof(sact)); |
subrata_modak | 56207ce | 2009-03-23 13:35:39 +0000 | [diff] [blame] | 426 | sact.sa_handler = catch_usr1; |
robbiew | 1e4cf0c | 2005-02-24 17:03:42 +0000 | [diff] [blame] | 427 | sigemptyset(&sact.sa_mask); |
| 428 | sigaddset(&sact.sa_mask, SIGUSR1); |
| 429 | sigaction(SIGUSR1, &sact, NULL); |
mridge | db63921 | 2005-01-04 21:04:11 +0000 | [diff] [blame] | 430 | |
robbiew | 1e4cf0c | 2005-02-24 17:03:42 +0000 | [diff] [blame] | 431 | memset(&sact, 0, sizeof(sact)); |
subrata_modak | 56207ce | 2009-03-23 13:35:39 +0000 | [diff] [blame] | 432 | sact.sa_handler = catch_usr2; |
robbiew | 1e4cf0c | 2005-02-24 17:03:42 +0000 | [diff] [blame] | 433 | sigemptyset(&sact.sa_mask); |
| 434 | sigaddset(&sact.sa_mask, SIGUSR2); |
| 435 | sigaction(SIGUSR2, &sact, NULL); |
mridge | db63921 | 2005-01-04 21:04:11 +0000 | [diff] [blame] | 436 | |
robbiew | 1e4cf0c | 2005-02-24 17:03:42 +0000 | [diff] [blame] | 437 | memset(&sact, 0, sizeof(sact)); |
subrata_modak | 56207ce | 2009-03-23 13:35:39 +0000 | [diff] [blame] | 438 | sact.sa_handler = catch_alarm; |
robbiew | 1e4cf0c | 2005-02-24 17:03:42 +0000 | [diff] [blame] | 439 | sigemptyset(&sact.sa_mask); |
| 440 | sigaddset(&sact.sa_mask, SIGALRM); |
| 441 | sigaction(SIGALRM, &sact, NULL); |
plars | 865695b | 2001-08-27 22:15:12 +0000 | [diff] [blame] | 442 | } |
| 443 | |
subrata_modak | 56207ce | 2009-03-23 13:35:39 +0000 | [diff] [blame] | 444 | int run_test(int file_flag, int file_mode, int start, int end) |
plars | 865695b | 2001-08-27 22:15:12 +0000 | [diff] [blame] | 445 | { |
| 446 | int child_count; |
| 447 | int child; |
| 448 | int nexited; |
| 449 | int status, expect_stat; |
| 450 | int i, fail = 0; |
| 451 | |
| 452 | /* loop through all test cases */ |
| 453 | for (test = start; test < end; test++) { |
| 454 | /* open a temp file to lock */ |
| 455 | fd = open(tmpname, file_flag, file_mode); |
| 456 | if (fd < 0) { |
| 457 | tst_brkm(TBROK, cleanup, "open failed"); |
Wanlong Gao | 354ebb4 | 2012-12-07 10:10:04 +0800 | [diff] [blame] | 458 | } |
plars | 865695b | 2001-08-27 22:15:12 +0000 | [diff] [blame] | 459 | |
| 460 | /* write some dummy data to the file */ |
| 461 | (void)write(fd, FILEDATA, 10); |
| 462 | |
| 463 | /* Initialize first parent lock structure */ |
| 464 | thiscase = &testcases[test]; |
| 465 | thislock = &thiscase->parent_a; |
| 466 | |
| 467 | /* set the initial parent lock on the file */ |
| 468 | if ((fcntl(fd, F_SETLK, thislock)) < 0) { |
| 469 | tst_resm(TFAIL, "First parent lock failed"); |
| 470 | tst_resm(TFAIL, "Test case %d, errno = %d", test + 1, |
| 471 | errno); |
Stanislav Kholmanskikh | 8c200cb | 2013-10-31 12:41:47 +0400 | [diff] [blame] | 472 | close(fd); |
plars | 865695b | 2001-08-27 22:15:12 +0000 | [diff] [blame] | 473 | unlink(tmpname); |
subrata_modak | 134e896 | 2009-02-26 11:46:54 +0000 | [diff] [blame] | 474 | return 1; |
plars | 865695b | 2001-08-27 22:15:12 +0000 | [diff] [blame] | 475 | } |
| 476 | |
| 477 | /* Initialize second parent lock structure */ |
| 478 | thislock = &thiscase->parent_b; |
| 479 | |
Cyril Hrubis | b87a83c | 2013-11-07 12:05:25 +0100 | [diff] [blame] | 480 | if ((thislock->l_type) != IGNORED) { /*SKIPVAL */ |
plars | 865695b | 2001-08-27 22:15:12 +0000 | [diff] [blame] | 481 | /* set the second parent lock */ |
| 482 | if ((fcntl(fd, F_SETLK, thislock)) < 0) { |
| 483 | tst_resm(TFAIL, "Second parent lock failed"); |
| 484 | tst_resm(TFAIL, "Test case %d, errno = %d", |
| 485 | test + 1, errno); |
Stanislav Kholmanskikh | 8c200cb | 2013-10-31 12:41:47 +0400 | [diff] [blame] | 486 | close(fd); |
plars | 865695b | 2001-08-27 22:15:12 +0000 | [diff] [blame] | 487 | unlink(tmpname); |
subrata_modak | 134e896 | 2009-02-26 11:46:54 +0000 | [diff] [blame] | 488 | return 1; |
plars | 865695b | 2001-08-27 22:15:12 +0000 | [diff] [blame] | 489 | } |
| 490 | } |
| 491 | |
| 492 | /* Initialize first child lock structure */ |
| 493 | thislock = &thiscase->child_a; |
| 494 | |
| 495 | /* Initialize child counter and flags */ |
| 496 | alarm_flag = parent_flag = 0; |
| 497 | child_flag1 = child_flag2 = 0; |
| 498 | child_count = 0; |
| 499 | |
| 500 | /* spawn child processes */ |
| 501 | for (i = 0; i < 2; i++) { |
Cyril Hrubis | b87a83c | 2013-11-07 12:05:25 +0100 | [diff] [blame] | 502 | if (thislock->l_type != IGNORED) { |
robbiew | d34d581 | 2005-07-11 22:28:09 +0000 | [diff] [blame] | 503 | if ((child = FORK_OR_VFORK()) == 0) { |
| 504 | #ifdef UCLINUX |
| 505 | if (self_exec(argv0, "ddddd", i, parent, |
| 506 | test, thislock, fd) < 0) { |
| 507 | perror("self_exec failed"); |
subrata_modak | 134e896 | 2009-02-26 11:46:54 +0000 | [diff] [blame] | 508 | return 1; |
robbiew | d34d581 | 2005-07-11 22:28:09 +0000 | [diff] [blame] | 509 | } |
| 510 | #else |
plars | 865695b | 2001-08-27 22:15:12 +0000 | [diff] [blame] | 511 | dochild(i); |
robbiew | d34d581 | 2005-07-11 22:28:09 +0000 | [diff] [blame] | 512 | #endif |
plars | 865695b | 2001-08-27 22:15:12 +0000 | [diff] [blame] | 513 | } |
| 514 | if (child < 0) { |
| 515 | perror("Fork failed"); |
subrata_modak | 134e896 | 2009-02-26 11:46:54 +0000 | [diff] [blame] | 516 | return 1; |
plars | 865695b | 2001-08-27 22:15:12 +0000 | [diff] [blame] | 517 | } |
| 518 | child_count++; |
| 519 | child_pid[i] = child; |
Cyril Hrubis | b87a83c | 2013-11-07 12:05:25 +0100 | [diff] [blame] | 520 | flag[i] = thislock->l_pid; |
plars | 865695b | 2001-08-27 22:15:12 +0000 | [diff] [blame] | 521 | } |
| 522 | /* Initialize second child lock structure */ |
| 523 | thislock = &thiscase->child_b; |
| 524 | } |
| 525 | /* parent process */ |
| 526 | |
| 527 | /* |
| 528 | * Wait for children to signal they are ready. Set a timeout |
| 529 | * just in case they don't signal at all. |
| 530 | */ |
| 531 | alarm(TIME_OUT); |
| 532 | |
| 533 | while (!alarm_flag |
| 534 | && (child_flag1 + child_flag2 != child_count)) { |
| 535 | pause(); |
| 536 | } |
| 537 | |
| 538 | /* |
| 539 | * Turn off alarm and unmask signals |
| 540 | */ |
| 541 | alarm((unsigned)0); |
| 542 | |
| 543 | if (child_flag1 + child_flag2 != child_count) { |
| 544 | tst_resm(TFAIL, "Test case %d: kids didn't signal", |
| 545 | test + 1); |
| 546 | fail = 1; |
| 547 | } |
| 548 | child_flag1 = child_flag2 = alarm_flag = 0; |
| 549 | |
| 550 | thislock = &thiscase->parent_c; |
| 551 | |
| 552 | /* set the third parent lock on the file */ |
| 553 | if ((fcntl(fd, F_SETLK, thislock)) < 0) { |
| 554 | tst_resm(TFAIL, "Third parent lock failed"); |
| 555 | tst_resm(TFAIL, "Test case %d, errno = %d", |
| 556 | test + 1, errno); |
Stanislav Kholmanskikh | 8c200cb | 2013-10-31 12:41:47 +0400 | [diff] [blame] | 557 | close(fd); |
plars | 865695b | 2001-08-27 22:15:12 +0000 | [diff] [blame] | 558 | unlink(tmpname); |
subrata_modak | 134e896 | 2009-02-26 11:46:54 +0000 | [diff] [blame] | 559 | return 1; |
plars | 865695b | 2001-08-27 22:15:12 +0000 | [diff] [blame] | 560 | } |
| 561 | |
| 562 | /* Initialize fourth parent lock structure */ |
| 563 | thislock = &thiscase->parent_d; |
| 564 | |
Cyril Hrubis | b87a83c | 2013-11-07 12:05:25 +0100 | [diff] [blame] | 565 | if ((thislock->l_type) != IGNORED) { /*SKIPVAL */ |
plars | 865695b | 2001-08-27 22:15:12 +0000 | [diff] [blame] | 566 | /* set the fourth parent lock */ |
| 567 | if ((fcntl(fd, F_SETLK, thislock)) < 0) { |
| 568 | tst_resm(TINFO, "Fourth parent lock failed"); |
| 569 | tst_resm(TINFO, "Test case %d, errno = %d", |
| 570 | test + 1, errno); |
Stanislav Kholmanskikh | 8c200cb | 2013-10-31 12:41:47 +0400 | [diff] [blame] | 571 | close(fd); |
plars | 865695b | 2001-08-27 22:15:12 +0000 | [diff] [blame] | 572 | unlink(tmpname); |
subrata_modak | 134e896 | 2009-02-26 11:46:54 +0000 | [diff] [blame] | 573 | return 1; |
plars | 865695b | 2001-08-27 22:15:12 +0000 | [diff] [blame] | 574 | } |
| 575 | } |
| 576 | |
| 577 | /* |
| 578 | * Wait for children to exit, or for timeout to occur. |
| 579 | * Timeouts are expected for testcases where kids are |
| 580 | * 'WILLBLOCK', In that case, send kids a wakeup interrupt |
| 581 | * and wait again for them. If a second timeout occurs, then |
| 582 | * something is wrong. |
| 583 | */ |
| 584 | alarm_flag = nexited = 0; |
| 585 | while (nexited < child_count) { |
| 586 | alarm(TIME_OUT); |
| 587 | child = wait(&status); |
| 588 | alarm(0); |
| 589 | |
| 590 | if (child == -1) { |
| 591 | if (errno != EINTR || alarm_flag != 1) { |
| 592 | /* |
| 593 | * Some error other than a timeout, |
| 594 | * or else this is the second |
| 595 | * timeout. Both cases are errors. |
| 596 | */ |
| 597 | break; |
| 598 | } |
| 599 | |
| 600 | /* |
| 601 | * Expected timeout case. Signal kids then |
| 602 | * go back and wait again |
| 603 | */ |
| 604 | child_sig(SIGUSR1, child_count); |
| 605 | continue; |
| 606 | } |
| 607 | |
| 608 | for (i = 0; i < child_count; i++) |
| 609 | if (child == child_pid[i]) |
| 610 | break; |
| 611 | if (i == child_count) { |
| 612 | /* |
| 613 | * Ignore unexpected kid, it could be a |
| 614 | * leftover from a previous iteration that |
| 615 | * timed out. |
| 616 | */ |
| 617 | continue; |
| 618 | } |
| 619 | |
| 620 | /* Found the right kid, check his status */ |
| 621 | nexited++; |
| 622 | |
| 623 | expect_stat = (flag[i] == NOBLOCK) ? 0 : 1; |
| 624 | |
| 625 | if (!WIFEXITED(status) |
| 626 | || WEXITSTATUS(status) != expect_stat) { |
| 627 | /* got unexpected exit status from kid */ |
| 628 | tst_resm(TFAIL, "Test case %d: child %d %s " |
| 629 | "or got bad status (x%x)", test + 1, |
| 630 | i, (flag[i] == NOBLOCK) ? |
| 631 | "BLOCKED unexpectedly" : |
| 632 | "failed to BLOCK", status); |
| 633 | fail = 1; |
| 634 | } |
| 635 | } |
| 636 | |
| 637 | if (nexited != child_count) { |
| 638 | tst_resm(TFAIL, "Test case %d, caught %d expected %d " |
| 639 | "children", test + 1, nexited, child_count); |
| 640 | child_sig(SIGKILL, nexited); |
| 641 | fail = 1; |
| 642 | } |
| 643 | close(fd); |
| 644 | } |
| 645 | unlink(tmpname); |
| 646 | if (fail) { |
subrata_modak | 134e896 | 2009-02-26 11:46:54 +0000 | [diff] [blame] | 647 | return 1; |
plars | 865695b | 2001-08-27 22:15:12 +0000 | [diff] [blame] | 648 | } else { |
subrata_modak | 43337a3 | 2009-02-26 11:43:51 +0000 | [diff] [blame] | 649 | return 0; |
plars | 865695b | 2001-08-27 22:15:12 +0000 | [diff] [blame] | 650 | } |
subrata_modak | 43337a3 | 2009-02-26 11:43:51 +0000 | [diff] [blame] | 651 | return 0; |
plars | 865695b | 2001-08-27 22:15:12 +0000 | [diff] [blame] | 652 | } |
| 653 | |
robbiew | 5aab8a7 | 2003-03-26 18:05:30 +0000 | [diff] [blame] | 654 | int main(int ac, char **av) |
plars | 865695b | 2001-08-27 22:15:12 +0000 | [diff] [blame] | 655 | { |
subrata_modak | bdbaec5 | 2009-02-26 12:14:51 +0000 | [diff] [blame] | 656 | |
Cyril Hrubis | 89af32a | 2012-10-24 16:39:11 +0200 | [diff] [blame] | 657 | int lc; |
Cyril Hrubis | 0b9589f | 2014-05-27 17:40:33 +0200 | [diff] [blame] | 658 | const char *msg; |
plars | 865695b | 2001-08-27 22:15:12 +0000 | [diff] [blame] | 659 | |
Garrett Cooper | 45e285d | 2010-11-22 12:19:25 -0800 | [diff] [blame] | 660 | if ((msg = parse_opts(ac, av, NULL, NULL)) != NULL) { |
Garrett Cooper | 60fa801 | 2010-11-22 13:50:58 -0800 | [diff] [blame] | 661 | tst_brkm(TBROK, NULL, "OPTION PARSING ERROR - %s", msg); |
robbiew | 5aab8a7 | 2003-03-26 18:05:30 +0000 | [diff] [blame] | 662 | } |
robbiew | d34d581 | 2005-07-11 22:28:09 +0000 | [diff] [blame] | 663 | #ifdef UCLINUX |
| 664 | maybe_run_child(dochild_uc, "ddddd", &kid_uc, &parent, &test, |
| 665 | &thislock, &fd); |
| 666 | argv0 = av[0]; |
| 667 | #endif |
| 668 | |
subrata_modak | 56207ce | 2009-03-23 13:35:39 +0000 | [diff] [blame] | 669 | setup(); /* global setup */ |
robbiew | 5aab8a7 | 2003-03-26 18:05:30 +0000 | [diff] [blame] | 670 | |
robbiew | 5aab8a7 | 2003-03-26 18:05:30 +0000 | [diff] [blame] | 671 | for (lc = 0; TEST_LOOPING(lc); lc++) { |
Caspar Zhang | d59a659 | 2013-03-07 14:59:12 +0800 | [diff] [blame] | 672 | /* reset tst_count in case we are looping */ |
| 673 | tst_count = 0; |
robbiew | 5aab8a7 | 2003-03-26 18:05:30 +0000 | [diff] [blame] | 674 | |
mridge | db63921 | 2005-01-04 21:04:11 +0000 | [diff] [blame] | 675 | /* //block1: */ |
subrata_modak | 4bb656a | 2009-02-26 12:02:09 +0000 | [diff] [blame] | 676 | /* |
robbiew | 5aab8a7 | 2003-03-26 18:05:30 +0000 | [diff] [blame] | 677 | * Check file locks on an ordinary file without |
| 678 | * mandatory locking |
| 679 | */ |
| 680 | tst_resm(TINFO, "Entering block 1"); |
| 681 | if (run_test(O_CREAT | O_RDWR | O_TRUNC, 0777, 0, 11)) { |
| 682 | tst_resm(TINFO, "Test case 1: without mandatory " |
| 683 | "locking FAILED"); |
| 684 | } else { |
| 685 | tst_resm(TINFO, "Test case 1: without manadatory " |
| 686 | "locking PASSED"); |
| 687 | } |
| 688 | tst_resm(TINFO, "Exiting block 1"); |
| 689 | |
mridge | db63921 | 2005-01-04 21:04:11 +0000 | [diff] [blame] | 690 | /* //block2: */ |
robbiew | 5aab8a7 | 2003-03-26 18:05:30 +0000 | [diff] [blame] | 691 | /* |
| 692 | * Check the file locks on a file with mandatory record |
| 693 | * locking |
| 694 | */ |
| 695 | tst_resm(TINFO, "Entering block 2"); |
Xiong Zhou | a2d860c | 2014-08-26 03:01:26 -0400 | [diff] [blame] | 696 | if (NO_NFS && run_test(O_CREAT | O_RDWR | O_TRUNC, S_ISGID | |
robbiew | 5aab8a7 | 2003-03-26 18:05:30 +0000 | [diff] [blame] | 697 | S_IRUSR | S_IWUSR, 0, 11)) { |
| 698 | tst_resm(TINFO, "Test case 2: with mandatory record " |
| 699 | "locking FAILED"); |
| 700 | } else { |
Xiong Zhou | a2d860c | 2014-08-26 03:01:26 -0400 | [diff] [blame] | 701 | if (NO_NFS) |
| 702 | tst_resm(TINFO, "Test case 2: with mandatory" |
| 703 | " record locking PASSED"); |
| 704 | else |
| 705 | tst_resm(TCONF, "Test case 2: NFS does not" |
| 706 | " support mandatory locking"); |
robbiew | 5aab8a7 | 2003-03-26 18:05:30 +0000 | [diff] [blame] | 707 | } |
| 708 | tst_resm(TINFO, "Exiting block 2"); |
| 709 | |
mridge | db63921 | 2005-01-04 21:04:11 +0000 | [diff] [blame] | 710 | /* //block3: */ |
robbiew | 5aab8a7 | 2003-03-26 18:05:30 +0000 | [diff] [blame] | 711 | /* |
| 712 | * Check file locks on a file with mandatory record locking |
| 713 | * and no delay |
| 714 | */ |
| 715 | tst_resm(TINFO, "Entering block 3"); |
Xiong Zhou | a2d860c | 2014-08-26 03:01:26 -0400 | [diff] [blame] | 716 | if (NO_NFS && run_test(O_CREAT | O_RDWR | O_TRUNC | O_NDELAY, |
robbiew | 5aab8a7 | 2003-03-26 18:05:30 +0000 | [diff] [blame] | 717 | S_ISGID | S_IRUSR | S_IWUSR, 0, 11)) { |
| 718 | tst_resm(TINFO, "Test case 3: mandatory locking with " |
| 719 | "NODELAY FAILED"); |
| 720 | } else { |
Xiong Zhou | a2d860c | 2014-08-26 03:01:26 -0400 | [diff] [blame] | 721 | if (NO_NFS) |
| 722 | tst_resm(TINFO, "Test case 3: mandatory" |
| 723 | " locking with NODELAY PASSED"); |
| 724 | else |
| 725 | tst_resm(TCONF, "Test case 3: NFS does not" |
| 726 | " support mandatory locking"); |
robbiew | 5aab8a7 | 2003-03-26 18:05:30 +0000 | [diff] [blame] | 727 | } |
| 728 | tst_resm(TINFO, "Exiting block 3"); |
| 729 | } |
| 730 | cleanup(); |
Garrett Cooper | 2c28215 | 2010-12-16 00:55:50 -0800 | [diff] [blame] | 731 | tst_exit(); |
Chris Dearman | ec6edca | 2012-10-17 19:54:01 -0700 | [diff] [blame] | 732 | } |