6 while getopts "o:d:" opts
9 d) echo "Output directory: $OPTARG"
10 TEST_RESULT_DIR="$OPTARG" ;;
11 o) echo "Output type: $OPTARG"
12 TEST_TYPE="$OPTARG" ;;
13 [?])echo "Usage $0 [-o output_type] [-d output_directory]"
18 result=`rpm -qa | grep wrt-extra`
19 if [ -z "$result" ]; then
20 echo "You must install wrt-extra before run this script";
24 export DPL_USE_OLD_STYLE_LOGS=0
25 export DPL_TEST_OUTPUT="$TEST_TYPE"
28 if [ -e /usr/etc/ace/WAC2.0Policy.back ]; then
29 echo "Policy backup already exists";
31 mv /usr/etc/ace/WAC2.0Policy.xml /usr/etc/ace/WAC2.0Policy.back
34 echo "Set up policy file"
35 cp /usr/etc/ace/GeolocationPolicyTest1 /usr/etc/ace/WAC2.0Policy.xml
37 echo "Reset policy settings in daemon"
38 wrt_security_change_policy.sh
40 function move_result(){
42 echo "Function move_resutl. Source: $source"
43 if [ "x$TEST_RESULT_DIR" = "x" ]; then
47 if [ "x$TEST_TYPE" != "x" ]; then
48 echo "Move: mv results.xml $TEST_RESULT_DIR/$1.$TEST_TYPE"
49 mv results.xml "$TEST_RESULT_DIR/$1.$TEST_TYPE"
53 function run_widget(){
54 uid=`echo $1 | awk -F ": " '{print $2}'`
55 if echo $uid | egrep -q '^[0-9]+$'; then
56 echo "Second widget id: $uid"
57 DPL_TEST_OUTPUT=text wrt-client -l $uid
61 move_result "geolocation_$1"
64 echo "Widget installation"
65 result1=`wrt-installer -if /opt/apps/widget/tests/geolocation/geolocationSecurityTest1.wgt`
66 result2=`wrt-installer -if /opt/apps/widget/tests/geolocation/geolocationSecurityTest2.wgt`
70 echo "Set up policy file"
71 cp /usr/etc/ace/GeolocationPolicyTest2 /usr/etc/WAC2.0Policy.xml
72 echo "Reset policy setting in daemon."
73 wrt_security_change_policy.sh
77 echo "Restore original policy"
78 cp /usr/etc/ace/WAC2.0Policy.back /usr/etc/ace/WAC2.0Policy.xml
79 echo "Reset policy settings in daemon"
80 wrt_security_change_policy.sh