All of lore.kernel.org
 help / color / mirror / Atom feed
* [LTP] [PATCH] fs/ext4-new-features: add ext4-new-features tests to the default
@ 2013-11-13 12:57 Xiaoguang Wang
  2013-11-13 16:02 ` chrubis
  0 siblings, 1 reply; 4+ messages in thread
From: Xiaoguang Wang @ 2013-11-13 12:57 UTC (permalink / raw)
  To: ltp-list


Here treat every feature as a signle test program.

Makefile: add configure for ffsb

runtest/fs_ext4: 5 new features test currently enabled

run_ext4_test.sh: According to the input parameter to decide which
feature test to be called.

Signed-off-by: Xiaoguang Wang <wangxg.fnst@cn.fujitsu.com>
---
 runtest/fs_ext4                                    |   6 +-
 testcases/kernel/fs/Makefile                       |   2 +-
 testcases/kernel/fs/ext4-new-features/Makefile     |   1 +
 .../kernel/fs/ext4-new-features/run_ext4_test.sh   | 115 ++++++---------------
 4 files changed, 37 insertions(+), 87 deletions(-)

diff --git a/runtest/fs_ext4 b/runtest/fs_ext4
index c65ebab..84b6486 100644
--- a/runtest/fs_ext4
+++ b/runtest/fs_ext4
@@ -1 +1,5 @@
-ext4_new_feature_test	run_ext4_test.sh
+ext4-inode-version	run_ext4_test.sh ext4_inode_version_test
+ext4-nsec-timestamps	run_ext4_test.sh ext4_nsec_timestamps_test
+ext4-persist-prealloc	run_ext4_test.sh ext4_persist_prealloc_test
+ext4-subdir-limit	run_ext4_test.sh ext4_subdir_limit_test
+ext4-uninit-groups	run_ext4_test.sh ext4_uninit_groups_test
diff --git a/testcases/kernel/fs/Makefile b/testcases/kernel/fs/Makefile
index afad6f9..81310f5 100644
--- a/testcases/kernel/fs/Makefile
+++ b/testcases/kernel/fs/Makefile
@@ -27,6 +27,6 @@ include $(top_srcdir)/include/mk/env_pre.mk
 # XXX (garrcoop): Need to add autoconf checks for JFS.
 # ext4-new-features: This test need to be configured be user.
 # Please read $LTPROOT/README to see the detail information
-FILTER_OUT_DIRS		:= dmapi ext4-new-features
+FILTER_OUT_DIRS		:= dmapi
 
 include $(top_srcdir)/include/mk/generic_trunk_target.mk
diff --git a/testcases/kernel/fs/ext4-new-features/Makefile b/testcases/kernel/fs/ext4-new-features/Makefile
index 208b8a6..1ad1c3c 100644
--- a/testcases/kernel/fs/ext4-new-features/Makefile
+++ b/testcases/kernel/fs/ext4-new-features/Makefile
@@ -32,6 +32,7 @@ FILTER_OUT_DIRS		:= $(FFSBDIR)
 FFSB			:= $(FFSBDIR)/ffsb
 
 $(FFSB): $(FFSBDIR)
+	cd $^; ./configure
 	$(MAKE) -C $^ -f "$(abs_srcdir)/$^/Makefile" all
 	cp $(FFSBDIR)/ffsb ffsb
 
diff --git a/testcases/kernel/fs/ext4-new-features/run_ext4_test.sh b/testcases/kernel/fs/ext4-new-features/run_ext4_test.sh
index bfbd844..4ede8f7 100755
--- a/testcases/kernel/fs/ext4-new-features/run_ext4_test.sh
+++ b/testcases/kernel/fs/ext4-new-features/run_ext4_test.sh
@@ -38,11 +38,15 @@
 ################################################################################
 
 source ext4_funcs.sh;
+test_features=$1
 
 export TCID="ext4_new_feature"
 export TST_TOTAL=1
 export TST_COUNT=1
 
+script_name="$test_features"".sh"
+BLOCK_COUNT=3072
+
 tst_kvercmp 2 6 31
 if [ $? -eq 0 ]; then
 	tst_brkm TCONF ignored "kernel is below 2.6.31"
@@ -71,6 +75,22 @@ if [ ! -f "ext4-test-config" ]; then
 	exit 0
 fi
 
+# create an ext4 partition
+dd if=/dev/zero of=fs_ext4_new_features_$$.img bs=1M count=$BLOCK_COUNT
+
+if [ $? -ne 0 ];then
+	tst_brkm TCONF ignored "failed to create an ext4 image file"
+	exit 0
+fi
+
+EXT4_DEV=$(losetup --show -f fs_ext4_new_features_$$.img)
+if [ $? -ne 0 ];then
+	tst_brkm TCONF ignored "set loop device failed"
+	exit 0
+fi
+
+echo "EXT4_DEV=$EXT4_DEV" > ./ext4-test-config
+
 cd $LTPROOT/testcases/bin/
 
 RET=0
@@ -79,101 +99,26 @@ echo "EXT4 NEW FEATURE TESTING";
 echo "TEST STARTED: Please avoid using system while this test executes";
 
 echo " "
-echo "Ext4 block allocation test"
-if [ -f "ext4-alloc-test.sh" ]; then
-	./ext4-alloc-test.sh ./ext4-test-config
+echo "$test_features"
+if [ -f "$script_name" ]; then
+	./$script_name ./ext4-test-config
 	if [ $? -ne 0 ]; then
 		RET=1
 	fi
 else
-	echo "Shell file is not installed..Please check Makefile..."
+	echo "$script_name is not installed..Please check Makefile..."
 	RET=1
 fi
 
-echo " "
-echo "Ext4 journal checksum test"
-if [ -f "ext4_journal_checksum.sh" ]; then
-	./ext4_journal_checksum.sh ./ext4-test-config
-	if [ $? -ne 0 ]; then
-		RET=1
-	fi
-else
-	echo "Shell file is not installed..Please check Makefile..."
-	RET=1
-fi
 
-echo " "
-echo "Ext4 subdir limit test"
-if [ -f "ext4_subdir_limit_test.sh" ]; then
-	./ext4_subdir_limit_test.sh ./ext4-test-config
-	if [ $? -ne 0 ]; then
-		RET=1
-	fi
-else
-	echo "Shell file is not installed..Please check Makefile..."
-	RET=1
-fi
-
-echo " "
-echo "Ext4 nanosecond timestamp test"
-if [ -f "ext4_nsec_timestamps_test.sh" ]; then
-	./ext4_nsec_timestamps_test.sh ./ext4-test-config
-	if [ $? -ne 0 ]; then
-		RET=1
-	fi
-else
-	echo "Shell file is not installed..Please check Makefile..."
-	RET=1
-fi
 
-echo " "
-echo "Ext4 persist prealloc test"
-if [ -f "ext4_persist_prealloc_test.sh" ]; then
-	./ext4_persist_prealloc_test.sh ./ext4-test-config
-	if [ $? -ne 0 ]; then
-		RET=1
-	fi
-else
-	echo "Shell file is not installed..Please check Makefile..."
-	RET=1
-fi
-
-echo " "
-echo "Ext4 inode version test"
-if [ -f "ext4_inode_version_test.sh" ]; then
-	./ext4_inode_version_test.sh ./ext4-test-config
-	if [ $? -ne 0 ]; then
-		RET=1
-	fi
-else
-	echo "Shell file is not installed..Please check Makefile..."
-	RET=1
-fi
-
-echo " "
-echo "Ext4 uninit groups test"
-if [ -f "ext4_uninit_groups_test.sh" ]; then
-	./ext4_uninit_groups_test.sh ./ext4-test-config
-	if [ $? -ne 0 ]; then
-		RET=1
-	fi
-else
-	echo "Shell file is not installed..Please check Makefile..."
-	RET=1
+# cleanup
+losetup -d $EXT4_DEV
+if [ $? -ne 0 ];then
+	tst_brkm TCONF ignored "failed to delete loop: $EXT4_DEV"
+	exit 0
 fi
 
-echo " "
-echo "Ext4 online defrag test"
-echo "The output of defrag program is in the file"\
-	"LTPROOT/output/ext4_online_defrag.txt"
-if [ -f "ext4_online_defrag_test.sh" ]; then
-	./ext4_online_defrag_test.sh ./ext4-test-config
-	if [ $? -ne 0 ]; then
-		RET=1
-	fi
-else
-	echo "Shell file is not installed..Please check Makefile..."
-	RET=1
-fi
+rm -f fs_ext4_new_features_$$.img
 
 exit $RET
-- 
1.8.2.1


------------------------------------------------------------------------------
DreamFactory - Open Source REST & JSON Services for HTML5 & Native Apps
OAuth, Users, Roles, SQL, NoSQL, BLOB Storage and External API Access
Free app hosting. Or install the open source package on any LAMP server.
Sign up and see examples for AngularJS, jQuery, Sencha Touch and Native!
http://pubads.g.doubleclick.net/gampad/clk?id=63469471&iu=/4140/ostg.clktrk
_______________________________________________
Ltp-list mailing list
Ltp-list@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/ltp-list

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

* Re: [LTP] [PATCH] fs/ext4-new-features: add ext4-new-features tests to the default
  2013-11-13 12:57 [LTP] [PATCH] fs/ext4-new-features: add ext4-new-features tests to the default Xiaoguang Wang
@ 2013-11-13 16:02 ` chrubis
  2013-11-14 12:34   ` chrubis
       [not found]   ` <52858E29.7090602@cn.fujitsu.com>
  0 siblings, 2 replies; 4+ messages in thread
