Merge ~chad.smith/ubuntu/+source/ubuntu-advantage-tools:release-27-bionic into ubuntu/+source/ubuntu-advantage-tools:ubuntu/bionic-proposed

Proposed by Chad Smith
Status: Merged
Approved by: Bryce Harrington
Approved revision: 153a74cbb2d70e56355b9f0e07f62e07267534f4
Merge reported by: Chad Smith
Merged at revision: 6880d56c4bf257c8b82bc9a031e5cc9b08df304c
Proposed branch: ~chad.smith/ubuntu/+source/ubuntu-advantage-tools:release-27-bionic
Merge into: ubuntu/+source/ubuntu-advantage-tools:ubuntu/bionic-proposed
Diff against target: 356 lines (+179/-0) (has conflicts)
10 files modified
.gitignore (+8/-0)
Jenkinsfile (+16/-0)
apt-hook/Makefile (+33/-0)
apt-hook/json-hook-src/go.mod (+4/-0)
apt-hook/json-hook-src/json-hook.go (+42/-0)
apt-hook/json-hook-src/json-hook_test.go (+34/-0)
debian/changelog (+22/-0)
debian/control (+7/-0)
debian/rules (+4/-0)
uaclient/tests/test_util.py (+9/-0)
Conflict in .gitignore
Conflict in Jenkinsfile
Conflict in apt-hook/Makefile
Conflict in apt-hook/json-hook-src/go.mod
Conflict in apt-hook/json-hook-src/json-hook.go
Conflict in apt-hook/json-hook-src/json-hook_test.go
Conflict in debian/changelog
Conflict in debian/control
Conflict in debian/rules
Conflict in uaclient/tests/test_util.py
Reviewer Review Type Date Requested Status
Bryce Harrington (community) Approve
Grant Orndorff Pending
Lucas Albuquerque Medeiros de Moura Pending
Review via email: mp+401916@code.launchpad.net

Description of the change

New upstream release of 27.0 for release into xenial

Avoiding rich commit history because this is a branch new client (python instead of bash) which represented a major upgrade that is backwards incompatible.

We will be following this verification procedure for SRU of ubuntu-advantage-tools in order to release into xenial: https://wiki.ubuntu.com/UbuntuAdvantageToolsUpdates

Functional equivalent debs have been uploaded to this ppa for testing https://launchpad.net/~orndorffgrant/+archive/ubuntu/uaclient-staging-27

to test:
$ cat > 27_test_setup.yaml <<EOF
#cloud-config
write_files:
- content: |
    # Ubuntu-Advantage client config file.
    contract_url: 'https://contracts.canonical.com'
    data_dir: /var/lib/ubuntu-advantage
    log_level: debug
    log_file: /var/log/ubuntu-advantage.log
    features:
        allow_beta: true
  owner: root:root
  path: /etc/ubuntu-advantage/uaclient.conf
  permissions: '0644'
apt:
  sources:
    ua_staging_ppa:
        source: 'deb http://ppa.launchpad.net/orndorffgrant/uaclient-staging-27/ubuntu \$RELEASE main'
        keyid: 74E59E9E
packages: [ubuntu-advantage-tools]
EOF

$ lxc launch ubuntu-daily:biojnic test-27-b -c user.user-data="$(cat 27_test_setup.yaml)"
$ lxc exec test-27-b -- cloud-init status --wait --long # wait for pkg installs

$ lxc exec test-27-b -- ua version

$ lxc exec test-27-b -- ua status # show unattached

This machine is not attached to a UA subscription.
See https://ubuntu.com/advantage

# attach with token from https://ubuntu.com/advantage
$ lxc exec test-27-b -- ua attach <REDACTED>
# assert esm-infra auto enabled

# no failures on attach
lxc exect test-27-b -- grep Traceback /var/log/ubuntu-advantage.log

# assert default contract not authorized to esm-apps
$ lxc exec test-27-b -- ua enable esm-apps

will manipulate other subcommands

To post a comment you must log in.
Revision history for this message
Chad Smith (chad.smith) wrote :
Download full text (5.0 KiB)

csmith@downtown:/tmp$ lxc exec test-27-b -- cloud-init status --wait --long

