Check again lists of log files in aslr & service test. 45/210745/2 accepted/tizen/unified/20190726.112611 submit/tizen/20190725.051716
authorjin-gyu.kim <jin-gyu.kim@samsung.com>
Wed, 24 Jul 2019 07:31:37 +0000 (16:31 +0900)
committerjin-gyu.kim <jin-gyu.kim@samsung.com>
Thu, 25 Jul 2019 04:53:13 +0000 (13:53 +0900)
- aslr & service tests are always succeeded from the 2nd trial.
- Re-validate lists of log files for aslr & service test.

Change-Id: I9cc812889992900e95dab569bd3e455121beb880

test/aslr_test/scripts/run_aslr_test_all_files.sh
test/new_service_test/check_new_service.sh

index 74387dbc3d7f9a0d3d9b74062a8f9a80f7b7dc62..e234db673e4b91d241363ba00f6f211973dca717 100644 (file)
@@ -20,16 +20,18 @@ function CHECK_EXCEPTION
        return 0
 }
 
+/usr/bin/echo "Start aslr check test"
+
+/usr/bin/find / -type f -executable 2>/dev/null | /usr/bin/xargs $utl_path/file | /usr/bin/grep "executable" | /usr/bin/grep -v "shared object" | /usr/bin/grep -v "pie" | /usr/bin/grep -v "script" | /usr/bin/cut -d ":" -f1 >> $tmp_file
+
 #init log
 if [ -e "$log_file" ]
 then
+       # Revalidate files in the previous log file. (But, not restoring execute permission)
+       cat $log_file >> $tmp_file
        /usr/bin/rm $log_file
 fi
 
-/usr/bin/echo "Start aslr check test"
-
-/usr/bin/find / -type f -executable 2>/dev/null | /usr/bin/xargs $utl_path/file | /usr/bin/grep "executable" | /usr/bin/grep -v "shared object" | /usr/bin/grep -v "pie" | /usr/bin/grep -v "script" | /usr/bin/cut -d ":" -f1 >> $tmp_file
-
 # Retrieve exec permission (chmod & cat need to be considered separately to finish below lines)
 # Checking "/etc/smack/onlycap" is temporary. This should be considered again later.
 while read line
index 7ae44e6a5a1fead7fb0f0bd5189d52e77e8f450c..2b0429a6210fadc8d35256090b3c20b954bb41ac 100755 (executable)
@@ -31,7 +31,7 @@ function check_systemd_service
        if [ "$result" == "" ]
        then
                echo "Not permitted Systemd Service : $1"
-               echo $service_name >> $log_file
+               echo $1 >> $log_file
                move_service_file $1 $service_name
        fi
 }
@@ -56,7 +56,7 @@ function check_dbus_service
        if [ "$result" == "" ]
        then
                echo "Not permitted DBUS Service : $1"
-               echo $service_name >> $log_file
+               echo $1 >> $log_file
                move_service_file $1 $service_name
        fi
 }
@@ -92,7 +92,7 @@ function find_systemd_service
 function find_dbus_service
 {
        for line in `find "$dbus_service_dir" -type f -name "*service" 2> /dev/null`
-       do              
+       do
                uid="$(cat $line | grep "User=" | grep -v "#" | cut -d "=" -f2 | tr -d '\015')"
                check_dbus_service "$line" "$uid"
        done
@@ -102,6 +102,12 @@ function find_dbus_service
 echo "Run check new service test"
 if [ -e "$log_file" ]
 then
+       # Restore not permitted service
+       for line in `cat $log_file`
+       do
+               service_name=$(echo $line | rev | cut -f1 -d "/" | rev)
+               mv $not_permitted_service_path$service_name $line
+       done
        rm $log_file
 fi
 if [ -e "$result_file" ]