From: chrubis @ 2013-11-13 16:02 UTC (permalink / raw)
  To: Xiaoguang Wang; +Cc: ltp-list

Hi!
> Here treat every feature as a signle test program.
> 
> Makefile: add configure for ffsb
> 
> runtest/fs_ext4: 5 new features test currently enabled
> 
> run_ext4_test.sh: According to the input parameter to decide which
> feature test to be called.
> 
> Signed-off-by: Xiaoguang Wang <wangxg.fnst@cn.fujitsu.com>
> ---
>  runtest/fs_ext4                                    |   6 +-
>  testcases/kernel/fs/Makefile                       |   2 +-
>  testcases/kernel/fs/ext4-new-features/Makefile     |   1 +
>  .../kernel/fs/ext4-new-features/run_ext4_test.sh   | 115 ++++++---------------
>  4 files changed, 37 insertions(+), 87 deletions(-)
> 
> diff --git a/runtest/fs_ext4 b/runtest/fs_ext4
> index c65ebab..84b6486 100644
> --- a/runtest/fs_ext4
> +++ b/runtest/fs_ext4
> @@ -1 +1,5 @@
> -ext4_new_feature_test	run_ext4_test.sh
> +ext4-inode-version	run_ext4_test.sh ext4_inode_version_test
> +ext4-nsec-timestamps	run_ext4_test.sh ext4_nsec_timestamps_test
> +ext4-persist-prealloc	run_ext4_test.sh ext4_persist_prealloc_test
> +ext4-subdir-limit	run_ext4_test.sh ext4_subdir_limit_test
> +ext4-uninit-groups	run_ext4_test.sh ext4_uninit_groups_test
> diff --git a/testcases/kernel/fs/Makefile b/testcases/kernel/fs/Makefile
> index afad6f9..81310f5 100644
> --- a/testcases/kernel/fs/Makefile
> +++ b/testcases/kernel/fs/Makefile
> @@ -27,6 +27,6 @@ include $(top_srcdir)/include/mk/env_pre.mk
>  # XXX (garrcoop): Need to add autoconf checks for JFS.
>  # ext4-new-features: This test need to be configured be user.
>  # Please read $LTPROOT/README to see the detail information
> -FILTER_OUT_DIRS		:= dmapi ext4-new-features
> +FILTER_OUT_DIRS		:= dmapi
>  
>  include $(top_srcdir)/include/mk/generic_trunk_target.mk
> diff --git a/testcases/kernel/fs/ext4-new-features/Makefile b/testcases/kernel/fs/ext4-new-features/Makefile
> index 208b8a6..1ad1c3c 100644
> --- a/testcases/kernel/fs/ext4-new-features/Makefile
> +++ b/testcases/kernel/fs/ext4-new-features/Makefile
> @@ -32,6 +32,7 @@ FILTER_OUT_DIRS		:= $(FFSBDIR)
>  FFSB			:= $(FFSBDIR)/ffsb
>  
>  $(FFSB): $(FFSBDIR)
> +	cd $^; ./configure
>  	$(MAKE) -C $^ -f "$(abs_srcdir)/$^/Makefile" all
>  	cp $(FFSBDIR)/ffsb ffsb

