Package: heartbeat
Version: 1:3.0.6-6
Severity: normal

Hi,
due to recent changes in the Ubuntu / Launchpad infrastructure I
became aware that the tests of resource-agents fail for us most of the
time.
It would be the same on Debian if you extend to more architectures or
on slightly changed testbed setup.

While it would be perfect to make autopkgtests totally independent of
the testbeds networking setup that would be too much of a rewrite of
the test.
But instead we can harden it a bit to work in many more test environments)

Since this is a single change I thought I don't need a link to a git
to pull from, let me know if you want something else than a patch.


-- 
Christian Ehrhardt
Software Engineer, Ubuntu Server
Canonical Ltd
From 9498ca1416778005f62babc50e4f67d045019dc7 Mon Sep 17 00:00:00 2001
From: Christian Ehrhardt <christian.ehrha...@canonical.com>
Date: Mon, 27 Nov 2017 11:20:31 +0100
Subject: [PATCH] d/t/heartbeat: pick only one test device

If an environment (as in Ubunut's LP test infrastructure) has multiple
connections to the network of the default route, then the current check
returns multiple lines.

That leads to a broken config that is failing to parse:
  ERROR: Illegal directive [enc1] in /etc/ha.d//ha.cf

This is the same as on a laptop with wired+wireless:
$ ip route show 0/0 | cut -d ' ' -f 5
enp0s25
wlp4s0

To avoid any such issues pick just one of those as test device.

Signed-off-by: Christian Ehrhardt <christian.ehrha...@canonical.com>
---
 debian/tests/heartbeat | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/debian/tests/heartbeat b/debian/tests/heartbeat
index 2e49fd4..0da4d11 100644
--- a/debian/tests/heartbeat
+++ b/debian/tests/heartbeat
@@ -3,7 +3,7 @@
 set -e
 
 HOSTNAME=$(hostname)
-IFACE=$(ip route show 0/0 | cut -d ' ' -f 5)
+IFACE=$(ip route show 0/0 | head -n 1 | cut -d ' ' -f 5)
 
 cat <<EOF >/etc/ha.d/ha.cf
 logfacility local0
-- 
2.7.4

Reply via email to