[Fuego] [PATCH 10/12] add smackfsdir for smack cases

qiutt <[email protected]>
Newsgroups dev.linux.lists.fuego
Message-ID <[email protected]>
for aarch64(m3ulcb), add "smackfsdir=/sys/fs/smackfs" for cases in smack

Signed-off-by: qiutt <[email protected]>
---
 tests/Functional.LTP/fuego_test.sh                     | 10 ++++++++++
 .../Functional.LTP/ltp_network_smack_set_ambient.patch | 10 ++++++++++
 tests/Functional.LTP/ltp_network_smack_set_cipso.patch | 10 ++++++++++
 .../Functional.LTP/ltp_network_smack_set_direct.patch  | 10 ++++++++++
 tests/Functional.LTP/ltp_network_smack_set_doi.patch   | 10 ++++++++++
 tests/Functional.LTP/ltp_network_smack_set_load.patch  | 10 ++++++++++
 .../ltp_network_smack_set_netlabel.patch               | 10 ++++++++++
 .../Functional.LTP/ltp_network_smack_set_onlycap.patch | 18 ++++++++++++++++++
 8 files changed, 88 insertions(+)
 create mode 100644 tests/Functional.LTP/ltp_network_smack_set_ambient.patch
 create mode 100644 tests/Functional.LTP/ltp_network_smack_set_cipso.patch
 create mode 100644 tests/Functional.LTP/ltp_network_smack_set_direct.patch
 create mode 100644 tests/Functional.LTP/ltp_network_smack_set_doi.patch
 create mode 100644 tests/Functional.LTP/ltp_network_smack_set_load.patch
 create mode 100644 tests/Functional.LTP/ltp_network_smack_set_netlabel.patch
 create mode 100644 tests/Functional.LTP/ltp_network_smack_set_onlycap.patch

