#!/bin/sh
echo "[Trigerring all tests...]"
-sleep 5
-security-tests.sh ace --output=text
-sleep 5
-security-tests.sh ace-client --output=text
-sleep 5
-security-tests.sh ace-settings --output=text
-sleep 5
-security-tests.sh ace-install --output=text
-sleep 5
-security-tests.sh security-daemon --output=text
-sleep 5
-security-tests.sh vcore --output=text
-sleep 5
-security-tests.sh capi --output=text
-sleep 5
-security-tests.sh pkcs --output=text
-sleep 5
security-tests.sh smack --output=text
-sleep 5
-security-tests.sh pc --output=text
-sleep 5
+security-tests.sh libprivilege-control --output=text
echo "[Done]"
#####################################################################
#testing internet access and date on the target
-error(){
- echo "[ERROR]" $1
- exit 1
-}
-
-check_network_access(){
- echo "--- Checking for network access..."
- ping -c 2 www.google.com > /dev/null || error 'Network not accessible'
- echo 'Network access OK'
-}
-
-check_date(){
- echo "--- Checkig date..."
- date
- openssl verify -CAfile /opt/apps/widget/tests/vcore_certs/cacert.pem /opt/apps/widget/tests/vcore_certs/respcert.pem 2>/dev/null | grep OK 1>/dev/null || error 'Date not set properly'
- echo 'Date OK'
-}
-
-kill_daemon(){
- echo "--- Killing daemon"
- wrt_security_create_clean_db.sh
- pkill -9 security-ser && sleep 3
- echo "--- Done"
-}
-
echo "### Starting tests ######################################################"
case $1 in
-"capi")
- echo "========================================================================="
- echo "CAPI"
- echo
- #check network and date
- check_network_access
- check_date
- #test binary execution
- cert-svc-tests-capi $2 $3
- ;;
-
-"pkcs")
- echo "========================================================================="
- echo "PKCS12"
- echo
- #test binary execution
- cert-svc-tests-pkcs12 $2 $3
- ;;
-
-"vcore")
- echo "========================================================================="
- echo "VCORE"
- echo
- #check network and date
- check_network_access
- check_date
- #environment setup
- cert-svc-tests-vcore-ocsp-server.sh &
- #test binary execution
- cert-svc-tests-vcore $2 $3
- ;;
-
"smack")
echo "========================================================================="
echo "SMACK"
echo
- #test binary execution
libsmack-test $2 $3
;;
-"pc")
+"libprivilege-control")
echo "========================================================================="
- echo "PRIVILEGE CONTROL"
+ echo "SMACK"
echo
- #test binary execution
libprivilege-control-test $2 $3
;;
-"ace")
- echo "========================================================================="
- echo "ACE"
- echo
- #environment setup
- cp /usr/etc/ace/WAC2.0Policy.xml /usr/etc/ace/WAC2.0Policy.xml.bk
- cp /usr/etc/ace/TizenPolicy.xml /usr/etc/ace/TizenPolicy.xml.bk
- cp /usr/etc/ace/WAC2.0Policy-test.xml /usr/etc/ace/WAC2.0Policy.xml
- cp /usr/etc/ace/TizenPolicy-test.xml /usr/etc/ace/TizenPolicy.xml
- kill_daemon
- #test binary execution
- wrt-tests-ace $2 $3
- ;;
-
-"ace-client")
- echo "========================================================================="
- echo "ACE-CLIENT"
- echo
- #environment setup
- cp /usr/etc/ace/WAC2.0Policy.xml.bk /usr/etc/ace/WAC2.0Policy.xml
- cp /usr/etc/ace/TizenPolicy.xml.bk /usr/etc/ace/TizenPolicy.xml
- kill_daemon
- #test binary execution
- wrt-tests-ace-client $2 $3
- ;;
-
-"ace-settings")
- echo "========================================================================="
- echo "ACE-SETTINGS"
- echo
- #environment setup
- kill_daemon
- #test binary execution
- wrt-tests-ace-settings $2 $3
- ;;
-
-"ace-install")
- echo "========================================================================="
- echo "ACE-INSTALL"
- echo
- #environment setup
- kill_daemon
- cp /usr/etc/ace/WAC2.0Policy.xml /usr/etc/ace/WAC2.0Policy.xml.bk
- cp /usr/etc/ace/ace-install-api-demo-policy.xml /usr/etc/ace/WAC2.0Policy.xml
- wrt_security_change_policy.sh
- #test binary execution
- wrt-tests-ace-install $2 $3
- ;;
-
-"security-daemon")
- echo "========================================================================="
- echo "SECURITY-DAEMON"
- echo
- #environment setup
- cp /usr/etc/ace/WAC2.0Policy.xml.bk /usr/etc/ace/WAC2.0Policy.xml
- kill_daemon
- cp /usr/etc/ace/WAC2.0Policy.xml /usr/etc/ace/WAC2.0Policy.xml.bk
- cp /usr/etc/ace/ipc-tests-demo.xml /usr/etc/ace/WAC2.0Policy.xml
- wrt_security_change_policy.sh
- #test binary execution
- wrt-tests-security-daemon $2 $3
- ;;
-
*)
echo "Correct using:"
echo " security_test.sh <module> <args_for_module>"
echo
- echo "modules: ace, ace-client, ace-settings, ace-install,"
- echo " security-daemon, vcore, capi, pkcs, smack"
+ echo "modules: smack, libprivilege-control"
;;
esac
-#clean up
-pkill -9 wrt-secur # security daemon needs to be killed, as database connections need to be changed (SQLite files are changed!)
-
echo "### Tests done ##########################################################"