From: Saurabh Tandan Date: Tue, 23 Aug 2016 01:12:21 +0000 (-0700) Subject: LU-8524 tests: Awk command re-structured to pass correct value X-Git-Tag: 2.8.58~16 X-Git-Url: https://git.whamcloud.com/?a=commitdiff_plain;h=refs%2Fchanges%2F70%2F22070%2F3;p=fs%2Flustre-release.git 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 --- 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"