LKML Archive on lore.kernel.org
help / color / mirror / Atom feed
* [PATCH] selftests: memfd: split regular and hugetlbfs tests
@ 2018-05-10 20:13 Shuah Khan (Samsung OSG)
  2018-05-11 16:43 ` Mike Kravetz
  0 siblings, 1 reply; 2+ messages in thread
From: Shuah Khan (Samsung OSG) @ 2018-05-10 20:13 UTC (permalink / raw)
  To: shuah, akpm, mike.kravetz
  Cc: marcandre.lureau, sj38.park, anders.roxell, lizhijian,
	linux-kselftest, linux-kernel

Split normal memfd and hugetlbfs tests to improve the test reporting.
Remove run_fuse_test.sh and memfd_test from run_tests.sh and add them
to the Makefile.

Add memfd_test to TEST_GEN_PROGS to be run separately.
Rename run_tests.sh to run_hugetlbfs_test.sh
Add run_fuse_test.sh and run_hugetlbfs_test.sh to TEST_PROGS

The report for non-root run wth this change is:

TAP version 13
selftests: memfd: memfd_test
========================================
memfd: CREATE
memfd: BASIC
memfd: SEAL-WRITE
memfd: SEAL-SHRINK
memfd: SEAL-GROW
memfd: SEAL-RESIZE
memfd: SHARE-DUP
memfd: SHARE-MMAP
memfd: SHARE-OPEN
memfd: SHARE-FORK
memfd: SHARE-DUP (shared file-table)
memfd: SHARE-MMAP (shared file-table)
memfd: SHARE-OPEN (shared file-table)
memfd: SHARE-FORK (shared file-table)
memfd: DONE
ok 1..1 selftests: memfd: memfd_test [PASS]
selftests: memfd: run_fuse_test.sh
========================================
opening: ./mnt/memfd
fuse: DONE
ok 1..2 selftests: memfd: run_fuse_test.sh [PASS]
selftests: memfd: run_hugetlbfs_test.sh
========================================
Please run memfd with hugetlbfs test as root
not ok 1..3 selftests: memfd: run_hugetlbfs_test.sh [SKIP]

Signed-off-by: Shuah Khan (Samsung OSG) <shuah@kernel.org>
---
 tools/testing/selftests/memfd/Makefile                              | 6 +++---
 .../testing/selftests/memfd/{run_tests.sh => run_hugetlbfs_test.sh} | 6 ------
 2 files changed, 3 insertions(+), 9 deletions(-)
 rename tools/testing/selftests/memfd/{run_tests.sh => run_hugetlbfs_test.sh} (95%)

diff --git a/tools/testing/selftests/memfd/Makefile b/tools/testing/selftests/memfd/Makefile
index 0862e6f47a38..53a848109f7b 100644
--- a/tools/testing/selftests/memfd/Makefile
+++ b/tools/testing/selftests/memfd/Makefile
@@ -4,9 +4,9 @@ CFLAGS += -I../../../../include/uapi/
 CFLAGS += -I../../../../include/
 CFLAGS += -I../../../../usr/include/
 
-TEST_PROGS := run_tests.sh
-TEST_FILES := run_fuse_test.sh
-TEST_GEN_FILES := memfd_test fuse_mnt fuse_test
+TEST_GEN_PROGS := memfd_test
+TEST_PROGS := run_fuse_test.sh run_hugetlbfs_test.sh
+TEST_GEN_FILES := fuse_mnt fuse_test
 
 fuse_mnt.o: CFLAGS += $(shell pkg-config fuse --cflags)
 
diff --git a/tools/testing/selftests/memfd/run_tests.sh b/tools/testing/selftests/memfd/run_hugetlbfs_test.sh
similarity index 95%
rename from tools/testing/selftests/memfd/run_tests.sh
rename to tools/testing/selftests/memfd/run_hugetlbfs_test.sh
index 2013f195e623..fb633eeb0290 100755
--- a/tools/testing/selftests/memfd/run_tests.sh
+++ b/tools/testing/selftests/memfd/run_hugetlbfs_test.sh
@@ -4,12 +4,6 @@
 # Kselftest framework requirement - SKIP code is 4.
 ksft_skip=4
 
-#
-# Normal tests requiring no special resources
-#
-./run_fuse_test.sh
-./memfd_test
-
 #
 # To test memfd_create with hugetlbfs, there needs to be hpages_test
 # huge pages free.  Attempt to allocate enough pages to test.
-- 
2.14.1

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

* Re: [PATCH] selftests: memfd: split regular and hugetlbfs tests
  2018-05-10 20:13 [PATCH] selftests: memfd: split regular and hugetlbfs tests Shuah Khan (Samsung OSG)
@ 2018-05-11 16:43 ` Mike Kravetz
  0 siblings, 0 replies; 2+ messages in thread
