Skip checking dbus service which has 'SystemdService' option. 14/210114/1 submit/tizen/20190716.062812
authorjin-gyu.kim <jin-gyu.kim@samsung.com>
Tue, 16 Jul 2019 02:34:24 +0000 (11:34 +0900)
committerjin-gyu.kim <jin-gyu.kim@samsung.com>
Tue, 16 Jul 2019 02:34:27 +0000 (11:34 +0900)
- Enable checking dbus service again.
- If it has 'SystemdService' option, will be launched by systemd service.
- No need to check 'User' and 'Group' option in this case.

Change-Id: I6be8eaae4f17ef69a5dfaaf810fd6054d8a945a1

test/new_service_test/check_new_service.sh

index 83ea36cc8fb695e333d51eabe26b6427319bb39d..103d360e517b0da3a754700c1a8e58ffc3fb1057 100644 (file)
@@ -7,6 +7,8 @@ log_file="/opt/share/security-config/log/new_service.log"
 dbus_service_list="/usr/share/security-config/test/new_service_test/dbus_service.list"
 systemd_service_list="/usr/share/security-config/test/new_service_test/systemd_service.list"
 not_permitted_service_path="/opt/share/security-config/not_permitted_service/"
+systemd_service_dir="/usr/lib/systemd/system"
+dbus_service_dir="/usr/share/dbus-1/system-services"
 
 # function to check whether it is included in list files
 # args : $1 - service file, $2 - uid, $3 - gid, $4 - smacklabel, $5 - service list
@@ -49,6 +51,11 @@ function find_service
 {
        for line in `find "$1" -type f -name "*service" 2> /dev/null`
        do
+               # skip dbus service which has SystemdService option.
+               if [ "$1" = "$dbus_service_dir" ] && [ "$(cat $line | grep 'SystemdService=')" != "" ]
+               then
+                       continue
+               fi
                uid=";$(cat $line | grep "User=" | grep -v "#" | cut -d "=" -f2 | tr -d '\015')"
                gid=";$(cat $line | grep "Group=" | grep -v "#" | cut -d "=" -f2 | tr -d '\015')"
                smacklabel=";$(cat $line | grep "SmackProcessLabel=" | grep -v "#" | cut -d "=" -f2 | tr -d '\015');"
@@ -69,8 +76,8 @@ then
 fi
 
 # Run Test
-find_service "/usr/lib/systemd/system" "$systemd_service_list"
-#find_service "/usr/share/dbus-1/system-services" "$dbus_service_list"
+find_service "$systemd_service_dir" "$systemd_service_list"
+find_service "$dbus_service_dir" "$dbus_service_list"
 
 if [ ! -e $log_file ]
 then