public inbox for ltp@lists.linux.it
 help / color / mirror / Atom feed
* [LTP] [PATCH 1/2] runltp: fix errors when using getenv(3) to get environment variable LTP_BIG_DEV or LTP_BIG_DEV_FS_TYPE
@ 2014-04-15 11:33 Xiaoguang Wang
  2014-04-15 11:33 ` [LTP] [PATCH 2/2] syscalls/rename/rename11.c: add ELOOP, EMLINK and EROFS error value tests Xiaoguang Wang
  2014-04-22 13:59 ` [LTP] [PATCH 1/2] runltp: fix errors when using getenv(3) to get environment variable LTP_BIG_DEV or LTP_BIG_DEV_FS_TYPE chrubis
  0 siblings, 2 replies; 5+ messages in thread
From: Xiaoguang Wang @ 2014-04-15 11:33 UTC (permalink / raw)
  To: ltp-list

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>
---
 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
Ltp-list@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/ltp-list

^ permalink raw reply related	[flat|nested] 5+ messages in thread

end of thread, other threads:[~2014-05-20 12:24 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2014-04-15 11:33 [LTP] [PATCH 1/2] runltp: fix errors when using getenv(3) to get environment variable LTP_BIG_DEV or LTP_BIG_DEV_FS_TYPE Xiaoguang Wang
2014-04-15 11:33 ` [LTP] [PATCH 2/2] syscalls/rename/rename11.c: add ELOOP, EMLINK and EROFS error value tests Xiaoguang Wang
2014-05-19 16:29   ` chrubis
     [not found]     ` <537B4259.2010200@cn.fujitsu.com>
2014-05-20 12:24       ` chrubis
2014-04-22 13:59 ` [LTP] [PATCH 1/2] runltp: fix errors when using getenv(3) to get environment variable LTP_BIG_DEV or LTP_BIG_DEV_FS_TYPE chrubis

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox