Merge ~lvoytek/ubuntu/+source/net-tools:fix-lp1679346-add-dep8 into ubuntu/+source/net-tools:ubuntu/devel

Proposed by Lena Voytek
Status: Merged
Merged at revision: 1c2a126c4259ad00ac3ac2b48f0b4bd792ed8401
Proposed branch: ~lvoytek/ubuntu/+source/net-tools:fix-lp1679346-add-dep8
Merge into: ubuntu/+source/net-tools:ubuntu/devel
Diff against target: 111 lines (+85/-0)
4 files modified
debian/changelog (+9/-0)
debian/tests/control (+6/-0)
debian/tests/hostname-set-get (+48/-0)
debian/tests/ifconfig-lo-info (+22/-0)
Reviewer Review Type Date Requested Status
Bryce Harrington (community) Approve
Canonical Server MOTU reviewers Pending
Canonical Server Core Reviewers Pending
Canonical Server Pending
Review via email: mp+410677@code.launchpad.net

Description of the change

Added some DEP-8 tests to the package. One tests the hostname command and the other tests ifconfig.
I'm going to need sponsorship for this upload.

To post a comment you must log in.
Revision history for this message
Utkarsh Gupta (utkarsh) wrote :

I know Bryce is gonna review this one, so a note for him:

How about we forward this to Debian? I intend to do a new upload soon and can merge this after looking into it. A Salsa MR will be super helpful and quick.

Revision history for this message
Bryce Harrington (bryce) wrote :

Hi Lena,

Here is the review comments from this MP. We generally are overly verbose at explaining things for your first few MPs, so don't take the length as indicating anything's bad. Half the suggestions here are stylistic things to consider, but are otherwise treated as personal style choice.

Once you've made the changes, go ahead and squash and force-push back here, and we'll do a second round of review next week.

Revision history for this message
Bryce Harrington (bryce) :
review: Needs Fixing
Revision history for this message
Bryce Harrington (bryce) wrote :

Overall looks good, a few procedural notes:

When you update your branch make sure to add a comment on the MP itself, responding to feedback such as answering questions or filling in context. If you choose not to take some feedback, or to choose between multiple options, this is a good opportunity to explain rationale.

Make sure to link to your PPA from the MP itself. We use the PPA as proof that the package builds in a controlled environment, and also sometimes do quick tests with it.

https://launchpad.net/~lvoytek/+archive/ubuntu/net-tools-add-dep8

Similarly, when updating your branch with changes, also update the PPA to also carry the changes.

I've verified both tests pass shellcheck

I'll followup with you separately about forwarding these changes to debian

I've built locally and am running the autopkgtests. I've run the tests two different ways - first with a regular container, second with an ephemeral container. As expected, in the former method 'hostname-set-get' gets skipped, but it runs and passes in the second method.

autopkgtest [11:59:02]: @@@@@@@@@@@@@@@@@@@@ summary
hostname-set-get PASS
ifconfig-lo-info PASS

* Changelog:
  - [-] old content and logical tag match as expected
  - [√] changelog entry correct version and targeted codename
  - [√] changelog entries correct
  - [√] update-maintainer has been run

* Actual changes:
  - [-] no upstream changes to consider
  - [-] no further upstream version to consider
  - [√] debian changes look safe

* Old Delta:
  - [-] dropped changes are ok to be dropped
  - [-] nothing else to drop
  - [!] changes forwarded upstream/debian (if appropriate)

* New Delta:
  - [√] no new patches added
  - [-] patches match what was proposed upstream
  - [-] patches correctly included in debian/patches/series
  - [-] patches have correct DEP3 metadata

* Build/Test:
  - [√] build is ok
  - [!] verified PPA package installs/uninstalls
  - [!] autopkgtest against the PPA package passes
  - [√] sanity checks test fine

review: Approve
Revision history for this message
Bryce Harrington (bryce) wrote :

$ dput ubuntu net-tools_1.60+git20181103.0eebece-1ubuntu4_source.changes
D: Setting host argument.
Checking signature on .changes
gpg: /home/bryce/pkg/NetTools/review-mp410677/net-tools_1.60+git20181103.0eebece-1ubuntu4_source.changes: Valid signature from E603B2578FB8F0FB
Checking signature on .dsc
gpg: /home/bryce/pkg/NetTools/review-mp410677/net-tools_1.60+git20181103.0eebece-1ubuntu4.dsc: Valid signature from E603B2578FB8F0FB
Uploading to ubuntu (via ftp to upload.ubuntu.com):
  Uploading net-tools_1.60+git20181103.0eebece-1ubuntu4.dsc: done.
  Uploading net-tools_1.60+git20181103.0eebece-1ubuntu4.debian.tar.xz: done.
  Uploading net-tools_1.60+git20181103.0eebece-1ubuntu4_source.buildinfo: done.
  Uploading net-tools_1.60+git20181103.0eebece-1ubuntu4_source.changes: done.
