]> git.ipfire.org Git - thirdparty/systemd.git/commitdiff
TEST-15: use ${:?} and shorten things a bit
authorZbigniew Jędrzejewski-Szmek <zbyszek@in.waw.pl>
Thu, 29 Apr 2021 07:20:39 +0000 (09:20 +0200)
committerZbigniew Jędrzejewski-Szmek <zbyszek@in.waw.pl>
Tue, 4 May 2021 11:36:05 +0000 (13:36 +0200)
test/units/testsuite-15.sh

index 23c2156501d926b0bdbb30e0d634aed2b76667c0..65ac74b793dbc0eb7217cbadca9a368adfd9adbe 100755 (executable)
@@ -32,12 +32,9 @@ create_service () {
 Description=$SERVICE_NAME unit
 
 [Service]
-ExecStart=/bin/sleep 100000
+ExecStart=sleep 100000
 EOF
-    mkdir -p /{etc,run,usr/lib}/systemd/system/"$SERVICE_NAME".service.d
-    mkdir -p /etc/systemd/system/"$SERVICE_NAME".service.{wants,requires}
-    mkdir -p /run/systemd/system/"$SERVICE_NAME".service.{wants,requires}
-    mkdir -p /usr/lib/systemd/system/"$SERVICE_NAME".service.{wants,requires}
+    mkdir -p /{etc,run,usr/lib}/systemd/system/"$SERVICE_NAME".service.{d,wants,requires}
 }
 
 create_services () {
@@ -47,12 +44,10 @@ create_services () {
 }
 
 check_ok () {
-    [ $# -eq 3 ] || return
-
-    x="$(systemctl show --value -p "$2" "$1")"
+    x="$(systemctl show --value -p "${2:?}" "${1:?}")"
     case "$x" in
-        *$3*) return 0 ;;
-        *)    return 1 ;;
+        *${3:?}*) return 0 ;;
+        *)        return 1 ;;
     esac
 }