The way how ffsb is bundled in LTP is simply wrong, it shouldn't be in
the source tree at all. What I would like to see is to:

1. modify testcases that depends on it to return TCONF with
   message that explains that ffsb must be installed to run
   the testcases if ffsb is not found in PATH

   or alternatively use something different to create the
   I/O load

2. remove ffsb from the LTP git tree

> diff --git a/testcases/kernel/fs/ext4-new-features/run_ext4_test.sh b/testcases/kernel/fs/ext4-new-features/run_ext4_test.sh
> index bfbd844..4ede8f7 100755
> --- a/testcases/kernel/fs/ext4-new-features/run_ext4_test.sh
> +++ b/testcases/kernel/fs/ext4-new-features/run_ext4_test.sh
> @@ -38,11 +38,15 @@
>  ################################################################################
>  
>  source ext4_funcs.sh;
> +test_features=$1
>  
>  export TCID="ext4_new_feature"
>  export TST_TOTAL=1
>  export TST_COUNT=1
>  
> +script_name="$test_features"".sh"
> +BLOCK_COUNT=3072
> +
>  tst_kvercmp 2 6 31
>  if [ $? -eq 0 ]; then
>  	tst_brkm TCONF ignored "kernel is below 2.6.31"
> @@ -71,6 +75,22 @@ if [ ! -f "ext4-test-config" ]; then
>  	exit 0
>  fi
>  
> +# create an ext4 partition
> +dd if=/dev/zero of=fs_ext4_new_features_$$.img bs=1M count=$BLOCK_COUNT
> +
> +if [ $? -ne 0 ];then
> +	tst_brkm TCONF ignored "failed to create an ext4 image file"
> +	exit 0
> +fi
> +
> +EXT4_DEV=$(losetup --show -f fs_ext4_new_features_$$.img)
> +if [ $? -ne 0 ];then
> +	tst_brkm TCONF ignored "set loop device failed"
> +	exit 0
> +fi
> +
> +echo "EXT4_DEV=$EXT4_DEV" > ./ext4-test-config
> +

