Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > linux.kernel > #1216149 > unrolled thread

[PATCH 1/2] selftests/zram: must be run as root

Started bynaresh.kamboju@linaro.org
First post2015-08-31 13:50 +0200
Last post2015-09-01 19:00 +0200
Articles 5 — 3 participants

Back to article view | Back to linux.kernel


Contents

  [PATCH 1/2] selftests/zram:  must be run as root naresh.kamboju@linaro.org - 2015-08-31 13:50 +0200
    [PATCH 2/2] selftests/zram: Makefile fix naresh.kamboju@linaro.org - 2015-08-31 13:50 +0200
      Re: [PATCH 2/2] selftests/zram: Makefile fix Michael Ellerman <mpe@ellerman.id.au> - 2015-09-01 03:00 +0200
        Re: [PATCH 2/2] selftests/zram: Makefile fix Shuah Khan <shuahkh@osg.samsung.com> - 2015-09-01 19:00 +0200
    Re: [PATCH 1/2] selftests/zram: must be run as root Shuah Khan <shuahkh@osg.samsung.com> - 2015-09-01 19:00 +0200

#1216149 — [PATCH 1/2] selftests/zram: must be run as root

Fromnaresh.kamboju@linaro.org
Date2015-08-31 13:50 +0200
Subject[PATCH 1/2] selftests/zram: must be run as root
Message-ID<q3vL3-6Ct-1@gated-at.bofh.it>
From: Naresh Kamboju <naresh.kamboju@linaro.org>

Adding new functionality check_prereqs() to check test must be run as root

Signed-off-by: Naresh Kamboju <naresh.kamboju@linaro.org>
---
 tools/testing/selftests/zram/zram.sh     | 12 ++++++++++++
 tools/testing/selftests/zram/zram01.sh   |  1 +
 tools/testing/selftests/zram/zram02.sh   |  1 +
 tools/testing/selftests/zram/zram_lib.sh | 10 ++++++++++
 4 files changed, 24 insertions(+)

diff --git a/tools/testing/selftests/zram/zram.sh b/tools/testing/selftests/zram/zram.sh
index 6ea4b6a..20de9a7 100755
--- a/tools/testing/selftests/zram/zram.sh
+++ b/tools/testing/selftests/zram/zram.sh
@@ -1,6 +1,16 @@
 #!/bin/bash
 TCID="zram.sh"
 
+check_prereqs()
+{
+	local msg="skip all tests:"
+
+	if [ $UID != 0 ]; then
+		echo $msg must be run as root >&2
+		exit 0
+	fi
+}
+
 run_zram () {
 echo "--------------------"
 echo "running zram tests"
@@ -10,6 +20,8 @@ echo ""
 ./zram02.sh
 }
 
+check_prereqs
+
 # check zram module exists
 MODULE_PATH=/lib/modules/`uname -r`/kernel/drivers/block/zram/zram.ko
 if [ -f $MODULE_PATH ]; then
diff --git a/tools/testing/selftests/zram/zram01.sh b/tools/testing/selftests/zram/zram01.sh
index 2a2475d..b9566a6 100755
--- a/tools/testing/selftests/zram/zram01.sh
+++ b/tools/testing/selftests/zram/zram01.sh
@@ -79,6 +79,7 @@ zram_fill_fs()
 	echo "zram compression ratio: $(echo "scale=2; $v / 100 " | bc):1: OK"
 }
 
+check_prereqs
 zram_load
 zram_max_streams
 zram_compress_alg
diff --git a/tools/testing/selftests/zram/zram02.sh b/tools/testing/selftests/zram/zram02.sh
index 96e82dc..74569b8 100755
--- a/tools/testing/selftests/zram/zram02.sh
+++ b/tools/testing/selftests/zram/zram02.sh
@@ -37,6 +37,7 @@ zram_max_streams="2"
 zram_sizes="1048576" # 1M
 zram_mem_limits="1M"
 
+check_prereqs
 zram_load
 zram_max_streams
 zram_set_disksizes
diff --git a/tools/testing/selftests/zram/zram_lib.sh b/tools/testing/selftests/zram/zram_lib.sh
index 3b6abf1..424e68e 100755
--- a/tools/testing/selftests/zram/zram_lib.sh
+++ b/tools/testing/selftests/zram/zram_lib.sh
@@ -20,6 +20,16 @@ dev_mounted=-1
 
 trap INT
 
