Merge ~ahasenack/ubuntu/+source/isc-kea:lunar-isc-kea-apparmor-on-armhf into ubuntu/+source/isc-kea:ubuntu/devel

Proposed by Andreas Hasenack
Status: Merged
Approved by: git-ubuntu bot
Approved revision: not available
Merged at revision: ee0f85cf1a3ec7d29f8edce08418b529c7353792
Proposed branch: ~ahasenack/ubuntu/+source/isc-kea:lunar-isc-kea-apparmor-on-armhf
Merge into: ubuntu/+source/isc-kea:ubuntu/devel
Diff against target: 103 lines (+34/-12)
3 files modified
debian/changelog (+10/-0)
debian/control (+2/-1)
debian/tests/kea-dhcp4 (+22/-11)
Reviewer Review Type Date Requested Status
git-ubuntu bot Approve
Athos Ribeiro (community) Approve
Canonical Server MOTU reviewers Pending
Canonical Server Reporter Pending
Review via email: mp+437589@code.launchpad.net

Description of the change

At first I thought this was related to apparmor, hence the branch name, but that's not the case.

I made some changes here:
- give dhclient a bigger timeout. DHCP requests have a backoff time window.
- show more logs when it fails
- fix an actual issue with the regexp for /etc/resolv.conf

To post a comment you must log in.
Revision history for this message
Andreas Hasenack (ahasenack) wrote :

The test failure happened only on ubuntu, not debian, but I'll send this to debian and get the package back in sync.

Revision history for this message
Athos Ribeiro (athos-ribeiro) wrote :

Thanks, Andreas.

This LGTM!

However, I do not have means to run these dep8 changes on arm ATM. It would be nice to either trigger these tests in a PPA or ensure they are passing before uploading.

review: Approve
Revision history for this message
git-ubuntu bot (git-ubuntu-bot) wrote :

Approvers: ahasenack, athos-ribeiro
Uploaders: ahasenack, athos-ribeiro
MP auto-approved

review: Approve
Revision history for this message
Andreas Hasenack (ahasenack) wrote :

Tests are green

Revision history for this message
Andreas Hasenack (ahasenack) wrote :

Uploading isc-kea_2.2.0-3ubuntu1.dsc
Uploading isc-kea_2.2.0-3ubuntu1.debian.tar.xz
Uploading isc-kea_2.2.0-3ubuntu1_source.buildinfo
Uploading isc-kea_2.2.0-3ubuntu1_source.changes

I'll create a salsa PR once these tests run and pass in our real infra.

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1diff --git a/debian/changelog b/debian/changelog
2index 23d5306..bb30f8e 100644
3--- a/debian/changelog
4+++ b/debian/changelog
5@@ -1,3 +1,13 @@
6+isc-kea (2.2.0-3ubuntu1) lunar; urgency=medium
7+
8+ * d/t/kea-dhcp4: make the test more robust (LP: #2007855):
9+ - increase dhclient timeout to 60s, and run in verbose mode
10+ - show logs in the case of failure
11+ - set +e inside the cleanup handler
12+ - fix resolv.conf regexp
13+
14+ -- Andreas Hasenack <andreas@canonical.com> Mon, 20 Feb 2023 20:27:11 -0300
15+
16 isc-kea (2.2.0-3) unstable; urgency=medium
17
18 [ Andreas Hasenack ]
19diff --git a/debian/control b/debian/control
20index 7ed285a..7506b58 100644
21--- a/debian/control
22+++ b/debian/control
23@@ -1,7 +1,8 @@
24 Source: isc-kea
25 Section: net
26 Priority: optional
27-Maintainer: Kea <isc-kea@packages.debian.org>
28+Maintainer: Ubuntu Developers <ubuntu-devel-discuss@lists.ubuntu.com>
29+XSBC-Original-Maintainer: Kea <isc-kea@packages.debian.org>
30 Uploaders:
31 Adam Majer <adamm@zombino.com>,
32 Ondřej Surý <ondrej@debian.org>,
33diff --git a/debian/tests/kea-dhcp4 b/debian/tests/kea-dhcp4
34index 6b02cdb..1a2bb66 100644
35--- a/debian/tests/kea-dhcp4
36+++ b/debian/tests/kea-dhcp4
37@@ -15,20 +15,31 @@ declare -A dhcp4_config
38 resolv_conf_bkp=$(mktemp)
39
40 cleanup() {
41- if [ $? -ne 0 ]; then
42+ rc=$?
43+ set +e # so we don't exit midcleanup
44+ if [ ${rc} -ne 0 ]; then
45 echo "## FAIL"
46+ echo
47+ echo "## dmesg"
48+ dmesg -T | tail -n 500
49+ echo
50+ echo "## kea logs"
51+ journalctl -u kea-dhcp4-server.service
52 fi
53+ echo
54 echo "## Cleaning up"
55- ip link set "${server_iface}" down || :
56- ip link del "${server_iface}" || :
57- ip link set "${bridge}" down || :
58- brctl delbr "${bridge}" || :
59- ip netns delete "${client_ns}" || :
60- sed -r -i "/example.autopkgtest/d" /etc/hosts || :
61+ ip link set "${server_iface}" down
62+ ip link del "${server_iface}"
63+ ip link set "${bridge}" down
64+ brctl delbr "${bridge}"
65+ ip netns delete "${client_ns}"
66+ sed -r -i "/example.autopkgtest/d" /etc/hosts
67 if [ -s "${resolv_conf_bkp}" ]; then
68 cat "${resolv_conf_bkp}" > /etc/resolv.conf
69 fi
70- rm -f "${resolv_conf_bkp}" || :
71+ rm -f "${resolv_conf_bkp}"
72+ # restore it for when we are called from the main script, and not the trap
73+ set -e
74 }
75
76 trap cleanup EXIT
77@@ -161,7 +172,7 @@ sleep 2s
78
79 echo
80 echo "## Obtaining IP via dhclient"
81-run_on_client timeout -v 20s dhclient "${client_iface}"
82+run_on_client timeout -v 60s dhclient -v "${client_iface}"
83 echo "## OK"
84
85 ip=$(run_on_client ip -4 -o addr show dev "${client_iface}" | awk '{print $4}')
86@@ -199,7 +210,7 @@ fi
87
88 echo
89 echo "## Checking that the DNS domain \"${test_domain}\" was added to resolv.conf"
90-if grep -qE "^search[[:blank:]]+${test_domain//./\\.}" /etc/resolv.conf; then
91+if grep -E "^search[[:blank:]]" /etc/resolv.conf | grep -q -w -F "${test_domain}"; then
92 echo "## OK"
93 else
94 echo "## ERROR"
95@@ -210,7 +221,7 @@ fi
96
97 echo
98 echo "## Releasing IP via dhclient -r"
99-run_on_client timeout -v 20s dhclient -r
100+run_on_client timeout -v 60s dhclient -v -r
101 echo "## OK"
102
103 echo

Subscribers

People subscribed via source and target branches