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 "========================================================================="
95 cp /usr/etc/ace/WAC2.0Policy.xml /usr/etc/ace/WAC2.0Policy.xml.bk
96 cp /usr/etc/ace/TizenPolicy.xml /usr/etc/ace/TizenPolicy.xml.bk
97 cp /usr/etc/ace/WAC2.0Policy-test.xml /usr/etc/ace/WAC2.0Policy.xml
98 cp /usr/etc/ace/TizenPolicy-test.xml /usr/etc/ace/TizenPolicy.xml
100 #test binary execution
105 echo "========================================================================="
109 cp /usr/etc/ace/WAC2.0Policy.xml.bk /usr/etc/ace/WAC2.0Policy.xml
110 cp /usr/etc/ace/TizenPolicy.xml.bk /usr/etc/ace/TizenPolicy.xml
112 #test binary execution
113 wrt-tests-ace-client $2 $3
117 echo "========================================================================="
122 #test binary execution
123 wrt-tests-ace-settings $2 $3
127 echo "========================================================================="
132 cp /usr/etc/ace/WAC2.0Policy.xml /usr/etc/ace/WAC2.0Policy.xml.bk
133 cp /usr/etc/ace/ace-install-api-demo-policy.xml /usr/etc/ace/WAC2.0Policy.xml
134 wrt_security_change_policy.sh
135 #test binary execution
136 wrt-tests-ace-install $2 $3
140 echo "========================================================================="
141 echo "SECURITY-DAEMON"
144 cp /usr/etc/ace/WAC2.0Policy.xml.bk /usr/etc/ace/WAC2.0Policy.xml
146 cp /usr/etc/ace/WAC2.0Policy.xml /usr/etc/ace/WAC2.0Policy.xml.bk
147 cp /usr/etc/ace/ipc-tests-demo.xml /usr/etc/ace/WAC2.0Policy.xml
148 wrt_security_change_policy.sh
149 #test binary execution
150 wrt-tests-security-daemon $2 $3
154 echo "Correct using:"
155 echo " security_test.sh <module> <args_for_module>"
157 echo "modules: ace, ace-client, ace-settings, ace-install,"
158 echo " security-daemon, vcore, capi, pkcs, smack"
164 pkill -9 wrt-secur # security daemon needs to be killed, as database connections need to be changed (SQLite files are changed!)
166 echo "### Tests done ##########################################################"