Test binaries added to middleware list
authorKrzysztof Jackiewicz <k.jackiewicz@samsung.com>
Fri, 29 Mar 2013 10:31:59 +0000 (11:31 +0100)
committerMarcin Niesluchowski <m.niesluchow@samsung.com>
Thu, 23 Jan 2014 13:19:15 +0000 (14:19 +0100)
[Issue#] N/A
[Feature/Bug] N/A
[Problem] security-server tests binaries are not present in allowed middleware
list. Because of that tests fail on rsa image.
[Cause] N/A
[Solution] Test binaries are added in postinstall

[Verification] Build and install test package on rsa image. Check
/usr/share/security-server/mw-list. Test binaries should be added to the list.
Install package again. There should be no duplicates. Run tests for
client-smack, label and server. Results should be identical to those from slp
image.

Change-Id: Idc66e54ffbe3a430ceff6602856863c1e27148eb

packaging/security-tests.spec

index fb9024c48186b561a7e2c4f3933e942dccca58e8..a739db448e8c0090c67e710b09c8f8bf82714d14 100644 (file)
@@ -40,6 +40,15 @@ rm -rf %{buildroot}
 
 %post
 find /etc/smack/test_privilege_control_DIR/ -type f -name exec -exec chmod 0755 {} +
+# add test binaries to mw-list if it's not already there
+BINARIES[0]="/usr/bin/security-server-tests-client-smack"
+BINARIES[1]="/usr/bin/security-server-tests-label"
+BINARIES[2]="/usr/bin/security-server-tests-server"
+for BINARY in "${BINARIES[@]}"
+do
+    grep -q $BINARY /usr/share/security-server/mw-list\
+     || echo $BINARY >> /usr/share/security-server/mw-list
+done
 echo "security-tests postinst done ..."
 
 %postun