status: done
time: Wed, 28 Apr 2021 00:09:04 +0000
detail:
DataSourceNoCloud [seed=/var/lib/cloud/seed/nocloud-net][dsmode=net]
csmith@downtown:/tmp$ lxc exec test-27-b -- ua version
27.0~18.04.1 +allow_beta +extra_security_params
csmith@downtown:/tmp$ lxc exec test-27-b -- ua status
SERVICE AVAILABLE DESCRIPTION
cc-eal no Common Criteria EAL2 Provisioning Packages
cis yes Center for Internet Security Audit Tools
esm-apps yes UA Apps: Extended Security Maintenance (ESM)
esm-infra yes UA Infra: Extended Security Maintenance (ESM)
fips yes NIST-certified FIPS modules
fips-updates yes Uncertified security updates to FIPS modules
livepatch yes Canonical Livepatch service

This machine is not attached to a UA subscription.
See https://ubuntu.com/advantage
csmith@downtown:/tmp$ lxc exec test-27-b -- ua attach <REDACTED_NO_APPS_>
Enabling default service esm-infra
Updating package lists
UA Infra: ESM enabled
This machine is now attached to '<email address hidden>'

SERVICE ENTITLED STATUS DESCRIPTION
cc-eal yes n/a Common Criteria EAL2 Provisioning Packages
cis yes disabled Center for Internet Security Audit Tools
esm-apps no — UA Apps: Extended Security Maintenance (ESM)
esm-infra yes enabled UA Infra: Extended Security Maintenance (ESM)
fips yes n/a NIST-certified FIPS modules
fips-updates yes n/a Uncertified security updates to FIPS modules
livepatch yes n/a Canonical Livepatch service

NOTICES
Operation in progress: ua attach

Enable services with: ua enable <service>

     Account: <email address hidden>
Subscription: <email address hidden>
csmith@downtown:/tmp$ lxc exec test-27-b -- grep Traceback /var/log/ubuntu-advantage.log
csmith@downtown:/tmp$ lxc exec test-27-b -- ua enable esm-apps
One moment, checking your subscription first
This subscription is not entitled to UA Apps: ESM
For more information see: https://ubuntu.com/advantage.
csmith@downtown:/tmp$ lxc exec test-27-b -- ua detach
Detach will disable the following service:
    esm-infra
Are you sure? (y/N) y
Updating package lists
This machine is now detached.
csmith@downtown:/tmp$ lxc exec test-27-b -- ua attach <REDACTED_WITH_APPS>
Enabling default service esm-apps
Updating package lists
UA Apps: ESM enabled
Enabling default service esm-infra
Updating package lists
UA Infra: ESM enabled
This machine is now attached to 'UA Applications - Essential (Physical)'

SERVICE ENTITLED STATUS DESCRIPTION
cc-eal yes n/a Common Criteria EAL2 Provisioning Packages
cis yes disabled Center for Internet Security Audit Tools
esm-apps yes enabled UA Apps: Extended Security Maintenance (ESM)
esm-infra yes enabled UA Infra: Extended Security Maintenance (ESM)
fips yes n/a NIST-certified FIPS modules
fips-updates yes n/a Uncertified security updates to FIPS modules
livepatch yes n/a ...

Read more...

07e2ac7... by Chad Smith

sync new upstream release 27.0 for bionic release

Revision history for this message
Chad Smith (chad.smith) wrote :
Download full text (5.1 KiB)

re-ran locally with a local sbuild of this branch on bionic
csmith@downtown:~/ $ lxc exec test-27-b -- cloud-init status --wait --long

status: done
time: Wed, 28 Apr 2021 00:09:04 +0000
detail:
DataSourceNoCloud [seed=/var/lib/cloud/seed/nocloud-net][dsmode=net]
csmith@downtown:~/ $
csmith@downtown:~/ $
csmith@downtown:~/ $
csmith@downtown:~/ $ lxc exec test-27-b -- ua version
27.0~18.04.1 +allow_beta +extra_security_params
csmith@downtown:~/ $ lxc exec test-27-b -- ua status
SERVICE AVAILABLE DESCRIPTION
cc-eal no Common Criteria EAL2 Provisioning Packages
cis yes Center for Internet Security Audit Tools
esm-apps yes UA Apps: Extended Security Maintenance (ESM)
esm-infra yes UA Infra: Extended Security Maintenance (ESM)
fips yes NIST-certified FIPS modules
fips-updates yes Uncertified security updates to FIPS modules
livepatch yes Canonical Livepatch service

This machine is not attached to a UA subscription.
See https://ubuntu.com/advantage
csmith@downtown:~/ $ lxc exec test-27-b -- ua attach <REDACTED_NO_APPS>
Enabling default service esm-infra
Updating package lists
UA Infra: ESM enabled
This machine is now attached to '<email address hidden>'