diff --git a/tests/Functional.LTP/fuego_test.sh b/tests/Functional.LTP/fuego_test.sh
index 2ac7caf..b097d22 100755
--- a/tests/Functional.LTP/fuego_test.sh
+++ b/tests/Functional.LTP/fuego_test.sh
@@ -364,6 +364,16 @@ function test_build {
     if [[ "$FUNCTIONAL_LTP_PHASES" == *build* ]] ; then
         echo "Building LTP"
         # Build the LTP tests
+            if [ "$ARCHITECTURE" == "aarch64" ]; then
+                patch -p0 < ${TEST_HOME}/ltp_network_smack_set_ambient.patch
+                patch -p0 < ${TEST_HOME}/ltp_network_smack_set_cipso.patch
+                patch -p0 < ${TEST_HOME}/ltp_network_smack_set_direct.patch
+                patch -p0 < ${TEST_HOME}/ltp_network_smack_set_doi.patch
+                patch -p0 < ${TEST_HOME}/ltp_network_smack_set_load.patch
+                patch -p0 < ${TEST_HOME}/ltp_network_smack_set_netlabel.patch
+                patch -p0 < ${TEST_HOME}/ltp_network_smack_set_onlycap.patch
+            fi
+
         make autotools
         ./configure CC="${CC}" AR="${AR}" RANLIB="${RANLIB}" LDFLAGS="$LDFLAGS" SYSROOT="${SDKROOT}" \
             --with-open-posix-testsuite --with-realtime-testsuite --without-perl --without-python --target=$PREFIX --host=$PREFIX \
diff --git a/tests/Functional.LTP/ltp_network_smack_set_ambient.patch b/tests/Functional.LTP/ltp_network_smack_set_ambient.patch
new file mode 100644
index 0000000..a0295a9
--- /dev/null
+++ b/tests/Functional.LTP/ltp_network_smack_set_ambient.patch
@@ -0,0 +1,10 @@
+--- testcases/kernel/security/smack/smack_set_ambient.sh	2020-06-24 13:56:22.109262738 +0800
++++ testcases/kernel/security/smack/smack_set_ambient.sh	2020-06-24 13:58:29.560200819 +0800
+@@ -12,6 +12,7 @@
+ 
+ export TCID=smack_set_ambient
+ export TST_TOTAL=1
++export smackfsdir=/sys/fs/smackfs
+ 
+ . test.sh
+ 
diff --git a/tests/Functional.LTP/ltp_network_smack_set_cipso.patch b/tests/Functional.LTP/ltp_network_smack_set_cipso.patch
new file mode 100644
index 0000000..f1d1e7e
--- /dev/null
+++ b/tests/Functional.LTP/ltp_network_smack_set_cipso.patch
@@ -0,0 +1,10 @@
+--- testcases/kernel/security/smack/smack_set_cipso.sh-bak	2020-06-24 13:56:22.069261816 +0800
++++ testcases/kernel/security/smack/smack_set_cipso.sh	2020-06-24 14:02:10.717299076 +0800
+@@ -16,6 +16,7 @@
+ 
+ export TCID=smack_set_cipso
+ export TST_TOTAL=1
++export smackfsdir=/sys/fs/smackfs
+ 
+ . test.sh
+ 
diff --git a/tests/Functional.LTP/ltp_network_smack_set_direct.patch b/tests/Functional.LTP/ltp_network_smack_set_direct.patch
new file mode 100644
index 0000000..0533e7d
--- /dev/null
+++ b/tests/Functional.LTP/ltp_network_smack_set_direct.patch
@@ -0,0 +1,10 @@
+--- testcases/kernel/security/smack/smack_set_direct.sh-bak	2020-06-24 13:56:22.069261816 +0800
++++ testcases/kernel/security/smack/smack_set_direct.sh	2020-06-24 14:01:42.064638556 +0800
+@@ -12,6 +12,7 @@
+ 
+ export TCID=smack_set_direct
+ export TST_TOTAL=1
++export smackfsdir=/sys/fs/smackfs
+ 
+ . test.sh
+ 
diff --git a/tests/Functional.LTP/ltp_network_smack_set_doi.patch b/tests/Functional.LTP/ltp_network_smack_set_doi.patch
new file mode 100644
index 0000000..e9f77ac
--- /dev/null
+++ b/tests/Functional.LTP/ltp_network_smack_set_doi.patch
@@ -0,0 +1,10 @@
+--- testcases/kernel/security/smack/smack_set_doi.sh-bak	2020-06-24 13:56:22.069261816 +0800
++++ testcases/kernel/security/smack/smack_set_doi.sh	2020-06-24 14:01:25.848264726 +0800
+@@ -12,6 +12,7 @@
+ 
+ export TCID=smack_set_doi
+ export TST_TOTAL=1
++export smackfsdir=/sys/fs/smackfs
+ 
+ . test.sh
+ 
diff --git a/tests/Functional.LTP/ltp_network_smack_set_load.patch b/tests/Functional.LTP/ltp_network_smack_set_load.patch
new file mode 100644
index 0000000..9b34af6
--- /dev/null
+++ b/tests/Functional.LTP/ltp_network_smack_set_load.patch
@@ -0,0 +1,10 @@
+--- testcases/kernel/security/smack/smack_set_load.sh-bak	2020-06-24 13:56:22.069261816 +0800
++++ testcases/kernel/security/smack/smack_set_load.sh	        2020-06-24 14:02:55.374328539 +0800
+@@ -16,6 +16,7 @@
+ 
+ export TCID=smack_set_load
+ export TST_TOTAL=1
++export smackfsdir=/sys/fs/smackfs
+ 
+ . test.sh
+ 
diff --git a/tests/Functional.LTP/ltp_network_smack_set_netlabel.patch b/tests/Functional.LTP/ltp_network_smack_set_netlabel.patch
new file mode 100644
index 0000000..4f485d2
--- /dev/null
+++ b/tests/Functional.LTP/ltp_network_smack_set_netlabel.patch
@@ -0,0 +1,10 @@
+--- testcases/kernel/security/smack/smack_set_netlabel.sh-bak	2020-06-24 13:56:22.069261816 +0800
++++ testcases/kernel/security/smack/smack_set_netlabel.sh	2020-06-24 14:02:25.393637404 +0800
+@@ -12,6 +12,7 @@
+ 
+ export TCID=smack_set_netlabel
+ export TST_TOTAL=1
++export smackfsdir=/sys/fs/smackfs
+ 
+ . test.sh
+ 
diff --git a/tests/Functional.LTP/ltp_network_smack_set_onlycap.patch b/tests/Functional.LTP/ltp_network_smack_set_onlycap.patch
new file mode 100644
index 0000000..150eb6b
--- /dev/null
+++ b/tests/Functional.LTP/ltp_network_smack_set_onlycap.patch
@@ -0,0 +1,18 @@
+--- testcases/kernel/security/smack/smack_set_onlycap.sh-bak	2020-06-24 13:56:22.069261816 +0800
++++ testcases/kernel/security/smack/smack_set_onlycap.sh	2020-06-24 14:44:42.816131711 +0800
+@@ -12,6 +12,7 @@
+ 
+ export TCID=smack_set_onlycap
+ export TST_TOTAL=1
++export smackfsdir=/sys/fs/smackfs
+ 
+ . test.sh
+ 
+@@ -23,6 +24,7 @@
+ echo "$my_label" 2>/dev/null > "$smackfsdir/onlycap"
+ 
+ label=$(cat "$smackfsdir/onlycap" 2>/dev/null)
++label=`echo $label | sed -e 's/$[ \t]*//g'`
+ if [ "$label" != "$my_label" ]; then
+ 	tst_brkm TFAIL "The smack label reported for \"$smackfsdir/onlycap\" "
+ 		       "is \"$label\", not the expected \"$my_label\"."
-- 
2.11.0
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.