Comment 5 for bug 1927886

Revision history for this message
Chad Smith (chad.smith) wrote :

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]

2. Upload to ppa:ua-client/staging succeeded with Xenial builds at
https://launchpad.net/~ua-client/+archive/ubuntu/staging/+packages

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
#cloud-config
write_files:
- content: ZGViIGh0dHA6Ly9hcmNoaXZlLnVidW50dS5jb20vdWJ1bnR1LyBiaW9uaWMtcHJvcG9zZWQgcmVzdHJpY3RlZCBtYWluIG11bHRpdmVyc2UgdW5pdmVyc2UK
  encoding: b64
  owner: root:root
  path: /etc/apt/sources.list.d/proposed-ua.list
  permissions: '0644'

package_update: true
packages: [ubuntu-advantage-tools]
EOF

cat > proposed-focal.yaml <<EOF
#cloud-config
write_files:
- content: ZGViIGh0dHA6Ly9hcmNoaXZlLnVidW50dS5jb20vdWJ1bnR1LyBmb2NhbC1wcm9wb3NlZCByZXN0cmljdGVkIG1haW4gbXVsdGl2ZXJzZSB1bml2ZXJzZQo=
  encoding: b64
  owner: root:root
  path: /etc/apt/sources.list.d/proposed-ua.list
  permissions: '0644'
package_update: true
packages: [ubuntu-advantage-tools]
EOF

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.