From: Zbigniew Jędrzejewski-Szmek Date: Thu, 29 Apr 2021 07:20:39 +0000 (+0200) Subject: TEST-15: use ${:?} and shorten things a bit X-Git-Tag: v249-rc1~301^2~5 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=5169595ec38fb07372c350e66f60da9d50be157b;p=thirdparty%2Fsystemd.git TEST-15: use ${:?} and shorten things a bit --- diff --git a/test/units/testsuite-15.sh b/test/units/testsuite-15.sh index 23c2156501d..65ac74b793d 100755 --- a/test/units/testsuite-15.sh +++ b/test/units/testsuite-15.sh @@ -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 }