From fbc42f133232fb92140a8039b2d643f6f0b63889 Mon Sep 17 00:00:00 2001 From: Franck Bui Date: Fri, 27 Jan 2017 16:02:22 +0100 Subject: tests: add dropin dependency tests [zj: tests assertions adjusted to the different logic in which masking of a dependency through one name, does not forbid the dependency being added through another name.] --- test/TEST-15-DROPIN/test-dropin.sh | 274 +++++++++++++++++++++++++++++++++++++ 1 file changed, 274 insertions(+) create mode 100755 test/TEST-15-DROPIN/test-dropin.sh (limited to 'test/TEST-15-DROPIN/test-dropin.sh') diff --git a/test/TEST-15-DROPIN/test-dropin.sh b/test/TEST-15-DROPIN/test-dropin.sh new file mode 100755 index 0000000000..9d8af99ac4 --- /dev/null +++ b/test/TEST-15-DROPIN/test-dropin.sh @@ -0,0 +1,274 @@ +#! /bin/bash + +set -e +set -x + +_clear_service () { + systemctl stop $1.service 2>/dev/null || : + rm -f /{etc,run,usr/lib}/systemd/system/$1.service + rm -fr /{etc,run,usr/lib}/systemd/system/$1.service.d + rm -fr /{etc,run,usr/lib}/systemd/system/$1.service.{wants,requires} +} + +clear_services () { + for u in $*; do + _clear_service $u + done + systemctl daemon-reload +} + +create_service () { + clear_services $1 + + cat >/etc/systemd/system/$1.service</usr/lib/systemd/system/a.service.d/wants-b.conf<