Message ID | 20200824102439.26587-1-pvorel@suse.cz |
---|---|
State | Changes Requested |
Headers | show |
Series | [1/1] prepare_lvm.sh: Allow to define tmp directory | expand |
On 24. 08. 20 12:24, Petr Vorel wrote: > Many distros don't have enough /tmp size for LVM tests, thus > allow to set $LVM_DIR to use different temporary directory. > > Signed-off-by: Petr Vorel <pvorel@suse.cz> > --- > testcases/misc/lvm/prepare_lvm.sh | 5 +++-- > 1 file changed, 3 insertions(+), 2 deletions(-) > > diff --git a/testcases/misc/lvm/prepare_lvm.sh b/testcases/misc/lvm/prepare_lvm.sh > index e7f9c90e4..b6557f221 100755 > --- a/testcases/misc/lvm/prepare_lvm.sh > +++ b/testcases/misc/lvm/prepare_lvm.sh > @@ -9,8 +9,9 @@ TST_NEEDS_ROOT=1 > TST_NEEDS_CMDS="mount pvcreate vgcreate lvcreate" > . tst_test.sh > > -LVM_TMPDIR="/tmp/ltp/growfiles" > -LVM_IMGDIR="/tmp/ltp/imgfiles" > +LVM_DIR="${LVM_DIR:-/tmp}" > +LVM_TMPDIR="$LVM_DIR/ltp/growfiles" > +LVM_IMGDIR="$LVM_DIR/ltp/imgfiles" > > error_check() > { > You should change only LVM_IMGDIR where the backing files are stored. If you also change LVM_TMPDIR, it'll break the lvm.local runfile. Also don't forget to update cleanup_lvm.sh.
Hi Martin, ... > You should change only LVM_IMGDIR where the backing files are stored. If > you also change LVM_TMPDIR, it'll break the lvm.local runfile. Wouldn't be less confusing to change both directories? Updating generate_lvm_runfile.sh is trivial (ignoring variable setup in all 3 scripts): - sed -e "s/{fsname}/$fsname/g" "$INFILE" >>"$OUTFILE" + sed -e "s/{fsname}/$fsname/g; s^/tmp/ltp/^$LVM_DIR/ltp^g" "$INFILE" >>"$OUTFILE" > Also don't forget to update cleanup_lvm.sh. Good point, thanks! Kind regards, Petr
diff --git a/testcases/misc/lvm/prepare_lvm.sh b/testcases/misc/lvm/prepare_lvm.sh index e7f9c90e4..b6557f221 100755 --- a/testcases/misc/lvm/prepare_lvm.sh +++ b/testcases/misc/lvm/prepare_lvm.sh @@ -9,8 +9,9 @@ TST_NEEDS_ROOT=1 TST_NEEDS_CMDS="mount pvcreate vgcreate lvcreate" . tst_test.sh -LVM_TMPDIR="/tmp/ltp/growfiles" -LVM_IMGDIR="/tmp/ltp/imgfiles" +LVM_DIR="${LVM_DIR:-/tmp}" +LVM_TMPDIR="$LVM_DIR/ltp/growfiles" +LVM_IMGDIR="$LVM_DIR/ltp/imgfiles" error_check() {
Many distros don't have enough /tmp size for LVM tests, thus allow to set $LVM_DIR to use different temporary directory. Signed-off-by: Petr Vorel <pvorel@suse.cz> --- testcases/misc/lvm/prepare_lvm.sh | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-)