Commit c736b62
Dongsu Park
runtimetest: correctly check for a readable directory
So far tests linux_masked_paths.t & linux_readonly_paths.t have failed
with error messages like `cannot test read access for "/dirname"`.
That's because `testReadAccess()` only checked if the given path is a
regular file, returning an error for every other case.
`testReadAccess()` should actually take care of another case of a given
path being a directory, to be able to correctly check for its readability.
Also run `testFileReadAccess()` or `testFileWriteAccess()` for all file
types, not only a normal file, because the runtime spec does not mandate
the type of masked files. It could be actually a character device like
`/dev/null`, especially in case of runc.
Found by @alban.
Signed-off-by: Dongsu Park <dongsu@kinvolk.io>1 parent 9185c46 commit c736b62
File tree
3 files changed
+36
-6
lines changed- cmd/runtimetest
- validation
3 files changed
+36
-6
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
409 | 409 | | |
410 | 410 | | |
411 | 411 | | |
412 | | - | |
413 | | - | |
| 412 | + | |
| 413 | + | |
| 414 | + | |
| 415 | + | |
| 416 | + | |
| 417 | + | |
| 418 | + | |
414 | 419 | | |
415 | | - | |
| 420 | + | |
| 421 | + | |
| 422 | + | |
| 423 | + | |
| 424 | + | |
| 425 | + | |
| 426 | + | |
| 427 | + | |
| 428 | + | |
| 429 | + | |
| 430 | + | |
416 | 431 | | |
417 | 432 | | |
418 | 433 | | |
| |||
439 | 454 | | |
440 | 455 | | |
441 | 456 | | |
| 457 | + | |
| 458 | + | |
| 459 | + | |
| 460 | + | |
| 461 | + | |
442 | 462 | | |
443 | 463 | | |
444 | | - | |
445 | | - | |
446 | 464 | | |
447 | | - | |
| 465 | + | |
448 | 466 | | |
449 | 467 | | |
450 | 468 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
21 | 21 | | |
22 | 22 | | |
23 | 23 | | |
| 24 | + | |
| 25 | + | |
| 26 | + | |
| 27 | + | |
| 28 | + | |
| 29 | + | |
24 | 30 | | |
25 | 31 | | |
26 | 32 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
21 | 21 | | |
22 | 22 | | |
23 | 23 | | |
| 24 | + | |
| 25 | + | |
| 26 | + | |
| 27 | + | |
| 28 | + | |
| 29 | + | |
24 | 30 | | |
25 | 31 | | |
26 | 32 | | |
| |||
0 commit comments