shell: TST_NEEDS_DEVICE imply TST_TMPDIR
PATCH 1/1 shell: TST_NEEDS_DEVICE imply TST_TMPDIR
instead of requiring to be set.
This is a sync with C API (previous commit).
---
Hi,
sync shell API with patch for C API
(should be accepted only if we agree on
https://patchwork.ozlabs.org/patch/1204029/).
Kind regards,
Petr
doc/test-writing-guidelines.txt | 1 + testcases/commands/df/df01.sh | 1 - testcases/commands/mkfs/mkfs01.sh | 1 - testcases/commands/mkswap/mkswap01.sh | 1 - testcases/kernel/security/integrity/ima/tests/ima_setup.sh | 1 - testcases/lib/tst_test.sh | 5 ++--- 6 files changed, 3 insertions(+), 7 deletions(-)
doc/test-writing-guidelines.txt +1 -0
@@ -2125,6 +2125,7 @@ simply by setting right '$TST_NEEDS_FOO'. | 'TST_NEEDS_TMPDIR' | Create test temporary directory and cd into it. | 'TST_NEEDS_DEVICE' | Prepare test temporary device, the path to testing device is stored in '$TST_DEVICE' variable. + The option implies 'TST_NEEDS_TMPDIR'. | 'TST_NEEDS_CMDS' | String with command names that has to be present for the test (see below). | 'TST_NEEDS_MODULE' | Test module name needed for the test (see below).
testcases/commands/df/df01.sh +0 -1
@@ -13,7 +13,6 @@ TST_OPTS="f:" TST_USAGE=usage TST_PARSE_ARGS=parse_args TST_NEEDS_ROOT=1 -TST_NEEDS_TMPDIR=1 TST_NEEDS_DEVICE=1 . tst_test.sh
testcases/commands/mkfs/mkfs01.sh +0 -1
@@ -12,7 +12,6 @@ TST_OPTS="f:" TST_USAGE=usage TST_PARSE_ARGS=parse_args TST_NEEDS_ROOT=1 -TST_NEEDS_TMPDIR=1 TST_NEEDS_DEVICE=1 TST_NEEDS_CMDS="blkid df" . tst_test.sh
testcases/commands/mkswap/mkswap01.sh +0 -1
@@ -9,7 +9,6 @@ TST_CNT=10 TST_SETUP=setup TST_TESTFUNC=do_test TST_NEEDS_ROOT=1 -TST_NEEDS_TMPDIR=1 TST_NEEDS_DEVICE=1 TST_NEEDS_CMDS="uuidgen blkid blockdev mkswap" . tst_test.sh
testcases/kernel/security/integrity/ima/tests/ima_setup.sh +0 -1
@@ -9,7 +9,6 @@ TST_SETUP_CALLER="$TST_SETUP" TST_SETUP="ima_setup" TST_CLEANUP_CALLER="$TST_CLEANUP" TST_CLEANUP="ima_cleanup" -TST_NEEDS_TMPDIR=1 TST_NEEDS_ROOT=1 . tst_test.sh
testcases/lib/tst_test.sh +2 -3
@@ -525,6 +525,8 @@ tst_run() _tst_setup_timer + [ "$TST_NEEDS_DEVICE" = 1 ] && TST_TMPDIR=1 + if [ "$TST_NEEDS_TMPDIR" = 1 ]; then if [ -z "$TMPDIR" ]; then export TMPDIR="/tmp"
@@ -541,9 +543,6 @@ tst_run() TST_MNTPOINT="${TST_MNTPOINT:-mntpoint}" if [ "$TST_NEEDS_DEVICE" = 1 ]; then - if [ -z ${TST_TMPDIR} ]; then - tst_brk TBROK "Use TST_NEEDS_TMPDIR must be set for TST_NEEDS_DEVICE" - fi TST_DEVICE=$(tst_device acquire)
Signature · 1 line
2.24.0
PATCH 1/1 shell: TST_NEEDS_DEVICE imply TST_TMPDIR
Quoted 3 lines · Petr Vorel
instead of requiring to be set.
This is a sync with C API (previous commit).
Hi Petr
Looks good to me, let's wait whether others have some objections.
Kind Regards,
Yang Xu
Quoted 103 lines
Signed-off-by Petr Vorel <[email protected]>---
Hi,sync shell API with patch for C API
(should be accepted only if we agree on
https://patchwork.ozlabs.org/patch/1204029/).Kind regards,
Petrdoc/test-writing-guidelines.txt | 1 + testcases/commands/df/df01.sh | 1 - testcases/commands/mkfs/mkfs01.sh | 1 - testcases/commands/mkswap/mkswap01.sh | 1 - testcases/kernel/security/integrity/ima/tests/ima_setup.sh | 1 - testcases/lib/tst_test.sh | 5 ++--- 6 files changed, 3 insertions(+), 7 deletions(-)doc/test-writing-guidelines.txt +1
-0@@ -2125,6 +2125,7 @@ simply by setting right '$TST_NEEDS_FOO'. | 'TST_NEEDS_TMPDIR' | Create test temporary directory and cd into it. | 'TST_NEEDS_DEVICE' | Prepare test temporary device, the path to testing device is stored in '$TST_DEVICE' variable. + The option implies 'TST_NEEDS_TMPDIR'. | 'TST_NEEDS_CMDS' | String with command names that has to be present for the test (see below). | 'TST_NEEDS_MODULE' | Test module name needed for the test (see below).testcases/commands/df/df01.sh +0
-1@@ -13,7 +13,6 @@ TST_OPTS="f:" TST_USAGE=usage TST_PARSE_ARGS=parse_args TST_NEEDS_ROOT=1 -TST_NEEDS_TMPDIR=1 TST_NEEDS_DEVICE=1 . tst_test.shtestcases/commands/mkfs/mkfs01.sh +0
-1@@ -12,7 +12,6 @@ TST_OPTS="f:" TST_USAGE=usage TST_PARSE_ARGS=parse_args TST_NEEDS_ROOT=1 -TST_NEEDS_TMPDIR=1 TST_NEEDS_DEVICE=1 TST_NEEDS_CMDS="blkid df" . tst_test.shtestcases/commands/mkswap/mkswap01.sh +0
-1@@ -9,7 +9,6 @@ TST_CNT=10 TST_SETUP=setup TST_TESTFUNC=do_test TST_NEEDS_ROOT=1 -TST_NEEDS_TMPDIR=1 TST_NEEDS_DEVICE=1 TST_NEEDS_CMDS="uuidgen blkid blockdev mkswap" . tst_test.shtestcases/kernel/security/integrity/ima/tests/ima_setup.sh +0
-1@@ -9,7 +9,6 @@ TST_SETUP_CALLER="$TST_SETUP" TST_SETUP="ima_setup" TST_CLEANUP_CALLER="$TST_CLEANUP" TST_CLEANUP="ima_cleanup" -TST_NEEDS_TMPDIR=1 TST_NEEDS_ROOT=1 . tst_test.shtestcases/lib/tst_test.sh +2
-3@@ -525,6 +525,8 @@ tst_run() _tst_setup_timer + [ "$TST_NEEDS_DEVICE" = 1 ] && TST_TMPDIR=1 + if [ "$TST_NEEDS_TMPDIR" = 1 ]; then if [ -z "$TMPDIR" ]; then export TMPDIR="/tmp"@@ -541,9 +543,6 @@ tst_run() TST_MNTPOINT="${TST_MNTPOINT:-mntpoint}" if [ "$TST_NEEDS_DEVICE" = 1 ]; then - if [ -z ${TST_TMPDIR} ]; then - tst_brk TBROK "Use TST_NEEDS_TMPDIR must be set for TST_NEEDS_DEVICE" - fi TST_DEVICE=$(tst_device acquire)
PATCH 1/1 shell: TST_NEEDS_DEVICE imply TST_TMPDIR
In reply to Petr VorelHi!
Quoted 2 lines
instead of requiring to be set.
This is a sync with C API (previous commit).
Looks good, acked.
Signature · 2 lines
Cyril Hrubis [email protected]
PATCH 1/1 shell: TST_NEEDS_DEVICE imply TST_TMPDIR
Hi Cyril,
Quoted 5 lines
Hi!
Quoted 2 lines
instead of requiring to be set.
This is a sync with C API (previous commit).Looks good, acked.
Thanks merged.
BTW any objections to related shell tst_mount()/tst_umount() fix?
https://patchwork.ozlabs.org/patch/1206399/
Kind regards,
Petr