+check_prereqs()
+{
+	local msg="skip all tests:"
+
+	if [ $UID != 0 ]; then
+		echo $msg must be run as root >&2
+		exit 0
+	fi
+}
+
 zram_cleanup()
 {
 	echo "zram cleanup"
-- 
1.9.1

--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/

[toc] | [next] | [standalone]


#1216151 — [PATCH 2/2] selftests/zram: Makefile fix

Fromnaresh.kamboju@linaro.org
Date2015-08-31 13:50 +0200
Subject[PATCH 2/2] selftests/zram: Makefile fix
Message-ID<q3vL4-6Ct-15@gated-at.bofh.it>
In reply to#1216149
From: Naresh Kamboju <naresh.kamboju@linaro.org>

Do not override run_tests, The default rule will just run TEST_PROGS

Signed-off-by: Naresh Kamboju <naresh.kamboju@linaro.org>
---
 tools/testing/selftests/zram/Makefile | 3 ---
 1 file changed, 3 deletions(-)

diff --git a/tools/testing/selftests/zram/Makefile b/tools/testing/selftests/zram/Makefile
index ec45513..29d8034 100644
--- a/tools/testing/selftests/zram/Makefile
+++ b/tools/testing/selftests/zram/Makefile
@@ -5,8 +5,5 @@ TEST_FILES := zram01.sh zram02.sh zram_lib.sh
 
 include ../lib.mk
 
-run_tests:
-	@/bin/bash ./zram.sh
-
 clean:
 	$(RM) err.log
-- 
1.9.1

--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/

[toc] | [prev] | [next] | [standalone]


#1216539 — Re: [PATCH 2/2] selftests/zram: Makefile fix

FromMichael Ellerman <mpe@ellerman.id.au>
Date2015-09-01 03:00 +0200
SubjectRe: [PATCH 2/2] selftests/zram: Makefile fix
Message-ID<q3I5A-7zX-7@gated-at.bofh.it>
In reply to#1216151
On Mon, 2015-08-31 at 17:11 +0530, naresh.kamboju@linaro.org wrote:
> From: Naresh Kamboju <naresh.kamboju@linaro.org>
> 
> Do not override run_tests, The default rule will just run TEST_PROGS
> 
> Signed-off-by: Naresh Kamboju <naresh.kamboju@linaro.org>

Thanks.

Acked-by: Michael Ellerman <mpe@ellerman.id.au>

cheers


--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/

[toc] | [prev] | [next] | [standalone]


#1216969 — Re: [PATCH 2/2] selftests/zram: Makefile fix

FromShuah Khan <shuahkh@osg.samsung.com>
Date2015-09-01 19:00 +0200
SubjectRe: [PATCH 2/2] selftests/zram: Makefile fix
Message-ID<q3X4D-3Wm-25@gated-at.bofh.it>
In reply to#1216539
On 08/31/2015 06:58 PM, Michael Ellerman wrote:
> On Mon, 2015-08-31 at 17:11 +0530, naresh.kamboju@linaro.org wrote:
>> From: Naresh Kamboju <naresh.kamboju@linaro.org>
>>
>> Do not override run_tests, The default rule will just run TEST_PROGS
>>
>> Signed-off-by: Naresh Kamboju <naresh.kamboju@linaro.org>
> 
> Thanks.
> 
> Acked-by: Michael Ellerman <mpe@ellerman.id.au>
> 

Thank you both. Applied to linux-kselftest next for 4.3-rc1

-- Shuah


-- 
Shuah Khan
Sr. Linux Kernel Developer
Open Source Innovation Group
Samsung Research America (Silicon Valley)
shuahkh@osg.samsung.com | (970) 217-8978
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/

[toc] | [prev] | [next] | [standalone]


#1216965 — Re: [PATCH 1/2] selftests/zram: must be run as root

FromShuah Khan <shuahkh@osg.samsung.com>
Date2015-09-01 19:00 +0200
SubjectRe: [PATCH 1/2] selftests/zram: must be run as root
Message-ID<q3X4C-3Wm-7@gated-at.bofh.it>
In reply to#1216149
On 08/31/2015 05:41 AM, naresh.kamboju@linaro.org wrote:
> From: Naresh Kamboju <naresh.kamboju@linaro.org>
> 
> Adding new functionality check_prereqs() to check test must be run as root
> 
> Signed-off-by: Naresh Kamboju <naresh.kamboju@linaro.org>
> ---

Thanks. Applied to linux-kselftest next for 4.3-rc1

-- Shuah

-- 
Shuah Khan
Sr. Linux Kernel Developer
Open Source Innovation Group
Samsung Research America (Silicon Valley)
shuahkh@osg.samsung.com | (970) 217-8978
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/

[toc] | [prev] | [standalone]


Back to top | Article view | linux.kernel


csiph-web