For this SRU bug I have created the following test script:
-----------------------------------
#!/bin/sh
set -x
series=hirsute
name=$series-dev
function update-notifier-ua-not-installed () {
# Expects this output
# x packages can be updated.
# x of these updates are security updates.
echo "-----------------------------------------------------------"
echo "$series: ua not installed"
lxc exec $name -- /usr/lib/update-notifier/apt-check --human-readable
echo "-----------------------------------------------------------"
}
function update-notifier-ua-not-attached-esm () {
# x updates can be installed immediately.
# x of these updates are security updates.
#
# Enable UA Apps: ESM to receive x additional security updates.
# See https://ubuntu.com/security/esm or run: sudo ua status
echo "-----------------------------------------------------------"
echo "$series esm: ua not attached"
lxc exec $name -- /usr/lib/update-notifier/apt-check --human-readable
echo "-----------------------------------------------------------"
}
function update-notifier-ua-not-attached () {
# Expects this output
# UA Infra: Extended Security Maintenance (ESM) is not enabled.
#
# x updates can be installed immediately.
# x of these updates are security updates.
echo "-----------------------------------------------------------"
echo "$series non-esm: ua not attached"
lxc exec $name -- /usr/lib/update-notifier/apt-check --human-readable
echo "-----------------------------------------------------------"
}
function update-notifier-ua-attached-esm () {
# Expects this output
# x updates can be installed immediately.
# x of these updates are fixed through UA Apps: ESM.
# x of these updates are security updates.
# To see these additional updates run: apt list --upgradable
echo "-----------------------------------------------------------"
echo "$series esm: ua attached"
lxc exec $name -- /usr/lib/update-notifier/apt-check --human-readable
echo "-----------------------------------------------------------"
}
function update-notifier-ua-attached () {
# Expects this output
# x updates can be installed immediately.
# x of these updates are fixed through UA Apps: ESM.
# x of these updates are security updates.
# To see these additional updates run: apt list --upgradable
echo "-----------------------------------------------------------"
echo "$series non-esm: ua attached"
lxc exec $name -- /usr/lib/update-notifier/apt-check --human-readable
echo "-----------------------------------------------------------"
}
function turn-distro-into-esm-mode() {
# guarantee that xenial distro is on ESM mode
lxc exec $name -- sed -i 's/is_esm_supported and is_not_currently_supported/True #comment/' /usr/lib/update-notifier/apt-check
}
function turn-distro-into-non-esm-mode() {
# guarantee that xenial distro is on ESM mode
lxc exec $name -- sed -i 's/True #comment/False/' /usr/lib/update-notifier/apt-check
}
For this SRU bug I have created the following test script:
------- ------- ------- ------- -------
#!/bin/sh
set -x
series=hirsute
name=$series-dev
function update- notifier- ua-not- installed () { ------- ------- ------- ------- ------- ------- ------- ----" update- notifier/ apt-check --human-readable ------- ------- ------- ------- ------- ------- ------- ----"
# Expects this output
# x packages can be updated.
# x of these updates are security updates.
echo "------
echo "$series: ua not installed"
lxc exec $name -- /usr/lib/
echo "------
}
function update- notifier- ua-not- attached- esm () { /ubuntu. com/security/ esm or run: sudo ua status ------- ------- ------- ------- ------- ------- ------- ----" update- notifier/ apt-check --human-readable ------- ------- ------- ------- ------- ------- ------- ----"
# x updates can be installed immediately.
# x of these updates are security updates.
#
# Enable UA Apps: ESM to receive x additional security updates.
# See https:/
echo "------
echo "$series esm: ua not attached"
lxc exec $name -- /usr/lib/
echo "------
}
function update- notifier- ua-not- attached () { ------- ------- ------- ------- ------- ------- ------- ----" update- notifier/ apt-check --human-readable ------- ------- ------- ------- ------- ------- ------- ----"
# Expects this output
# UA Infra: Extended Security Maintenance (ESM) is not enabled.
#
# x updates can be installed immediately.
# x of these updates are security updates.
echo "------
echo "$series non-esm: ua not attached"
lxc exec $name -- /usr/lib/
echo "------
}
function update- notifier- ua-attached- esm () { ------- ------- ------- ------- ------- ------- ------- ----" update- notifier/ apt-check --human-readable ------- ------- ------- ------- ------- ------- ------- ----"
# Expects this output
# x updates can be installed immediately.
# x of these updates are fixed through UA Apps: ESM.
# x of these updates are security updates.
# To see these additional updates run: apt list --upgradable
echo "------
echo "$series esm: ua attached"
lxc exec $name -- /usr/lib/
echo "------
}
function update- notifier- ua-attached () { ------- ------- ------- ------- ------- ------- ------- ----" update- notifier/ apt-check --human-readable ------- ------- ------- ------- ------- ------- ------- ----"
# Expects this output
# x updates can be installed immediately.
# x of these updates are fixed through UA Apps: ESM.
# x of these updates are security updates.
# To see these additional updates run: apt list --upgradable
echo "------
echo "$series non-esm: ua attached"
lxc exec $name -- /usr/lib/
echo "------
}
function turn-distro- into-esm- mode() { currently_ supported/ True #comment/' /usr/lib/ update- notifier/ apt-check
# guarantee that xenial distro is on ESM mode
lxc exec $name -- sed -i 's/is_esm_supported and is_not_
}
function turn-distro- into-non- esm-mode( ) { update- notifier/ apt-check
# guarantee that xenial distro is on ESM mode
lxc exec $name -- sed -i 's/True #comment/False/' /usr/lib/
}
function setup-update- notifier( ) { update- notifier- test-ppa -y notifier- common -y
lxc exec $name -- add-apt-repository ppa:lamoura/
lxc exec $name -- apt update
lxc exec $name -- apt install update-
}
function install-ua() { advantage- tools -y
lxc exec $name -- add-apt-repository ppa:ua-client/daily -y
lxc exec $name -- sudo apt-get update
lxc exec $name -- sudo apt-get install ubuntu-
lxc exec $name -- ua version
lxc exec $name -- sudo apt-get update
}
function ua-attach() { can/contracts. staging. can/' /etc/ubuntu- advantage/ uaclient. conf BEHAVE_ CONTRACT_ TOKEN_STAGING
lxc exec $name -- sed -i 's/contracts.
lxc exec $name -- ua attach $UACLIENT_
}
function ua-detach() {
lxc exec $name -- ua detach --assume-yes
}
lxc delete --force $name daily:$ series $name
lxc launch ubuntu-
sleep 10
setup-update- notifier notifier- ua-not- installed into-esm- mode notifier- ua-not- attached- esm notifier- ua-attached- esm into-non- esm-mode notifier- ua-not- attached notifier- ua-attached
update-
install-ua
turn-distro-
update-
ua-attach
update-
turn-distro-
ua-detach
update-
ua-attach
update-
set +x ------- ------- ------- ------- -
-------
I have used it to verify the behavior of the updated package on xenial and hirsute. The packages used to perform such testing are found on this ppa: /launchpad. net/~lamoura/ +archive/ ubuntu/ update- notifier- test-ppa
https:/