• Home
  • History
  • Annotate
  • Raw
  • Download
  • only in /freebsd-12-stable/tools/regression/doat/

Lines Matching defs:tests

65 	struct testcase	tests[10];	/* no more than 10 tests */
69 struct test *tests;
108 tests = calloc(NUM_OF_TESTS + 1, sizeof(struct test));
109 if (tests == NULL) {
198 tests[0].syscall = SYS_faccessat;
199 tests[0].num_of_cases = 6;
200 tests[0].name = "faccessat";
201 tests[0].tests[0].result = EBADF;
202 tests[0].tests[0].params[0].i = 106; /* invalid fd */
203 tests[0].tests[0].params[1].cp = relative_path;
204 tests[0].tests[0].params[2].m = 0;
205 tests[0].tests[0].params[3].i = 0;
206 tests[0].tests[1].result = EBADF;
207 tests[0].tests[1].params[0].i = 106; /* invalid fd */
208 tests[0].tests[1].params[1].cp = relative_path;
209 tests[0].tests[1].params[2].m = 0;
210 tests[0].tests[1].params[3].i = AT_EACCESS;
211 tests[0].tests[2].result = EINVAL;
212 tests[0].tests[2].params[0].i = rel_fd;
213 tests[0].tests[2].params[1].cp = absolute_path;
214 tests[0].tests[2].params[2].m = 0;
215 tests[0].tests[2].params[3].i = 123; /* invalid flag */
216 tests[0].tests[3].result = ENOTDIR;
217 tests[0].tests[3].params[0].i = notd_fd;
218 tests[0].tests[3].params[1].cp = relative_file;
219 tests[0].tests[3].params[2].m = 0;
220 tests[0].tests[3].params[3].i = 0;
221 tests[0].tests[4].result = 0;
222 tests[0].tests[4].params[0].i = rel_fd;
223 tests[0].tests[4].params[1].cp = file;
224 tests[0].tests[4].params[2].m = 0;
225 tests[0].tests[4].params[3].i = 0;
226 tests[0].tests[5].result = 0;
227 tests[0].tests[5].params[0].i = rel_fd;
228 tests[0].tests[5].params[1].cp = file;
229 tests[0].tests[5].params[2].m = 0;
230 tests[0].tests[5].params[3].i = AT_EACCESS;
231 tests[0].tests[6].result = 0;
232 tests[0].tests[6].params[0].i = 106; /* invalid fd */
233 tests[0].tests[6].params[1].cp = absolute_path;
234 tests[0].tests[6].params[2].m = 0;
235 tests[0].tests[6].params[3].i = 0;
238 tests[1].syscall = SYS_fchmodat;
239 tests[1].num_of_cases = 6;
240 tests[1].name = "fchmodat";
241 tests[1].tests[0].result = EBADF;
242 tests[1].tests[0].params[0].i = 106; /* invalid fd */
243 tests[1].tests[0].params[1].cp = relative_path;
244 tests[1].tests[0].params[2].m = 33190;
245 tests[1].tests[0].params[3].i = 0;
246 tests[1].tests[1].result = EINVAL;
247 tests[1].tests[1].params[0].i = rel_fd;
248 tests[1].tests[1].params[1].cp = absolute_path;
249 tests[1].tests[1].params[2].m = 33190; /* mode 646 translated */
250 tests[1].tests[1].params[3].i = 123; /* invalid flag */
251 tests[1].tests[2].result = ENOTDIR;
252 tests[1].tests[2].params[0].i = notd_fd;
253 tests[1].tests[2].params[1].cp = relative_file;
254 tests[1].tests[2].params[2].m = 33190;
255 tests[1].tests[2].params[3].i = 0;
256 tests[1].tests[3].result = 0;
257 tests[1].tests[3].params[0].i = notd_fd;
258 tests[1].tests[3].params[1].cp = absolute_file;
259 tests[1].tests[3].params[2].m = 33190;
260 tests[1].tests[3].params[3].i = 0;
261 tests[1].tests[4].result = 0;
262 tests[1].tests[4].params[0].i = AT_FDCWD;
263 tests[1].tests[4].params[1].cp = symlinkf;
264 tests[1].tests[4].params[2].m = 33190;
265 tests[1].tests[4].params[3].i = AT_SYMLINK_NOFOLLOW;
266 tests[1].tests[5].result = 0;
267 tests[1].tests[5].params[0].i = rel_fd;
268 tests[1].tests[5].params[1].cp = file;
269 tests[1].tests[5].params[2].m = 33190;
270 tests[1].tests[5].params[3].i = 0;
273 tests[2].syscall = SYS_fchownat;
274 tests[2].num_of_cases = 6;
275 tests[2].name = "fchownat";
276 tests[2].tests[0].result = EBADF;
277 tests[2].tests[0].params[0].i = 106; /* invalid fd */
278 tests[2].tests[0].params[1].cp = relative_file;
279 tests[2].tests[0].params[2].u = 65534;
280 tests[2].tests[0].params[3].g = 65534;
281 tests[2].tests[0].params[4].i = 0;
282 tests[2].tests[1].result = EINVAL;
283 tests[2].tests[1].params[0].i = rel_fd;
284 tests[2].tests[1].params[1].cp = file;
285 tests[2].tests[1].params[2].u = 65534;
286 tests[2].tests[1].params[3].g = 65534;
287 tests[2].tests[1].params[4].i = 123; /* invalid flag */
288 tests[2].tests[2].result = ENOTDIR;
289 tests[2].tests[2].params[0].i = notd_fd;
290 tests[2].tests[2].params[1].cp = relative_file;
291 tests[2].tests[2].params[2].u = 65534;
292 tests[2].tests[2].params[3].g = 65534;
293 tests[2].tests[2].params[4].i = 0;
294 tests[2].tests[3].result = 0;
295 tests[2].tests[3].params[0].i = notd_fd;
296 tests[2].tests[3].params[1].cp = absolute_file;
297 tests[2].tests[3].params[2].u = 65534;
298 tests[2].tests[3].params[3].g = 65534;
299 tests[2].tests[3].params[4].i = 0;
300 tests[2].tests[4].result = 0;
301 tests[2].tests[4].params[0].i = AT_FDCWD;
302 tests[2].tests[4].params[1].cp = symlinkf;
303 tests[2].tests[4].params[2].u = 65534;
304 tests[2].tests[4].params[3].g = 65534;
305 tests[2].tests[4].params[4].i = AT_SYMLINK_NOFOLLOW;
306 tests[2].tests[5].result = 0;
307 tests[2].tests[5].params[0].i = rel_fd;
308 tests[2].tests[5].params[1].cp = file;
309 tests[2].tests[5].params[2].u = 0;
310 tests[2].tests[5].params[3].g = 0;
311 tests[2].tests[5].params[4].i = 0;
314 tests[3].syscall = SYS_fstatat;
315 tests[3].num_of_cases = 5;
316 tests[3].name = "fstatat";
317 tests[3].tests[0].result = EBADF;
318 tests[3].tests[0].params[0].i = 106; /* invalid fd */
319 tests[3].tests[0].params[1].cp = relative_file;
320 tests[3].tests[0].params[2].vp = &buf;
321 tests[3].tests[0].params[3].i = 0;
322 tests[3].tests[1].result = EINVAL;
323 tests[3].tests[1].params[0].i = rel_fd;
324 tests[3].tests[1].params[1].cp = relative_file;
325 tests[3].tests[1].params[2].vp = &buf;
326 tests[3].tests[1].params[3].i = 123; /* invalid flags */
327 tests[3].tests[2].result = ENOTDIR;
328 tests[3].tests[2].params[0].i = notd_fd;
329 tests[3].tests[2].params[1].cp = relative_file;
330 tests[3].tests[2].params[2].vp = &buf;
331 tests[3].tests[2].params[3].i = 0;
332 tests[3].tests[2].result = 0;
333 tests[3].tests[2].params[0].i = rel_fd;
334 tests[3].tests[2].params[1].cp = file;
335 tests[3].tests[2].params[2].vp = &buf;
336 tests[3].tests[2].params[3].i = 0;
337 tests[3].tests[3].result = 0;
338 tests[3].tests[3].params[0].i = AT_FDCWD;
339 tests[3].tests[3].params[1].cp = symlinkf;
340 tests[3].tests[3].params[2].vp = &buf;
341 tests[3].tests[3].params[3].i = AT_SYMLINK_NOFOLLOW;
342 tests[3].tests[4].result = 0;
343 tests[3].tests[4].params[0].i = notd_fd;
344 tests[3].tests[4].params[1].cp = absolute_file;
345 tests[3].tests[4].params[2].vp = &buf;
346 tests[3].tests[4].params[3].i = 0;
349 tests[4].syscall = SYS_futimesat;
350 tests[4].num_of_cases = 4;
351 tests[4].name = "futimesat";
352 tests[4].tests[0].result = EBADF;
353 tests[4].tests[0].params[0].i = 106; /* invalid fd */
354 tests[4].tests[0].params[1].cp = relative_file;
355 tests[4].tests[0].params[2].vp = times;
356 tests[4].tests[1].result = ENOTDIR;
357 tests[4].tests[1].params[0].i = notd_fd;
358 tests[4].tests[1].params[1].cp = relative_file;
359 tests[4].tests[1].params[2].vp = times;
360 tests[4].tests[2].result = 0;
361 tests[4].tests[2].params[0].i = rel_fd;
362 tests[4].tests[2].params[1].cp = file;
363 tests[4].tests[2].params[2].vp = times;
364 tests[4].tests[3].result = 0;
365 tests[4].tests[3].params[0].i = notd_fd;
366 tests[4].tests[3].params[1].cp = absolute_file;
367 tests[4].tests[3].params[2].vp = times;
370 tests[5].syscall = SYS_linkat;
371 tests[5].num_of_cases = 7;
372 tests[5].name = "linkat";
373 tests[5].tests[0].result = EBADF;
374 tests[5].tests[0].params[0].i = 106; /* invalid fd */
375 tests[5].tests[0].params[1].cp = relative_file;
376 tests[5].tests[0].params[2].i = AT_FDCWD;
377 tests[5].tests[0].params[3].cp = newlink;
378 tests[5].tests[0].params[4].i = 0;
379 tests[5].tests[1].result = EBADF;
380 tests[5].tests[1].params[0].i = AT_FDCWD;
381 tests[5].tests[1].params[1].cp = relative_file;
382 tests[5].tests[1].params[2].i = 106; /* invalid fd */
383 tests[5].tests[1].params[3].cp = newlink;
384 tests[5].tests[1].params[4].i = 0;
385 tests[5].tests[2].result = EINVAL;
386 tests[5].tests[2].params[0].i = rel_fd;
387 tests[5].tests[2].params[1].cp = relative_file;
388 tests[5].tests[2].params[2].i = AT_FDCWD;
389 tests[5].tests[2].params[3].cp = newlink;
390 tests[5].tests[2].params[4].i = 123; /* invalid flag */
391 tests[5].tests[3].result = ENOTDIR;
392 tests[5].tests[3].params[0].i = notd_fd;
393 tests[5].tests[3].params[1].cp = relative_file;
394 tests[5].tests[3].params[2].i = AT_FDCWD;
395 tests[5].tests[3].params[3].cp = newlink;
396 tests[5].tests[3].params[4].i = 0;
397 tests[5].tests[4].result = 0;
398 tests[5].tests[4].params[0].i = rel_fd;
399 tests[5].tests[4].params[1].cp = file;
400 tests[5].tests[4].params[2].i = rel_fd;
401 tests[5].tests[4].params[3].cp = newlink;
402 tests[5].tests[4].params[4].i = 0;
403 tests[5].tests[5].result = 0;
404 tests[5].tests[5].params[0].i = AT_FDCWD;
405 tests[5].tests[5].params[1].cp = symlinkf;
406 tests[5].tests[5].params[2].i = rel_fd;
407 tests[5].tests[5].params[3].cp = newlink2;
408 tests[5].tests[5].params[4].i = 0;
409 tests[5].tests[6].result = 0;
410 tests[5].tests[6].params[0].i = AT_FDCWD;
411 tests[5].tests[6].params[1].cp = symlinkf;
412 tests[5].tests[6].params[2].i = rel_fd;
413 tests[5].tests[6].params[3].cp = newlink3;
414 tests[5].tests[6].params[4].i = AT_SYMLINK_FOLLOW;
417 tests[6].syscall = SYS_mkdirat;
418 tests[6].num_of_cases = 3;
419 tests[6].name = "mkdirat";
420 tests[6].tests[0].result = EBADF;
421 tests[6].tests[0].params[0].i = 106; /* invalid fd */
422 tests[6].tests[0].params[1].cp = relative_file;
423 tests[6].tests[0].params[2].m = 33190;
424 tests[6].tests[1].result = ENOTDIR;
425 tests[6].tests[1].params[0].i = notd_fd;
426 tests[6].tests[1].params[1].cp = relative_file;
427 tests[6].tests[1].params[2].m = 33190;
428 tests[6].tests[2].result = 0;
429 tests[6].tests[2].params[0].i = rel_fd;
430 tests[6].tests[2].params[1].cp = newdir;
431 tests[6].tests[2].params[2].m = 33190;
434 tests[7].syscall = SYS_mkfifoat;
435 tests[7].num_of_cases = 3;
436 tests[7].name = "mkfifoat";
437 tests[7].tests[0].result = EBADF;
438 tests[7].tests[0].params[0].i = 107; /* invalid fd */
439 tests[7].tests[0].params[1].cp = relative_file;
440 tests[7].tests[0].params[2].m = 33190;
441 tests[7].tests[1].result = ENOTDIR;
442 tests[7].tests[1].params[0].i = notd_fd;
443 tests[7].tests[1].params[1].cp = relative_file;
444 tests[7].tests[1].params[2].m = 33190;
445 tests[7].tests[2].result = 0;
446 tests[7].tests[2].params[0].i = rel_fd;
447 tests[7].tests[2].params[1].cp = fifo;
448 tests[7].tests[2].params[2].m = 33190;
451 tests[8].syscall = SYS_mknodat;
452 tests[8].num_of_cases = 3;
453 tests[8].name = "mknodat";
454 tests[8].tests[0].result = EBADF;
455 tests[8].tests[0].params[0].i = 108; /* invalid fd */
456 tests[8].tests[0].params[1].cp = relative_file;
457 tests[8].tests[0].params[2].m = 0666 | S_IFCHR;
458 tests[8].tests[0].params[3].d = 15;
459 tests[8].tests[1].result = ENOTDIR;
460 tests[8].tests[1].params[0].i = notd_fd;
461 tests[8].tests[1].params[1].cp = relative_file;
462 tests[8].tests[1].params[2].m = 0666 | S_IFCHR;
463 tests[8].tests[1].params[3].d = 15;
464 tests[8].tests[2].result = 0;
465 tests[8].tests[2].params[0].i = rel_fd;
466 tests[8].tests[2].params[1].cp = nod;
467 tests[8].tests[2].params[2].m = 0666 | S_IFCHR;
468 tests[8].tests[2].params[3].d = 2570;
471 tests[9].syscall = SYS_openat;
472 tests[9].num_of_cases = 5;
473 tests[9].name = "openat";
474 tests[9].tests[0].result = EBADF;
475 tests[9].tests[0].params[0].i = 106; /* invalid fd */
476 tests[9].tests[0].params[1].cp = relative_file;
477 tests[9].tests[0].params[2].i = O_RDONLY;
478 tests[9].tests[0].params[3].i = 0666;
479 tests[9].tests[1].result = ENOTDIR;
480 tests[9].tests[1].params[0].i = notd_fd;
481 tests[9].tests[1].params[1].cp = relative_file;
482 tests[9].tests[1].params[2].i = O_RDONLY;
483 tests[9].tests[1].params[3].i = 0666;
484 tests[9].tests[2].result = 8; /* hardcoded fd */
485 tests[9].tests[2].params[0].i = rel_fd;
486 tests[9].tests[2].params[1].cp = file;
487 tests[9].tests[2].params[2].i = O_RDONLY;
488 tests[9].tests[2].params[3].i = 0400;
489 tests[9].tests[3].result = 9; /* hardcoded fd */
490 tests[9].tests[3].params[0].i = notd_fd;
491 tests[9].tests[3].params[1].cp = absolute_file;
492 tests[9].tests[3].params[2].i = O_RDONLY;
493 tests[9].tests[3].params[3].i = 0400;
494 tests[9].tests[4].result = 10; /* hardcoded fd */
495 tests[9].tests[4].params[0].i = rel_fd;
496 tests[9].tests[4].params[1].cp = newfile;
497 tests[9].tests[4].params[2].i = O_RDONLY | O_CREAT;
498 tests[9].tests[4].params[3].i = 0666;
501 tests[10].syscall = SYS_readlinkat;
502 tests[10].num_of_cases = 3;
503 tests[10].name = "readlinkat";
504 tests[10].tests[0].result = EBADF;
505 tests[10].tests[0].params[0].i = 106; /* invalid fd */
506 tests[10].tests[0].params[1].cp = relative_file;
507 tests[10].tests[0].params[2].vp = cbuf;
508 tests[10].tests[0].params[3].i = PATH_MAX;
509 tests[10].tests[1].result = ENOTDIR;
510 tests[10].tests[1].params[0].i = notd_fd;
511 tests[10].tests[1].params[1].cp = relative_file;
512 tests[10].tests[1].params[2].vp = cbuf;
513 tests[10].tests[1].params[3].i = PATH_MAX;
514 tests[10].tests[2].result = strlen(absolute_file);
515 tests[10].tests[2].params[0].i = AT_FDCWD;
516 tests[10].tests[2].params[1].cp = symlinkf;
517 tests[10].tests[2].params[2].vp = cbuf;
518 tests[10].tests[2].params[3].i = PATH_MAX;
521 tests[11].syscall = SYS_renameat;
522 tests[11].num_of_cases = 5;
523 tests[11].name = "renameat";
524 tests[11].tests[0].result = EBADF;
525 tests[11].tests[0].params[0].i = 106; /* invalid fd */
526 tests[11].tests[0].params[1].cp = file;
527 tests[11].tests[0].params[2].i = rel_fd;
528 tests[11].tests[0].params[3].cp = file;
529 tests[11].tests[1].result = EBADF;
530 tests[11].tests[1].params[0].i = rel_fd;
531 tests[11].tests[1].params[1].cp = file;
532 tests[11].tests[1].params[2].i = 106; /* invalid fd */
533 tests[11].tests[1].params[3].cp = file;
534 tests[11].tests[2].result = ENOTDIR;
535 tests[11].tests[2].params[0].i = notd_fd;
536 tests[11].tests[2].params[1].cp = relative_file;
537 tests[11].tests[2].params[2].i = rel_fd;
538 tests[11].tests[2].params[3].cp = file;
539 tests[11].tests[3].result = ENOTDIR;
540 tests[11].tests[3].params[0].i = rel_fd;
541 tests[11].tests[3].params[1].cp = file;
542 tests[11].tests[3].params[2].i = notd_fd;
543 tests[11].tests[3].params[3].cp = relative_file;
544 tests[11].tests[4].result = 0;
545 tests[11].tests[4].params[0].i = rel_fd;
546 tests[11].tests[4].params[1].cp = newfile;
547 tests[11].tests[4].params[2].i = AT_FDCWD;
548 tests[11].tests[4].params[3].cp = newfile;
551 tests[12].syscall = SYS_symlinkat;
552 tests[12].num_of_cases = 3;
553 tests[12].name = "symlinkat";
554 tests[12].tests[0].result = EBADF;
555 tests[12].tests[0].params[0].cp = file;
556 tests[12].tests[0].params[1].i = 106; /* invalid fd */
557 tests[12].tests[0].params[2].cp = file;
558 tests[12].tests[1].result = ENOTDIR;
559 tests[12].tests[1].params[0].cp = file;
560 tests[12].tests[1].params[1].i = notd_fd;
561 tests[12].tests[1].params[2].cp = relative_file;
562 tests[12].tests[2].result = 0;
563 tests[12].tests[2].params[0].cp = absolute_file;
564 tests[12].tests[2].params[1].i = rel_fd;
565 tests[12].tests[2].params[2].cp = newslink;
569 tests[13].syscall = SYS_unlinkat;
570 tests[13].num_of_cases = 7;
571 tests[13].name = "unlinkat";
572 tests[13].tests[0].result = EBADF;
573 tests[13].tests[0].params[0].i = 106; /* invalid fd */
574 tests[13].tests[0].params[1].cp = relative_file;
575 tests[13].tests[0].params[2].i = 0;
576 tests[13].tests[1].result = ENOTDIR;
577 tests[13].tests[1].params[0].i = notd_fd;
578 tests[13].tests[1].params[1].cp = relative_file;
579 tests[13].tests[1].params[2].i = 0;
580 tests[13].tests[2].result = EINVAL;
581 tests[13].tests[2].params[0].i = rel_fd;
582 tests[13].tests[2].params[1].cp = file;
583 tests[13].tests[2].params[2].i = 123; /* invalid flag */
584 tests[13].tests[3].result = ENOTDIR;
585 tests[13].tests[3].params[0].i = rel_fd;
586 tests[13].tests[3].params[1].cp = not_dir_path;
587 tests[13].tests[3].params[2].i = AT_REMOVEDIR;
588 tests[13].tests[4].result = ENOTEMPTY;
589 tests[13].tests[4].params[0].i = AT_FDCWD;
590 tests[13].tests[4].params[1].cp = relative_path;
591 tests[13].tests[4].params[2].i = AT_REMOVEDIR;
592 tests[13].tests[5].result = 0;
593 tests[13].tests[5].params[0].i = rel_fd;
594 tests[13].tests[5].params[1].cp = newdir;
595 tests[13].tests[5].params[2].i = AT_REMOVEDIR;
596 tests[13].tests[6].result = 0;
597 tests[13].tests[6].params[0].i = AT_FDCWD;
598 tests[13].tests[6].params[1].cp = newfile;
599 tests[13].tests[6].params[2].i = 0;
603 tests[14].syscall = SYS_fexecve;
604 tests[14].num_of_cases = 2;
605 tests[14].name = "fexecve";
606 tests[14].tests[0].result = EBADF;
607 tests[14].tests[0].params[0].i = 106; /* invalid fd */
608 tests[14].tests[0].params[1].cpp = pargv;
609 tests[14].tests[0].params[2].cpp = NULL;
611 tests[14].tests[1].result = 0;
612 tests[14].tests[1].params[0].i = exec_fd;
613 tests[14].tests[1].params[1].cpp = pargv;
614 tests[14].tests[1].params[2].cpp = NULL;
640 printf("\nTest: %s\n", tests[i].name);
641 for (j = 0; j < tests[i].num_of_cases; j++) {
642 error = syscall(tests[i].syscall,
643 tests[i].tests[j].params[0],
644 tests[i].tests[j].params[1],
645 tests[i].tests[j].params[2],
646 tests[i].tests[j].params[3],
647 tests[i].tests[j].params[4]);
649 if (tests[i].tests[j].result == 0)
653 printf("expected %i, but got %i\n", tests[i].tests[j].result, error);
656 if (tests[i].tests[j].result == errno)
659 if (error != tests[i].tests[j].result) {
661 printf("expected %i, but got %i\n", tests[i].tests[j].result, error);