From f011c234e9528fc24a6b9d02469a42d37587b89a Mon Sep 17 00:00:00 2001
From: Michael Prokop <mika@debian.org>
Date: Mon, 4 Jul 2016 16:43:28 +0200
Subject: [PATCH 8/9] jessie-backport: debian/tests/logind: ensure correct
 version of logind is running

systemd-logind can't be restarted during upgrades,
see git commit b8c239e12 and
https://github.com/systemd/systemd/issues/1163

But if we don't upgrade logind during our tests
we might end up with calling unsupported methods,
e.g. failing as follows during an autopkgtest
test run within a jessie environment with the
systemd backport:

| Error: org.freedesktop.DBus.Error.UnknownMethod
| Unknown method 'ScheduledShutdown' or interface 'org.freedesktop.login1.Manager'.
---
 debian/tests/logind | 4 ++++
 1 file changed, 4 insertions(+)

diff --git a/debian/tests/logind b/debian/tests/logind
index 2ec044b..90d6c80 100755
--- a/debian/tests/logind
+++ b/debian/tests/logind
@@ -2,6 +2,10 @@
 set -e
 
 test_started() {
+    # ensure the *old* logind from before the upgrade isn't running
+    echo " * restarting systemd-logind"
+    systemctl restart systemd-logind
+
     echo " * daemon is started"
     # should start at boot, not with D-BUS activation
     LOGINDPID=$(pidof systemd-logind)
-- 
2.8.1