SERVICE ENTITLED STATUS DESCRIPTION
cc-eal yes n/a Common Criteria EAL2 Provisioning Packages
cis yes disabled Center for Internet Security Audit Tools
esm-apps no — UA Apps: Extended Security Maintenance (ESM)
esm-infra yes enabled UA Infra: Extended Security Maintenance (ESM)
fips yes n/a NIST-certified FIPS modules
fips-updates yes n/a Uncertified security updates to FIPS modules
livepatch yes n/a Canonical Livepatch service

NOTICES
Operation in progress: ua attach

Enable services with: ua enable <service>

     Account: <email address hidden>
Subscription: <email address hidden>
csmith@downtown:~/ $ lxc exec test-27-b -- ua enable esm-apps
One moment, checking your subscription first
This subscription is not entitled to UA Apps: ESM
For more information see: https://ubuntu.com/advantage.
csmith@downtown:~/ $ lxc exec test-27-b -- grep Traceback /var/log/ubuntu-advantage.log
csmith@downtown:~/ $ lxc exec test-27-b -- ua detach
Detach will disable the following service:
    esm-infra
Are you sure? (y/N) y
Updating package lists
This machine is now detached.
csmith@downtown:~/ $ lxc exec test-27-b -- ua attach <REDACTED_WITH_APPS>
Enabling default service esm-apps
Updating package lists
UA Apps: ESM enabled
Enabling default service esm-infra
Updating package lists
UA Infra: ESM enabled
This machine is now attached to 'UA Applications - Essential (Physical)'

SERVICE ENTITLED STATUS DESCRIPTION
cc-eal yes n/a Common Criteria EAL2 Provisioning Packages
cis yes disabled Center for Internet Security Audit Tools
esm-apps yes enabled UA Apps: Extended Security Maintenance (ESM)
esm-infra yes enabled UA Infra: Extended Security Maintenance (ESM)
fips yes n/a NIST-certified FIPS mod...

Read more...

153a74c... by Grant Orndorff

apt-hook: mitigate failures with true

In case something catastrophic happens
in our apt hooks, we now make sure the subprocess
always returns successfully by calling `true`
if our hook fails.

f5c81f1... by Chad Smith

add .gitignore

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

LGTM, tagged and uploaded for bionic.

triage-bionic+18.04:~/pkg/UbuntuAdvantageTools/review-mp401916$ dput ubuntu ubuntu-advantage-tools_27.0~18.04.1_source.changes
Checking signature on .changes
gpg: /home/bryce/pkg/UbuntuAdvantageTools/review-mp401916/ubuntu-advantage-tools_27.0~18.04.1_source.changes: Valid signature from E603B2578FB8F0FB
Checking signature on .dsc
gpg: /home/bryce/pkg/UbuntuAdvantageTools/review-mp401916/ubuntu-advantage-tools_27.0~18.04.1.dsc: Valid signature from E603B2578FB8F0FB
Uploading to ubuntu (via ftp to upload.ubuntu.com):
  Uploading ubuntu-advantage-tools_27.0~18.04.1.dsc: done.
  Uploading ubuntu-advantage-tools_27.0~18.04.1.tar.xz: done.
  Uploading ubuntu-advantage-tools_27.0~18.04.1_source.buildinfo: done.
  Uploading ubuntu-advantage-tools_27.0~18.04.1_source.changes: done.
Successfully uploaded packages.
triage-bionic+18.04:~/pkg/UbuntuAdvantageTools/review-mp401916$ cd ubuntu-advantage-tools-gu/
triage-bionic+18.04:~/pkg/UbuntuAdvantageTools/review-mp401916/ubuntu-advantage-tools-gu$ git ubuntu tag --upload
triage-bionic+18.04:~/pkg/UbuntuAdvantageTools/review-mp401916/ubuntu-advantage-tools-gu$ git push -f pkg upload/27.0_18.04.1
Counting objects: 215, done.
Delta compression using up to 12 threads.
Compressing objects: 100% (200/200), done.
Writing objects: 100% (215/215), 331.27 KiB | 498.00 KiB/s, done.
Total 215 (delta 17), reused 91 (delta 7)
remote: Resolving deltas: 100% (17/17), done.
To ssh://git.launchpad.net/ubuntu/+source/ubuntu-advantage-tools
 * [new tag] upload/27.0_18.04.1 -> upload/27.0_18.04.1