From: Mike Kravetz @ 2018-05-11 16:43 UTC (permalink / raw)
  To: Shuah Khan (Samsung OSG), akpm
  Cc: marcandre.lureau, sj38.park, anders.roxell, lizhijian,
	linux-kselftest, linux-kernel

On 05/10/2018 01:13 PM, Shuah Khan (Samsung OSG) wrote:
> Split normal memfd and hugetlbfs tests to improve the test reporting.
> Remove run_fuse_test.sh and memfd_test from run_tests.sh and add them
> to the Makefile.
> 
> Add memfd_test to TEST_GEN_PROGS to be run separately.
> Rename run_tests.sh to run_hugetlbfs_test.sh
> Add run_fuse_test.sh and run_hugetlbfs_test.sh to TEST_PROGS
> 
> The report for non-root run wth this change is:
> 
> TAP version 13
> selftests: memfd: memfd_test
> ========================================
> memfd: CREATE
> memfd: BASIC
> memfd: SEAL-WRITE
> memfd: SEAL-SHRINK
> memfd: SEAL-GROW
> memfd: SEAL-RESIZE
> memfd: SHARE-DUP
> memfd: SHARE-MMAP
> memfd: SHARE-OPEN
> memfd: SHARE-FORK
> memfd: SHARE-DUP (shared file-table)
> memfd: SHARE-MMAP (shared file-table)
> memfd: SHARE-OPEN (shared file-table)
> memfd: SHARE-FORK (shared file-table)
> memfd: DONE
> ok 1..1 selftests: memfd: memfd_test [PASS]
> selftests: memfd: run_fuse_test.sh
> ========================================
> opening: ./mnt/memfd
> fuse: DONE
> ok 1..2 selftests: memfd: run_fuse_test.sh [PASS]
> selftests: memfd: run_hugetlbfs_test.sh
> ========================================
> Please run memfd with hugetlbfs test as root
> not ok 1..3 selftests: memfd: run_hugetlbfs_test.sh [SKIP]
> 
> Signed-off-by: Shuah Khan (Samsung OSG) <shuah@kernel.org>

Thanks for all your efforts in cleaning up selftests!
Changes look fine to me.

Reviewed-by: Mike Kravetz <mike.kravetz@oracle.com>
-- 
Mike Kravetz

> ---
>  tools/testing/selftests/memfd/Makefile                              | 6 +++---
>  .../testing/selftests/memfd/{run_tests.sh => run_hugetlbfs_test.sh} | 6 ------
>  2 files changed, 3 insertions(+), 9 deletions(-)
>  rename tools/testing/selftests/memfd/{run_tests.sh => run_hugetlbfs_test.sh} (95%)
> 
> diff --git a/tools/testing/selftests/memfd/Makefile b/tools/testing/selftests/memfd/Makefile
> index 0862e6f47a38..53a848109f7b 100644
> --- a/tools/testing/selftests/memfd/Makefile
> +++ b/tools/testing/selftests/memfd/Makefile
> @@ -4,9 +4,9 @@ CFLAGS += -I../../../../include/uapi/
>  CFLAGS += -I../../../../include/
>  CFLAGS += -I../../../../usr/include/
>  
> -TEST_PROGS := run_tests.sh
> -TEST_FILES := run_fuse_test.sh
> -TEST_GEN_FILES := memfd_test fuse_mnt fuse_test
> +TEST_GEN_PROGS := memfd_test
> +TEST_PROGS := run_fuse_test.sh run_hugetlbfs_test.sh
> +TEST_GEN_FILES := fuse_mnt fuse_test
>  
>  fuse_mnt.o: CFLAGS += $(shell pkg-config fuse --cflags)
>  
> diff --git a/tools/testing/selftests/memfd/run_tests.sh b/tools/testing/selftests/memfd/run_hugetlbfs_test.sh
> similarity index 95%
> rename from tools/testing/selftests/memfd/run_tests.sh
> rename to tools/testing/selftests/memfd/run_hugetlbfs_test.sh
> index 2013f195e623..fb633eeb0290 100755
> --- a/tools/testing/selftests/memfd/run_tests.sh
> +++ b/tools/testing/selftests/memfd/run_hugetlbfs_test.sh
> @@ -4,12 +4,6 @@
>  # Kselftest framework requirement - SKIP code is 4.
>  ksft_skip=4
>  
> -#
> -# Normal tests requiring no special resources
> -#
> -./run_fuse_test.sh
> -./memfd_test
> -
>  #
>  # To test memfd_create with hugetlbfs, there needs to be hpages_test
>  # huge pages free.  Attempt to allocate enough pages to test.
> 

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

end of thread, other threads:[~2018-05-11 16:44 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2018-05-10 20:13 [PATCH] selftests: memfd: split regular and hugetlbfs tests Shuah Khan (Samsung OSG)
2018-05-11 16:43 ` Mike Kravetz

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).