Make runltp export LTP_BIG_DEV and LTP_BIG_DEV_FS_TYPE only when they have a
non-zero
value. We do this to make getenv("LTP_BIG_DEV") or getenv("LTP_BIG_DEV_FS_TYPE")
return NULL, if user does not specify a big block device. Because users usually
write
such code:
device = getenv("LTP_BIG_DEV");
if (device == NULL) {
tst_brkm(TCONF, NULL,
"you must specify a big blockdevice(>1.2G)");
} else {
tst_mkfs(NULL, device, "ext3", NULL);
}
Signed-off-by: Xiaoguang Wang <[email protected]>
---
runltp | 11 +++++++----
1 file changed, 7 insertions(+), 4 deletions(-)
diff --git a/runltp b/runltp
index 9cb5fe8..ea328f0 100755
--- a/runltp
+++ b/runltp
@@ -81,9 +81,7 @@ setup()
export PATH="${PATH}:${LTPROOT}/testcases/bin"
export LTP_DEV=""
- export LTP_BIG_DEV=""
export LTP_DEV_FS_TYPE="ext2"
- export LTP_BIG_DEV_FS_TYPE="ext2"
[ -d "$LTPROOT/testcases/bin" ] ||
{
@@ -433,7 +431,7 @@ main()
b) DEVICE=$OPTARG;;
B) LTP_DEV_FS_TYPE=$OPTARG;;
z) BIG_DEVICE=$OPTARG;;
- Z) LTP_BIG_DEV_FS_TYPE=$OPTARG;;
+ Z) BIG_DEVICE_FS_TYPE=$OPTARG;;
\?) usage;;
esac
done
@@ -696,7 +694,12 @@ main()
echo "Tests which require a big block device are disabled."
echo "You can specify it with option -z"
else
- LTP_BIG_DEV=$BIG_DEVICE
+ export LTP_BIG_DEV=$BIG_DEVICE
+ if [ -z "$BIG_DEVICE_FS_TYPE" ];then
+ export LTP_BIG_DEV_FS_TYPE="ext2"
+ else
+ export LTP_BIG_DEV_FS_TYPE=$BIG_DEVICE_FS_TYPE
+ fi
fi
if [ $RUN_REPEATED -gt 1 ]; then # You need to specify at least more than
1 sequential run, else it runs default
--
1.8.2.1
------------------------------------------------------------------------------
Learn Graph Databases - Download FREE O'Reilly Book
"Graph Databases" is the definitive new guide to graph databases and their
applications. Written by three acclaimed leaders in the field,
this first edition is now available. Download your free book today!
http://p.sf.net/sfu/NeoTech
_______________________________________________
Ltp-list mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/ltp-list