review: Approve
8f93c4d... by Grant Orndorff

apt-hook: refactor json hook messaging to be dry

The message construction code in the json hook
was pretty repetitive. This cleans it up a bit
and also removes some unnecessary explicit struct
names in the tests.

e119b9e... by Grant Orndorff

apt-hook: ignore go hook on some architectures

Golang doesn't support powerpc and riscv on older versions.
This configures our Build-Depends and Makefile to gracefully
handle scenarios where we can't build our go hook. We will
simply not ship the go hook in these limited scenarios.

Fixes: #1603

6b1cfe2... by Grant Orndorff

build: order build-depends alternatives newer first

When using alternatives in the Build-Depends section of
debian/control, we should always put the newer version of
a package first. This is because sbuild doesn't resolve
alternatives by default and we want sbuild to work on the
latest version of ubuntu with default settings.

LP: #1926949

8f91ecc... by Grant Orndorff

tests: fix subp ls error case

7c1d014... by Chad Smith

changelog 27.0.1 & 27.0.2

ae8ff60... by Chad Smith

jenkinsfile: trusty sbuild --resolve-depends for CI runs

6880d56... by Chad Smith

changelog: 27.0.2~18.04.1

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1diff --git a/.gitignore b/.gitignore
2index 2b2da67..29b86f4 100644
3--- a/.gitignore
4+++ b/.gitignore
5@@ -22,3 +22,11 @@ ubuntu_advantage_tools.dsc
6 # test/jenkins artifacts
7 pytest_results.xml
8 reports/
9+<<<<<<< .gitignore
10+=======
11+
12+# apt-hook build artifacts
13+apt-hook/hook
14+apt-hook/ubuntu-advantage.pot
15+apt-hook/json-hook-src/json-hook
16+>>>>>>> .gitignore
17diff --git a/Jenkinsfile b/Jenkinsfile
18index 2082e19..925a9c3 100644
19--- a/Jenkinsfile
20+++ b/Jenkinsfile
21@@ -87,7 +87,11 @@ pipeline {
22 cp debian/changelog ${WORKSPACE}/debian/changelog-${SERIES_VERSION}
23 sed -i "s/${PKG_VERSION}/${NEW_PKG_VERSION}/" ${WORKSPACE}/debian/changelog-${SERIES_VERSION}
24 dpkg-source -l${WORKSPACE}/debian/changelog-${SERIES_VERSION} -b .
25+<<<<<<< Jenkinsfile
26 sbuild --nolog --verbose --dist=${BUILD_SERIES} --no-run-lintian --append-to-version=~${SERIES_VERSION} ../ubuntu-advantage-tools*${NEW_PKG_VERSION}*dsc
27+=======
28+ sbuild --resolve-alternatives --nolog --verbose --dist=${BUILD_SERIES} --no-run-lintian --append-to-version=~${SERIES_VERSION} ../ubuntu-advantage-tools*${NEW_PKG_VERSION}*dsc
29+>>>>>>> Jenkinsfile
30 cp ./ubuntu-advantage-tools*${SERIES_VERSION}*.deb ${ARTIFACT_DIR}/ubuntu-advantage-tools-${BUILD_SERIES}.deb
31 cp ./ubuntu-advantage-pro*${SERIES_VERSION}*.deb ${ARTIFACT_DIR}/ubuntu-advantage-pro-${BUILD_SERIES}.deb
32 '''
33@@ -108,7 +112,11 @@ pipeline {
34 cp debian/changelog ${WORKSPACE}/debian/changelog-${SERIES_VERSION}
35 sed -i "s/${PKG_VERSION}/${NEW_PKG_VERSION}/" ${WORKSPACE}/debian/changelog-${SERIES_VERSION}
36 dpkg-source -l${WORKSPACE}/debian/changelog-${SERIES_VERSION} -b .
37+<<<<<<< Jenkinsfile
38 sbuild --nolog --verbose --dist=${BUILD_SERIES} --no-run-lintian --append-to-version=~${SERIES_VERSION} ../ubuntu-advantage-tools*${NEW_PKG_VERSION}*dsc
39+=======
40+ sbuild --resolve-alternatives --nolog --verbose --dist=${BUILD_SERIES} --no-run-lintian --append-to-version=~${SERIES_VERSION} ../ubuntu-advantage-tools*${NEW_PKG_VERSION}*dsc
41+>>>>>>> Jenkinsfile
42 cp ./ubuntu-advantage-tools*${SERIES_VERSION}*.deb ${ARTIFACT_DIR}/ubuntu-advantage-tools-${BUILD_SERIES}.deb
43 cp ./ubuntu-advantage-pro*${SERIES_VERSION}*.deb ${ARTIFACT_DIR}/ubuntu-advantage-pro-${BUILD_SERIES}.deb
44 '''
45@@ -129,7 +137,11 @@ pipeline {
46 cp debian/changelog ${WORKSPACE}/debian/changelog-${SERIES_VERSION}
47 sed -i "s/${PKG_VERSION}/${NEW_PKG_VERSION}/" ${WORKSPACE}/debian/changelog-${SERIES_VERSION}
48 dpkg-source -l${WORKSPACE}/debian/changelog-${SERIES_VERSION} -b .
49+<<<<<<< Jenkinsfile
50 sbuild --nolog --verbose --dist=${BUILD_SERIES} --no-run-lintian --append-to-version=~${SERIES_VERSION} ../ubuntu-advantage-tools*${NEW_PKG_VERSION}*dsc
51+=======
52+ sbuild --resolve-alternatives --nolog --verbose --dist=${BUILD_SERIES} --no-run-lintian --append-to-version=~${SERIES_VERSION} ../ubuntu-advantage-tools*${NEW_PKG_VERSION}*dsc
53+>>>>>>> Jenkinsfile
54 cp ./ubuntu-advantage-tools*${SERIES_VERSION}*.deb ${ARTIFACT_DIR}/ubuntu-advantage-tools-${BUILD_SERIES}.deb
55 cp ./ubuntu-advantage-pro*${SERIES_VERSION}*.deb ${ARTIFACT_DIR}/ubuntu-advantage-pro-${BUILD_SERIES}.deb
56 '''
57@@ -150,7 +162,11 @@ pipeline {
58 cp debian/changelog ${WORKSPACE}/debian/changelog-${SERIES_VERSION}
59 sed -i "s/${PKG_VERSION}/${NEW_PKG_VERSION}/" ${WORKSPACE}/debian/changelog-${SERIES_VERSION}
60 dpkg-source -l${WORKSPACE}/debian/changelog-${SERIES_VERSION} -b .
61+<<<<<<< Jenkinsfile
62 sbuild --nolog --verbose --dist=${BUILD_SERIES} --no-run-lintian --append-to-version=~${SERIES_VERSION} ../ubuntu-advantage-tools*${NEW_PKG_VERSION}*dsc
63+=======
64+ sbuild --resolve-alternatives --nolog --verbose --dist=${BUILD_SERIES} --no-run-lintian --append-to-version=~${SERIES_VERSION} ../ubuntu-advantage-tools*${NEW_PKG_VERSION}*dsc
65+>>>>>>> Jenkinsfile
66 cp ./ubuntu-advantage-tools*${SERIES_VERSION}*.deb ${ARTIFACT_DIR}/ubuntu-advantage-tools-${BUILD_SERIES}.deb
67 cp ./ubuntu-advantage-pro*${SERIES_VERSION}*.deb ${ARTIFACT_DIR}/ubuntu-advantage-pro-${BUILD_SERIES}.deb
68 '''
69diff --git a/apt-hook/Makefile b/apt-hook/Makefile
70index 15c4856..16da1bf 100644
71--- a/apt-hook/Makefile
72+++ b/apt-hook/Makefile
73@@ -1,3 +1,24 @@
74+<<<<<<< apt-hook/Makefile
75+=======
76+# the go hook steps will be skipped if this is a nonempty string
77+SKIP_GO_HOOK = ""
78+
79+GO_BIN = $(shell which go)
80+# Try go-1.14 and go-1.10 if not in path
81+ifeq ($(GO_BIN),)
82+ ifneq ($(wildcard /usr/lib/go-1.14/bin/go),)
83+ GO_BIN = /usr/lib/go-1.14/bin/go
84+ else ifneq ($(wildcard /usr/lib/go-1.10/bin/go),)
85+ GO_BIN = /usr/lib/go-1.10/bin/go
86+ endif
87+endif
88+
89+# If still not found then just don't build the go hook
90+ifeq ($(GO_BIN),)
91+ SKIP_GO_HOOK = "1"
92+endif
93+
94+>>>>>>> apt-hook/Makefile
95 all: build
96
97 build: hook ubuntu-advantage.pot json-hook
98@@ -9,15 +30,27 @@ hook: hook.cc
99 $(CXX) -Wall -Wextra -pedantic -std=c++11 $(CXXFLAGS) $(CPPFLAGS) $(LDFLAGS) -g -o hook hook.cc -lapt-pkg $(LDLIBS)
100
101 json-hook:
102+<<<<<<< apt-hook/Makefile
103 cd json-hook-src && GOCACHE=/tmp/ go build json-hook.go
104+=======
105+ [ $(SKIP_GO_HOOK) ] || (cd json-hook-src && GOCACHE=/tmp/ $(GO_BIN) build json-hook.go)
106+>>>>>>> apt-hook/Makefile
107
108 install: hook json-hook
109 install -D -m 644 20apt-esm-hook.conf $(DESTDIR)/etc/apt/apt.conf.d/20apt-esm-hook.conf
110 install -D -m 755 hook $(DESTDIR)/usr/lib/ubuntu-advantage/apt-esm-hook
111+<<<<<<< apt-hook/Makefile
112 install -D -m 755 json-hook-src/json-hook $(DESTDIR)/usr/lib/ubuntu-advantage/apt-esm-json-hook
113+=======
114+ [ $(SKIP_GO_HOOK) ] || install -D -m 755 json-hook-src/json-hook $(DESTDIR)/usr/lib/ubuntu-advantage/apt-esm-json-hook
115+>>>>>>> apt-hook/Makefile
116
117 clean:
118 rm -f hook ubuntu-advantage.pot json-hook-src/json-hook
119
120 test:
121+<<<<<<< apt-hook/Makefile
122 cd json-hook-src && go test
123+=======
124+ [ $(SKIP_GO_HOOK) ] || (cd json-hook-src && GOCACHE=/tmp/ $(GO_BIN) test)
125+>>>>>>> apt-hook/Makefile
126diff --git a/apt-hook/json-hook-src/go.mod b/apt-hook/json-hook-src/go.mod
127index 66726af..2823e25 100644
128--- a/apt-hook/json-hook-src/go.mod
129+++ b/apt-hook/json-hook-src/go.mod
130@@ -1,3 +1,7 @@
131 module json-hook
132
133+<<<<<<< apt-hook/json-hook-src/go.mod
134 go 1.2
135+=======
136+go 1.7
137+>>>>>>> apt-hook/json-hook-src/go.mod
138diff --git a/apt-hook/json-hook-src/json-hook.go b/apt-hook/json-hook-src/json-hook.go
139index 0f2e3eb..fc6b704 100644
140--- a/apt-hook/json-hook-src/json-hook.go
141+++ b/apt-hook/json-hook-src/json-hook.go
142@@ -45,6 +45,21 @@ type jsonRPC struct {
143 } `json:"params"`
144 }
145
146+<<<<<<< apt-hook/json-hook-src/json-hook.go
147+=======
148+func updatesFromSource(count int, source string, first bool) string {
149+ security := ""
150+ if first {
151+ security = "security "
152+ }
153+ updates := "updates"
154+ if count == 1 {
155+ updates = "update"
156+ }
157+ return fmt.Sprintf("%d %s %s%s", count, source, security, updates)
158+}
159+
160+>>>>>>> apt-hook/json-hook-src/json-hook.go
161 func createUpdateMessage(standardSecurityCount int, esmInfraCount int, esmAppsCount int) string {
162 displayStandard := true
163 displayEsmInfra := true
164@@ -72,6 +87,7 @@ func createUpdateMessage(standardSecurityCount int, esmInfraCount int, esmAppsCo
165 }
166
167 standardUpdates := ""
168+<<<<<<< apt-hook/json-hook-src/json-hook.go
169 esmInfraUpdates := ""
170 esmAppsUpdates := ""
171 if displayStandard {
172@@ -118,6 +134,32 @@ func createUpdateMessage(standardSecurityCount int, esmInfraCount int, esmAppsCo
173 }
174
175 return standardUpdates + esmInfraUpdates + esmAppsUpdates
176+=======
177+ afterStandard := ""
178+ esmInfraUpdates := ""
179+ afterInfra := ""
180+ esmAppsUpdates := ""
181+
182+ if displayStandard {
183+ standardUpdates = updatesFromSource(standardSecurityCount, "standard", true)
184+ if displayEsmInfra && displayEsmApps {
185+ afterStandard = ", "
186+ } else if displayEsmInfra || displayEsmApps {
187+ afterStandard = " and "
188+ }
189+ }
190+ if displayEsmInfra {
191+ esmInfraUpdates = updatesFromSource(esmInfraCount, "esm-infra", esmInfraFirst)
192+ if displayEsmApps {
193+ afterInfra = " and "
194+ }
195+ }
196+ if displayEsmApps {
197+ esmAppsUpdates = updatesFromSource(esmAppsCount, "esm-apps", esmAppsFirst)
198+ }
199+
200+ return standardUpdates + afterStandard + esmInfraUpdates + afterInfra + esmAppsUpdates
201+>>>>>>> apt-hook/json-hook-src/json-hook.go
202 }
203
204 func fromOriginAndArchive(pkgVersion jsonRPCPackageVersion, origin string, archive string) bool {
205diff --git a/apt-hook/json-hook-src/json-hook_test.go b/apt-hook/json-hook-src/json-hook_test.go
206index cfc1788..135ec2c 100644
207--- a/apt-hook/json-hook-src/json-hook_test.go
208+++ b/apt-hook/json-hook-src/json-hook_test.go
209@@ -14,6 +14,7 @@ func TestCreateUpdateMessages(t *testing.T) {
210 expectedMessage string
211 }
212 testParamsList := []params{
213+<<<<<<< apt-hook/json-hook-src/json-hook_test.go
214 params{0, 0, 0, ""},
215 params{0, 0, 1, "1 esm-apps security update"},
216 params{0, 0, 2, "2 esm-apps security updates"},
217@@ -41,6 +42,35 @@ func TestCreateUpdateMessages(t *testing.T) {
218 params{2, 2, 0, "2 standard security updates and 2 esm-infra updates"},
219 params{2, 2, 1, "2 standard security updates, 2 esm-infra updates and 1 esm-apps update"},
220 params{2, 2, 2, "2 standard security updates, 2 esm-infra updates and 2 esm-apps updates"},
221+=======
222+ {0, 0, 0, ""},
223+ {0, 0, 1, "1 esm-apps security update"},
224+ {0, 0, 2, "2 esm-apps security updates"},
225+ {0, 1, 0, "1 esm-infra security update"},
226+ {0, 1, 1, "1 esm-infra security update and 1 esm-apps update"},
227+ {0, 1, 2, "1 esm-infra security update and 2 esm-apps updates"},
228+ {0, 2, 0, "2 esm-infra security updates"},
229+ {0, 2, 1, "2 esm-infra security updates and 1 esm-apps update"},
230+ {0, 2, 2, "2 esm-infra security updates and 2 esm-apps updates"},
231+ {1, 0, 0, "1 standard security update"},
232+ {1, 0, 1, "1 standard security update and 1 esm-apps update"},
233+ {1, 0, 2, "1 standard security update and 2 esm-apps updates"},
234+ {1, 1, 0, "1 standard security update and 1 esm-infra update"},
235+ {1, 1, 1, "1 standard security update, 1 esm-infra update and 1 esm-apps update"},
236+ {1, 1, 2, "1 standard security update, 1 esm-infra update and 2 esm-apps updates"},
237+ {1, 2, 0, "1 standard security update and 2 esm-infra updates"},
238+ {1, 2, 1, "1 standard security update, 2 esm-infra updates and 1 esm-apps update"},
239+ {1, 2, 2, "1 standard security update, 2 esm-infra updates and 2 esm-apps updates"},
240+ {2, 0, 0, "2 standard security updates"},
241+ {2, 0, 1, "2 standard security updates and 1 esm-apps update"},
242+ {2, 0, 2, "2 standard security updates and 2 esm-apps updates"},
243+ {2, 1, 0, "2 standard security updates and 1 esm-infra update"},
244+ {2, 1, 1, "2 standard security updates, 1 esm-infra update and 1 esm-apps update"},
245+ {2, 1, 2, "2 standard security updates, 1 esm-infra update and 2 esm-apps updates"},
246+ {2, 2, 0, "2 standard security updates and 2 esm-infra updates"},
247+ {2, 2, 1, "2 standard security updates, 2 esm-infra updates and 1 esm-apps update"},
248+ {2, 2, 2, "2 standard security updates, 2 esm-infra updates and 2 esm-apps updates"},
249+>>>>>>> apt-hook/json-hook-src/json-hook_test.go
250 }
251
252 for i, testParams := range testParamsList {
253@@ -62,7 +92,11 @@ func TestCountSecurityUpdates(t *testing.T) {
254 expectedEsmAppsCount int
255 }
256 testParamsList := []params{
257+<<<<<<< apt-hook/json-hook-src/json-hook_test.go
258 params{mockJson, 1, 2, 3},
259+=======
260+ {mockJson, 1, 2, 3},
261+>>>>>>> apt-hook/json-hook-src/json-hook_test.go
262 }
263
264 for i, testParams := range testParamsList {
265diff --git a/debian/changelog b/debian/changelog
266index 5f3f53a..ca5de47 100644
267--- a/debian/changelog
268+++ b/debian/changelog
269@@ -1,3 +1,25 @@
270+<<<<<<< debian/changelog
271+=======
272+ubuntu-advantage-tools (27.0.2~18.04.1) bionic; urgency=medium
273+
274+ * d/control:
275+ - order build-depends alternatives newer first (LP: #1926949)
276+ - apt-hook: do not attempt to package go APT JSON hook on some
277+ architectures (GH: #1603) (LP: #1927795)
278+ * Bug-fix release 27.0.2: build failures on riscv64 and powerpc
279+ - apt-hook: refactor json hook messaging to be dry
280+ - tests: fix subp ls error case for powerpc builds
281+ - jenkinsfile: add --resolve-alternatives for trusty builds
282+
283+ -- Chad Smith <chad.smith@canonical.com> Fri, 07 May 2021 11:58:03 -0600
284+
285+ubuntu-advantage-tools (27.0.1) impish; urgency=medium
286+
287+ * Add .gitignore and cleanup ignored directory .pytest_cache
288+
289+ -- Chad Smith <chad.smith@canonical.com> Fri, 07 May 2021 11:55:07 -0600
290+
291+>>>>>>> debian/changelog
292 ubuntu-advantage-tools (27.0~18.04.1) bionic; urgency=medium
293
294 * New upstream release 27.0: (LP: #1926361)
295diff --git a/debian/control b/debian/control
296index cd28a1f..660a80d 100644
297--- a/debian/control
298+++ b/debian/control
299@@ -6,10 +6,17 @@ Build-Depends: bash-completion,
300 debhelper (>=9),
301 debianutils,
302 dh-python,
303+<<<<<<< debian/control
304 dh-systemd | debhelper (>= 13.3),
305 gettext,
306 git,
307 golang,
308+=======
309+ debhelper (>= 13.3) | dh-systemd,
310+ gettext,
311+ git,
312+ golang-go (>= 2:1.14~) [!powerpc] | golang-1.14-go [!powerpc] | golang-1.10-go [!powerpc !riscv64],
313+>>>>>>> debian/control
314 libapt-pkg-dev,
315 po-debconf,
316 python3 (>= 3.4),
317diff --git a/debian/rules b/debian/rules
318index 9bea522..3ac2b02 100755
319--- a/debian/rules
320+++ b/debian/rules
321@@ -27,6 +27,10 @@ override_dh_auto_build:
322
323 override_dh_auto_test:
324 ifeq (,$(filter nocheck,$(DEB_BUILD_OPTIONS)))
325+<<<<<<< debian/rules
326+=======
327+ make -C apt-hook test
328+>>>>>>> debian/rules
329 python3 -m pytest
330 ifdef FLAKE8
331 # required for Trusty: flake8 does not install a __main__ for -m
332diff --git a/uaclient/tests/test_util.py b/uaclient/tests/test_util.py
333index 019faf2..cfba8c8 100644
334--- a/uaclient/tests/test_util.py
335+++ b/uaclient/tests/test_util.py
336@@ -291,11 +291,20 @@ class TestSubp:
337 with pytest.raises(util.ProcessExecutionError) as excinfo:
338 util.subp(["ls", "--bogus"])
339
340+<<<<<<< uaclient/tests/test_util.py
341 expected_error = (
342 "Failed running command 'ls --bogus' [exit(2)]."
343 " Message: ls: unrecognized option"
344 )
345 assert expected_error in str(excinfo.value)
346+=======
347+ expected_errors = [
348+ "Failed running command 'ls --bogus' [exit(2)].",
349+ "ls: unrecognized option '--bogus'",
350+ ]
351+ for msg in expected_errors:
352+ assert msg in str(excinfo.value)
353+>>>>>>> uaclient/tests/test_util.py
354 assert 0 == m_sleep.call_count # no retries
355
356 @mock.patch("uaclient.util.time.sleep")

Subscribers

People subscribed via source and target branches

to status/vote changes: