Bionic, Focal, Groovy and Hirsute do not have powerpc arch build support, so we need only to ensure that packages build and contain the apt-esm-json-hook. Successful package build indicates proper conditional build logic for this SRU to include/exclude both go build of apt-esm-json-hook and go test runs of that hook
1. Running the following suceedslocally with sbuild emulating powerpc on Xenial
$ sbuild --resolve-alternatives --dist=xenial --arch=powerpc
[ATTACHED sbuild-xenial-powerpc.log]
3 & 4 ensure esm-apt-json-hook is included in amd64 arch builds and doesn't break `apt upgrade`:
$ cat sru-1927795.sh
#!/bin/bash
# Only LTS releases have ESM package ability so ignore Groovy/Hirsute
# Exercise apt JSON hook messaging to make sure hook messages show up.
for release in bionic focal; do
vm=test-1927795-${release}
lxc launch ubuntu-daily:${release} -c user.user-data="$(cat proposed-${release}.yaml)" ${vm}
sleep 4
lxc exec ${vm} -- cloud-init status --wait --long
lxc exec ${vm} -- ua version
lxc exec ${vm} -- ua attach ${TOKEN}
lxc exec ${vm} -- dpkg -L ubuntu-advantage-tools | grep hook
lxc exec ${vm} -- python3 /usr/lib/ubuntu-advantage/ua_update_messaging.py
lxc exec ${vm} -- apt upgrade # confirm no exit 1 failures due to broken apt JSON hook
done
$ TOKEN=<REDACTED> ./sru-1927795.sh
Creating test-1927795-bionic
Starting test-1927795-bionic
......................................................................
status: done
time: Wed, 12 May 2021 21:10:06 +0000
detail:
DataSourceNoCloud [seed=/var/lib/cloud/seed/nocloud-net][dsmode=net]
27.0.2~18.04.1
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
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 Canonical Livepatch service
NOTICES
Operation in progress: ua attach
Enable services with: ua enable <service>
Account: Subscription: UA Applications - Essential (Physical)
Valid until: 3999-12-31 00:00:00
Technical support level: essential
/etc/apt/apt.conf.d/20apt-esm-hook.conf
/usr/lib/ubuntu-advantage/apt-esm-hook
/usr/lib/ubuntu-advantage/apt-esm-json-hook
Reading package lists... Done
Building dependency tree
Reading state information... Done
Calculating upgrade... Done
The following package was automatically installed and is no longer required:
libfreetype6
Use 'apt autoremove' to remove it.
The following packages will be upgraded:
initramfs-tools initramfs-tools-bin initramfs-tools-core krb5-locales
libgssapi-krb5-2 libk5crypto3 libkrb5-3 libkrb5support0 libparted2
linux-base login openssh-client openssh-server openssh-sftp-server parted
passwd python-apt-common python3-apt snapd uidmap
20 upgraded, 0 newly installed, 0 to remove and 0 not upgraded.
Need to get 25.8 MB of archives.
After this operation, 5932 kB of additional disk space will be used.
Do you want to continue? [Y/n] n
Abort.
Creating test-1927795-focal
Starting test-1927795-focal
...................................................................................................
status: done
time: Wed, 12 May 2021 21:10:56 +0000
detail:
DataSourceNoCloud [seed=/var/lib/cloud/seed/nocloud-net][dsmode=net]
27.0.2~20.04.1
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
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 Canonical Livepatch service
NOTICES
Operation in progress: ua attach
Enable services with: ua enable <service>
Account: Subscription: UA Applications - Essential (Physical)
Valid until: 3999-12-31 00:00:00
Technical support level: essential
/etc/apt/apt.conf.d/20apt-esm-hook.conf
/usr/lib/ubuntu-advantage/apt-esm-hook
/usr/lib/ubuntu-advantage/apt-esm-json-hook
Reading package lists... Done
Building dependency tree
Reading state information... Done
Calculating upgrade... Done
The following package was automatically installed and is no longer required:
libfreetype6
Use 'apt autoremove' to remove it.
The following packages will be upgraded:
initramfs-tools initramfs-tools-bin initramfs-tools-core libgnutls30
libnetplan0 libssl1.1 linux-base netplan.io open-vm-tools openssl
python-apt-common python3-apt python3-software-properties secureboot-db
snapd software-properties-common
16 upgraded, 0 newly installed, 0 to remove and 0 not upgraded.
Need to get 34.4 MB of archives.
After this operation, 7994 kB of additional disk space will be used.
Do you want to continue? [Y/n] n
Abort.
Bionic, Focal, Groovy and Hirsute do not have powerpc arch build support, so we need only to ensure that packages build and contain the apt-esm-json-hook. Successful package build indicates proper conditional build logic for this SRU to include/exclude both go build of apt-esm-json-hook and go test runs of that hook
1. Running the following suceedslocally with sbuild emulating powerpc on Xenial alternatives --dist=xenial --arch=powerpc xenial- powerpc. log]
$ sbuild --resolve-
[ATTACHED sbuild-
2. Upload to ppa:ua- client/ staging succeeded with Xenial builds at /launchpad. net/~ua- client/ +archive/ ubuntu/ staging/ +packages
https:/
3 & 4 ensure esm-apt-json-hook is included in amd64 arch builds and doesn't break `apt upgrade`:
$ cat sru-1927795.sh
#!/bin/bash
# Only LTS releases have ESM package ability so ignore Groovy/Hirsute
# Exercise apt JSON hook messaging to make sure hook messages show up.
cat > proposed- bionic. yaml <<EOF hcmNoaXZlLnVidW 50dS5jb20vdWJ1b nR1LyBiaW9uaWMt cHJvcG9zZWQgcmV zdHJpY3RlZCBtYW luIG11bHRpdmVyc 2UgdW5pdmVyc2UK sources. list.d/ proposed- ua.list
#cloud-config
write_files:
- content: ZGViIGh0dHA6Ly9
encoding: b64
owner: root:root
path: /etc/apt/
permissions: '0644'
package_update: true advantage- tools]
packages: [ubuntu-
EOF
cat > proposed-focal.yaml <<EOF hcmNoaXZlLnVidW 50dS5jb20vdWJ1b nR1LyBmb2NhbC1w cm9wb3NlZCByZXN 0cmljdGVkIG1haW 4gbXVsdGl2ZXJzZ SB1bml2ZXJzZQo= sources. list.d/ proposed- ua.list advantage- tools]
#cloud-config
write_files:
- content: ZGViIGh0dHA6Ly9
encoding: b64
owner: root:root
path: /etc/apt/
permissions: '0644'
package_update: true
packages: [ubuntu-
EOF
for release in bionic focal; do 1927795- ${release} daily:$ {release} -c user.user- data="$ (cat proposed- ${release} .yaml)" ${vm} advantage- tools | grep hook ubuntu- advantage/ ua_update_ messaging. py
vm=test-
lxc launch ubuntu-
sleep 4
lxc exec ${vm} -- cloud-init status --wait --long
lxc exec ${vm} -- ua version
lxc exec ${vm} -- ua attach ${TOKEN}
lxc exec ${vm} -- dpkg -L ubuntu-
lxc exec ${vm} -- python3 /usr/lib/
lxc exec ${vm} -- apt upgrade # confirm no exit 1 failures due to broken apt JSON hook
done
$ TOKEN=<REDACTED> ./sru-1927795.sh ....... ....... ....... ....... ....... ....... ....... ....... ....... var/lib/ cloud/seed/ nocloud- net][dsmode= net]
Creating test-1927795-bionic
Starting test-1927795-bionic
.......
status: done
time: Wed, 12 May 2021 21:10:06 +0000
detail:
DataSourceNoCloud [seed=/
27.0.2~18.04.1
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
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 Canonical Livepatch service
NOTICES
Operation in progress: ua attach
Enable services with: ua enable <service>
Valid until: 3999-12-31 00:00:00
Technical support level: essential
/etc/apt/
/usr/lib/
/usr/lib/
Reading package lists... Done
Building dependency tree
Reading state information... Done
Calculating upgrade... Done
The following package was automatically installed and is no longer required:
libfreetype6
Use 'apt autoremove' to remove it.
The following packages will be upgraded:
initramfs-tools initramfs-tools-bin initramfs-
libgssapi-krb5-2 libk5crypto3 libkrb5-3 libkrb5support0 libparted2
linux-base login openssh-client openssh-server openssh-sftp-server parted
passwd python-apt-common python3-apt snapd uidmap
20 upgraded, 0 newly installed, 0 to remove and 0 not upgraded.
Need to get 25.8 MB of archives.
After this operation, 5932 kB of additional disk space will be used.
Do you want to continue? [Y/n] n
Abort.
Creating test-1927795-focal
Starting test-1927795-focal
.......
status: done
time: Wed, 12 May 2021 21:10:56 +0000
detail:
DataSourceNoCloud [seed=/
27.0.2~20.04.1
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
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 Canonical Livepatch service
NOTICES
Operation in progress: ua attach
Enable services with: ua enable <service>
Valid until: 3999-12-31 00:00:00
Technical support level: essential
/etc/apt/
/usr/lib/
/usr/lib/
Reading package lists... Done
Building dependency tree
Reading state information... Done
Calculating upgrade... Done
The following package was automatically installed and is no longer required:
libfreetype6
Use 'apt autoremove' to remove it.
The following packages will be upgraded:
initramfs-tools initramfs-tools-bin initramfs-
libnetplan0 libssl1.1 linux-base netplan.io open-vm-tools openssl
python-apt-common python3-apt python3-
snapd software-
16 upgraded, 0 newly installed, 0 to remove and 0 not upgraded.
Need to get 34.4 MB of archives.
After this operation, 7994 kB of additional disk space will be used.
Do you want to continue? [Y/n] n
Abort.