We should use DEVICE passed to the runltp script instead, that way we
don't even need this helper (if there is some common code move it to
ex4_funcs.sh and use it from the tests) and call the test scripts
from runtest file directly.

And also remove the configure that asks user about which device to use.

-- 
Cyril Hrubis
chrubis@suse.cz

------------------------------------------------------------------------------
DreamFactory - Open Source REST & JSON Services for HTML5 & Native Apps
OAuth, Users, Roles, SQL, NoSQL, BLOB Storage and External API Access
Free app hosting. Or install the open source package on any LAMP server.
Sign up and see examples for AngularJS, jQuery, Sencha Touch and Native!
http://pubads.g.doubleclick.net/gampad/clk?id=63469471&iu=/4140/ostg.clktrk
_______________________________________________
Ltp-list mailing list
Ltp-list@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/ltp-list

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

* Re: [LTP] [PATCH] fs/ext4-new-features: add ext4-new-features tests to the default
  2013-11-13 16:02 ` chrubis
@ 2013-11-14 12:34   ` chrubis
       [not found]   ` <52858E29.7090602@cn.fujitsu.com>
  1 sibling, 0 replies; 4+ messages in thread
From: chrubis @ 2013-11-14 12:34 UTC (permalink / raw)
  To: Xiaoguang Wang; +Cc: ltp-list

Hi!
> >  include $(top_srcdir)/include/mk/generic_trunk_target.mk
> > diff --git a/testcases/kernel/fs/ext4-new-features/Makefile b/testcases/kernel/fs/ext4-new-features/Makefile
> > index 208b8a6..1ad1c3c 100644
> > --- a/testcases/kernel/fs/ext4-new-features/Makefile
> > +++ b/testcases/kernel/fs/ext4-new-features/Makefile
> > @@ -32,6 +32,7 @@ FILTER_OUT_DIRS		:= $(FFSBDIR)
> >  FFSB			:= $(FFSBDIR)/ffsb
> >  
> >  $(FFSB): $(FFSBDIR)
> > +	cd $^; ./configure
> >  	$(MAKE) -C $^ -f "$(abs_srcdir)/$^/Makefile" all
> >  	cp $(FFSBDIR)/ffsb ffsb
> 
> The way how ffsb is bundled in LTP is simply wrong, it shouldn't be in
> the source tree at all. What I would like to see is to:
> 
> 1. modify testcases that depends on it to return TCONF with
>    message that explains that ffsb must be installed to run
>    the testcases if ffsb is not found in PATH
> 
>    or alternatively use something different to create the
>    I/O load
> 
> 2. remove ffsb from the LTP git tree

Or at least the source tree should be moved to a proper place, there is
utils/benchmar/ directory for this purpose allready.

-- 
Cyril Hrubis
chrubis@suse.cz

------------------------------------------------------------------------------
DreamFactory - Open Source REST & JSON Services for HTML5 & Native Apps
OAuth, Users, Roles, SQL, NoSQL, BLOB Storage and External API Access
Free app hosting. Or install the open source package on any LAMP server.
Sign up and see examples for AngularJS, jQuery, Sencha Touch and Native!
http://pubads.g.doubleclick.net/gampad/clk?id=63469471&iu=/4140/ostg.clktrk
_______________________________________________
Ltp-list mailing list
Ltp-list@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/ltp-list

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

* Re: [LTP] [PATCH] fs/ext4-new-features: add ext4-new-features tests to the default
       [not found]   ` <52858E29.7090602@cn.fujitsu.com>
