* [ndctl PATCH] test/security.sh: test keyctl before excuting
@ 2023-11-17 8:39 Li Zhijian
2023-11-17 15:51 ` Dave Jiang
2023-12-07 22:20 ` Dan Williams
0 siblings, 2 replies; 3+ messages in thread
From: Li Zhijian @ 2023-11-17 8:39 UTC (permalink / raw)
To: linux-cxl; +Cc: Li Zhijian
test keyctl command before executing
Signed-off-by: Li Zhijian <lizhijian@fujitsu.com>
---
test/security.sh | 3 ++-
1 file changed, 2 insertions(+), 1 deletion(-)
diff --git a/test/security.sh b/test/security.sh
index 4713288..f954aec 100755
--- a/test/security.sh
+++ b/test/security.sh
@@ -219,6 +219,8 @@ else
do_skip "Missing input parameters"
fi
+check_prereq "keyctl"
+
uid="$(keyctl show | grep -Eo "_uid.[0-9]+" | head -1 | cut -d. -f2-)"
if [ "$uid" -ne 0 ]; then
do_skip "run as root or with a sudo login shell for test to work"
@@ -227,7 +229,6 @@ fi
modprobe "$KMOD_TEST"
$CXL list
setup
-check_prereq "keyctl"
rc=1
detect
test_cleanup
--
2.41.0
^ permalink raw reply related [flat|nested] 3+ messages in thread
* Re: [ndctl PATCH] test/security.sh: test keyctl before excuting
2023-11-17 8:39 [ndctl PATCH] test/security.sh: test keyctl before excuting Li Zhijian
@ 2023-11-17 15:51 ` Dave Jiang
2023-12-07 22:20 ` Dan Williams
1 sibling, 0 replies; 3+ messages in thread
From: Dave Jiang @ 2023-11-17 15:51 UTC (permalink / raw)
To: Li Zhijian, linux-cxl, Vishal Verma
On 11/17/23 01:39, Li Zhijian wrote:
> test keyctl command before executing
>
> Signed-off-by: Li Zhijian <lizhijian@fujitsu.com>
Reviewed-by: Dave Jiang <dave.jiang@intel.com>
> ---
> test/security.sh | 3 ++-
> 1 file changed, 2 insertions(+), 1 deletion(-)
>
> diff --git a/test/security.sh b/test/security.sh
> index 4713288..f954aec 100755
> --- a/test/security.sh
> +++ b/test/security.sh
> @@ -219,6 +219,8 @@ else
> do_skip "Missing input parameters"
> fi
>
> +check_prereq "keyctl"
> +
> uid="$(keyctl show | grep -Eo "_uid.[0-9]+" | head -1 | cut -d. -f2-)"
> if [ "$uid" -ne 0 ]; then
> do_skip "run as root or with a sudo login shell for test to work"
> @@ -227,7 +229,6 @@ fi
> modprobe "$KMOD_TEST"
> $CXL list
> setup
> -check_prereq "keyctl"
> rc=1
> detect
> test_cleanup
^ permalink raw reply [flat|nested] 3+ messages in thread
* RE: [ndctl PATCH] test/security.sh: test keyctl before excuting
2023-11-17 8:39 [ndctl PATCH] test/security.sh: test keyctl before excuting Li Zhijian
2023-11-17 15:51 ` Dave Jiang
@ 2023-12-07 22:20 ` Dan Williams
1 sibling, 0 replies; 3+ messages in thread
From: Dan Williams @ 2023-12-07 22:20 UTC (permalink / raw)
To: Li Zhijian, linux-cxl; +Cc: Li Zhijian
Li Zhijian wrote:
> test keyctl command before executing
The "why" is missing here. Yes, someone can read the patch and go read
the code to see that this is probably a good idea. But what is the
effect of not doing this? Doesn't the existing "trap" result in the same
skipping of the test?
^ permalink raw reply [flat|nested] 3+ messages in thread
end of thread, other threads:[~2023-12-07 22:20 UTC | newest]
Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2023-11-17 8:39 [ndctl PATCH] test/security.sh: test keyctl before excuting Li Zhijian
2023-11-17 15:51 ` Dave Jiang
2023-12-07 22:20 ` Dan Williams
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox