Launch all apps when running SMACK rule test. 41/244941/1 submit/tizen/20200928.074137
authorjin-gyu.kim <jin-gyu.kim@samsung.com>
Mon, 28 Sep 2020 07:15:03 +0000 (16:15 +0900)
committerjin-gyu.kim <jin-gyu.kim@samsung.com>
Mon, 28 Sep 2020 07:15:08 +0000 (16:15 +0900)
- Some SMACK rules are dynamically added while launching apps.
- To compare all SMACK rules, launching all apps before running security test.

Change-Id: I562d2bafaab0ea2dffdeaecfc41f85bfb8e04e09

test/smack_rule_test/checksmackrule.sh

index 56f899a0d577103f86f22fe85ca0ebf8eaedb3df..bf5c1df649875009c857d0714dec7e33d74c4814 100755 (executable)
@@ -19,6 +19,9 @@ then
        rm $log_file
 fi
 
+# Run all apps to load all SMACK rules
+sqlite3 /opt/dbspace/.security-manager.db "select name from app" | xargs -i sh -c 'app_launcher -s {} | true'
+
 # Copy original SMACK rules
 cat /sys/fs/smackfs/load2 | sort > $tmp_current_rule
 
@@ -36,6 +39,10 @@ fi
 smackctl apply
 security-manager-rules-loader
 
+# Re-run all apps
+sqlite3 /opt/dbspace/.security-manager.db "select name from app" | xargs -i sh -c 'app_launcher -k {} | true'
+sqlite3 /opt/dbspace/.security-manager.db "select name from app" | xargs -i sh -c 'app_launcher -s {} | true'
+
 # Copy calculated SMACK rules
 cat /sys/fs/smackfs/load2 | sort > $tmp_calculated_rule