From 80ff1dddde31d65f6d33333ad748fa694ead7e3c Mon Sep 17 00:00:00 2001 From: Saurabh Tandan Date: Mon, 22 Aug 2016 18:12:21 -0700 Subject: [PATCH] LU-8524 tests: Awk command re-structured to pass correct value Variable "selinux_policy" was having incorrect value passed to it due to inappropriate structuring of couple of commands. Both those commands have been restructured in order to have the correct value passed to the variable "selinux_policy". Test was run with this modified piece of code successfully, and the result for it can be found in comments section of the ticket. Test-Parameters: trivial testlist=sanity-selinux,sanity-selinux,sanity-selinux Signed-off-by: Saurabh Tandan Change-Id: I3c6c86d607edeadd03ab694435fb201c08c23654 Reviewed-on: http://review.whamcloud.com/22070 Tested-by: Jenkins Tested-by: Maloo Reviewed-by: James Nunez Reviewed-by: Wei Liu Reviewed-by: Oleg Drokin --- lustre/tests/sanity-selinux.sh | 9 +++------ 1 file changed, 3 insertions(+), 6 deletions(-) mode change 100644 => 100755 lustre/tests/sanity-selinux.sh diff --git a/lustre/tests/sanity-selinux.sh b/lustre/tests/sanity-selinux.sh old mode 100644 new mode 100755 index d86c11c..b1fb79b --- a/lustre/tests/sanity-selinux.sh +++ b/lustre/tests/sanity-selinux.sh @@ -29,7 +29,7 @@ require_dsh_mds || exit 0 error "RUNAS_ID set to 0, but UID is also 0!" # -# global variables of this sanity +# global variables of this sanity # check_selinux() { @@ -40,13 +40,10 @@ check_selinux() { "but it must be enforced to run sanity-selinux" && exit 0 fi local selinux_policy=$(sestatus | - awk -F':' '$1 == "Loaded policy name" {print $2}' | - xargs) + awk -F':' '$1 == "Loaded policy name" {print $2}' | xargs) if [ -z "$selinux_policy" ]; then selinux_policy=$(sestatus | - awk -F':' '$1 == "Policy from config file" - {print $2}' | - xargs) + awk -F':' '$1 == "Policy from config file" {print $2}' | xargs) fi [ "$selinux_policy" == "targeted" ] || error "Accepting only targeted policy" -- 1.8.3.1