3 #####################################################################
4 # Copyright (c) 2012 Samsung Electronics Co., Ltd All Rights Reserved
6 # Licensed under the Apache License, Version 2.0 (the "License");
7 # you may not use this file except in compliance with the License.
8 # You may obtain a copy of the License at
10 # http://www.apache.org/licenses/LICENSE-2.0
12 # Unless required by applicable law or agreed to in writing, software
13 # distributed under the License is distributed on an "AS IS" BASIS,
14 # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
15 # See the License for the specific language governing permissions and
16 # limitations under the License.
17 #####################################################################
19 #testing internet access and date on the target
25 check_network_access(){
26 echo "--- Checking for network access..."
27 ping -c 2 www.google.com > /dev/null || error 'Network not accessible'
28 echo 'Network access OK'
32 echo "--- Checkig date..."
34 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'
39 echo "--- Killing daemon"
40 wrt_security_create_clean_db.sh
41 pkill -9 security-ser && sleep 3
46 echo "### Starting tests ######################################################"
51 echo "========================================================================="
54 #check network and date
57 #test binary execution
58 cert-svc-tests-capi $2 $3
62 echo "========================================================================="
65 #test binary execution
66 cert-svc-tests-pkcs12 $2 $3
70 echo "========================================================================="
73 #check network and date
77 cert-svc-tests-vcore-ocsp-server.sh &
78 #test binary execution
79 cert-svc-tests-vcore $2 $3
83 echo "========================================================================="
86 #test binary execution
91 echo "========================================================================="
92 echo "PRIVILEGE CONTROL"
94 #test binary execution
95 libprivilege-control-test $2 $3
99 echo "========================================================================="
103 cp /usr/etc/ace/WAC2.0Policy.xml /usr/etc/ace/WAC2.0Policy.xml.bk
104 cp /usr/etc/ace/TizenPolicy.xml /usr/etc/ace/TizenPolicy.xml.bk
105 cp /usr/etc/ace/WAC2.0Policy-test.xml /usr/etc/ace/WAC2.0Policy.xml
106 cp /usr/etc/ace/TizenPolicy-test.xml /usr/etc/ace/TizenPolicy.xml
108 #test binary execution
113 echo "========================================================================="
117 cp /usr/etc/ace/WAC2.0Policy.xml.bk /usr/etc/ace/WAC2.0Policy.xml
118 cp /usr/etc/ace/TizenPolicy.xml.bk /usr/etc/ace/TizenPolicy.xml
120 #test binary execution
121 wrt-tests-ace-client $2 $3
125 echo "========================================================================="
130 #test binary execution
131 wrt-tests-ace-settings $2 $3
135 echo "========================================================================="
140 cp /usr/etc/ace/WAC2.0Policy.xml /usr/etc/ace/WAC2.0Policy.xml.bk
141 cp /usr/etc/ace/ace-install-api-demo-policy.xml /usr/etc/ace/WAC2.0Policy.xml
142 wrt_security_change_policy.sh
143 #test binary execution
144 wrt-tests-ace-install $2 $3
148 echo "========================================================================="
149 echo "SECURITY-DAEMON"
152 cp /usr/etc/ace/WAC2.0Policy.xml.bk /usr/etc/ace/WAC2.0Policy.xml
154 cp /usr/etc/ace/WAC2.0Policy.xml /usr/etc/ace/WAC2.0Policy.xml.bk
155 cp /usr/etc/ace/ipc-tests-demo.xml /usr/etc/ace/WAC2.0Policy.xml
156 wrt_security_change_policy.sh
157 #test binary execution
158 wrt-tests-security-daemon $2 $3
162 echo "Correct using:"
163 echo " security_test.sh <module> <args_for_module>"
165 echo "modules: ace, ace-client, ace-settings, ace-install,"
166 echo " security-daemon, vcore, capi, pkcs, smack"
172 pkill -9 wrt-secur # security daemon needs to be killed, as database connections need to be changed (SQLite files are changed!)
174 echo "### Tests done ##########################################################"