aboutsummaryrefslogtreecommitdiff
path: root/runltp
diff options
context:
space:
mode:
authorXiaoguang Wang <wangxg.fnst@cn.fujitsu.com>2014-04-15 19:33:21 +0800
committerCyril Hrubis <chrubis@suse.cz>2014-04-22 15:57:17 +0200
commitcb1a4aee3c941da11c2e81a06252c2a465be62d8 (patch)
tree531714bdc9cfc0f1a6700e33d3047c268af71f2f /runltp
parent49e8615fd07b150891182e202d356384c8c98416 (diff)
runltp: Do not export empty LTP_BIG_DEV and LTP_BIG_DEV_FS_TYPE
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 <wangxg.fnst@cn.fujitsu.com>
Diffstat (limited to 'runltp')
-rwxr-xr-xrunltp11
1 files changed, 7 insertions, 4 deletions
diff --git a/runltp b/runltp
index 9cb5fe829..ad9b7d166 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