Successfully uploaded packages.

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 cb63bc9..bfc9466 100644
3--- a/debian/changelog
4+++ b/debian/changelog
5@@ -1,3 +1,12 @@
6+net-tools (1.60+git20181103.0eebece-1ubuntu4) jammy; urgency=low
7+
8+ * Add new DEP8 tests for hostname and ifconfig (LP: #1679346):
9+ - d/t/control: add hostname-set-get and ifconfig-lo-info
10+ - d/t/hostname-set-get: new test
11+ - d/t/ifconfig-lo-info: new test
12+
13+ -- Lena Voytek <lena.voytek@canonical.com> Fri, 22 Oct 2021 07:49:06 -0700
14+
15 net-tools (1.60+git20181103.0eebece-1ubuntu3) impish; urgency=medium
16
17 * No-change rebuild to build packages with zstd compression.
18diff --git a/debian/tests/control b/debian/tests/control
19new file mode 100644
20index 0000000..be3c442
21--- /dev/null
22+++ b/debian/tests/control
23@@ -0,0 +1,6 @@
24+Tests: hostname-set-get
25+Depends: net-tools
26+Restrictions: needs-root, breaks-testbed
27+
28+Tests: ifconfig-lo-info
29+Depends: net-tools
30diff --git a/debian/tests/hostname-set-get b/debian/tests/hostname-set-get
31new file mode 100644
32index 0000000..5f619af
33--- /dev/null
34+++ b/debian/tests/hostname-set-get
35@@ -0,0 +1,48 @@
36+#!/bin/sh
37+
38+set -e
39+
40+ORIGINAL_HOSTNAME=$(hostname)
41+
42+# Test hostname set using: hostname [newname]
43+TEST_HOSTNAME="TestHostname"
44+hostname "${TEST_HOSTNAME}"
45+
46+if [ "$(hostname)" != "${TEST_HOSTNAME}" ]; then
47+ echo "Failed to set hostname to ${TEST_HOSTNAME} using hostname [newname]"
48+ exit 1
49+fi
50+
51+# Test hostname set using: hostname [-F filename | --file filename]
52+TEST_HOSTNAME="testF"
53+HOSTNAME_FILENAME="hostnamefile"
54+
55+touch "${HOSTNAME_FILENAME}"
56+echo "${TEST_HOSTNAME}" > "${HOSTNAME_FILENAME}"
57+hostname -F "${HOSTNAME_FILENAME}"
58+rm "${HOSTNAME_FILENAME}"
59+
60+if [ "$(hostname)" != "${TEST_HOSTNAME}" ]; then
61+ echo "Failed to set hostname to ${TEST_HOSTNAME} using hostname -F ${HOSTNAME_FILENAME}"
62+ exit 1
63+fi
64+
65+TEST_HOSTNAME="testfile"
66+
67+touch "${HOSTNAME_FILENAME}"
68+echo "${TEST_HOSTNAME}" > "${HOSTNAME_FILENAME}"
69+hostname --file "${HOSTNAME_FILENAME}"
70+rm "${HOSTNAME_FILENAME}"
71+
72+if [ "$(hostname)" != "${TEST_HOSTNAME}" ]; then
73+ echo "Failed to set hostname to ${TEST_HOSTNAME} using hostname --file ${HOSTNAME_FILENAME}"
74+ exit 1
75+fi
76+
77+# Return to original hostname
78+hostname "${ORIGINAL_HOSTNAME}"
79+
80+if [ "$(hostname)" != "${ORIGINAL_HOSTNAME}" ]; then
81+ echo "Failed to set hostname back to ${ORIGINAL_HOSTNAME}"
82+ exit 1
83+fi
84diff --git a/debian/tests/ifconfig-lo-info b/debian/tests/ifconfig-lo-info
85new file mode 100644
86index 0000000..cca6e12
87--- /dev/null
88+++ b/debian/tests/ifconfig-lo-info
89@@ -0,0 +1,22 @@
90+#!/bin/sh
91+
92+set -e
93+
94+# Confirm loopback is in the normal list
95+if ! ( ifconfig | grep -q lo: ); then
96+ echo "Failed to get lo from ifconfig"
97+ exit 1
98+fi
99+
100+# Confirm correctness of loopback device
101+LO_OUTPUT=$(ifconfig lo)
102+
103+if ! ( echo "${LO_OUTPUT}" | grep -q lo: ); then
104+ echo "Failed to get lo from ifconfig lo"
105+ exit 1
106+fi
107+
108+if ! ( echo "${LO_OUTPUT}" | grep -q "inet 127.0.0.1" ); then
109+ echo "Failed to get IP of 127.0.0.1 from ifconfig lo"
110+ exit 1
111+fi

Subscribers

People subscribed via source and target branches