@ 2013-11-19 14:22     ` chrubis
  0 siblings, 0 replies; 4+ messages in thread
From: chrubis @ 2013-11-19 14:22 UTC (permalink / raw)
  To: Wang Xiaoguang; +Cc: ltp-list

Hi!
> >> +# create an ext4 partition
> >> +dd if=/dev/zero of=fs_ext4_new_features_$$.img bs=1M count=$BLOCK_COUNT
> >> +
> >> +if [ $? -ne 0 ];then
> >> +	tst_brkm TCONF ignored "failed to create an ext4 image file"
> >> +	exit 0
> >> +fi
> >> +
> >> +EXT4_DEV=$(losetup --show -f fs_ext4_new_features_$$.img)
> >> +if [ $? -ne 0 ];then
> >> +	tst_brkm TCONF ignored "set loop device failed"
> >> +	exit 0
> >> +fi
> >> +
> >> +echo "EXT4_DEV=$EXT4_DEV" > ./ext4-test-config
> >> +
> > We should use DEVICE passed to the runltp script instead, that way we
> > don't even need this helper (if there is some common code move it to
> > ex4_funcs.sh and use it from the tests) and call the test scripts
> > from runtest file directly.
> 
> The ext4 new features test need a big partition, and the recommended
> size of this partition is between 5G and 10G, so the DEVICE isn't appropriate.
> 
> Whether I should create a big partition in runltp script named BIG_DEVICE to
> run these tests?
> 

Sounds reasonable to me.

-- 
Cyril Hrubis
chrubis@suse.cz

------------------------------------------------------------------------------
Shape the Mobile Experience: Free Subscription
Software experts and developers: Be at the forefront of tech innovation.
Intel(R) Software Adrenaline delivers strategic insight and game-changing 
conversations that shape the rapidly evolving mobile landscape. Sign up now. 
http://pubads.g.doubleclick.net/gampad/clk?id=63431311&iu=/4140/ostg.clktrk
_______________________________________________
Ltp-list mailing list
Ltp-list@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/ltp-list

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

end of thread, other threads:[~2013-11-19 14:23 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2013-11-13 12:57 [LTP] [PATCH] fs/ext4-new-features: add ext4-new-features tests to the default Xiaoguang Wang
2013-11-13 16:02 ` chrubis
2013-11-14 12:34   ` chrubis
     [not found]   ` <52858E29.7090602@cn.fujitsu.com>
2013-11-19 14:22     ` chrubis

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.