[Bug 1842508] Re: motd messaging changes regarding apt updates

Launchpad Bug Tracker 1842508 at bugs.launchpad.net
Tue Jan 5 19:25:17 UTC 2021


This bug was fixed in the package update-notifier - 3.192.1.9

---------------
update-notifier (3.192.1.9) bionic; urgency=medium

  * data/apt_check.py: Update UA Infra: ESM product name and doc url
    (LP: #1901627)
    - data/apt_check.py: Update name and URL
    - tests/test_motd.py: adapt unittests to match new behavior
    - po/*.po: translation files with intltool-update -r
  * Fix pep8/pyflakes autopkgtest failures (LP: #1906436)
    - d/control: add explicit pep8 build-requires dependency
    - test_motd.py: remove unused imports
    - pyflakes: data/backend_helper fix unittests for unreferenced
      variables
    - data/apt_check & data/backend_helper: resolve underindent pep8 issues
      backport of 9e0f7ee50 [ Brian Murray ]
    - data/apt_check.py, data/package-data-downloader, tests/test_pep8.py:
      + update the code formating to be not hit W504 warnings,
        change to ignore W503 and be consistent with update-manager.
        [ Andrea Azzarone ]
    - INSTALL, data/hooks.py, tests/test_package-data-downloader.py:
      Fix E117 over-indented pep issues. [ Gianfranco Costamagna ]
    - test_motd.py: Remove unused imports [ Julian Andres Klode ]
    - pyflakes: data/backend_helper fix unittests for unreferenced variables

update-notifier (3.192.1.8) bionic; urgency=medium

  [ Andreas Hasenack ]
  * data/apt_check.py: Update ESM security pockets names (LP: #1881632)
    - the UbuntuESM pocket was renamed from <distro>-security to
      <distro>-infra-security
    - new origin UbuntuESMApps, with a corresponding pocket of
      <distro>-apps-security

  [ Brian Murray ]
  * data/apt_check.py: modify wording and output regarding ESM support.
    (LP: #1842508)

  [ Julian Andres Klode ]
  * Handle missing cases of LP: #1822340, where we told people ESM is not
    enabled, but not how to enable it.
  * Fix multiple disabled ESM repositories being counted as enabled ones.

 -- Chad Smith <chad.smith at canonical.com>  Mon, 30 Nov 2020 14:25:35
-0700

-- 
You received this bug notification because you are a member of Ubuntu
Foundations Bugs, which is subscribed to update-notifier in Ubuntu.
https://bugs.launchpad.net/bugs/1842508

Title:
  motd messaging changes regarding apt updates

Status in update-notifier package in Ubuntu:
  Fix Released
Status in update-notifier source package in Trusty:
  Fix Released
Status in update-notifier source package in Xenial:
  Fix Released
Status in update-notifier source package in Bionic:
  Fix Released

Bug description:
  [Impact]
  Changes to wording regarding the ESM support available for Trusty. Additionally, reorder command output after UX review.

  [Test Case]
  test_motd.py has unit tests for all of the combinations of upgrade types possible. It's also possible to run "/usr/lib/update-notifier/apt-check --human-readable" on a system with ESM configured (enabled or disabled).
  #!/bin/bash

  #!/bin/bash
  #
  # SRU Verification update-notifier + ubuntu=advantage-tools
  # Test procedure:
  # - launch container Trusty, Xenial or Bionic
  # - Install ubuntu-advantage-tools from https://launchpad.net/~ua-client/+archive/ubuntu/proposed which supports esm on trusty, xenial, bionic, and focal
  # - Attach container to UA subscription (which activates the ESM APT repos
  # - run apt_check --human-readable to assert ESM pkg counts ARE NOT reported
  # - Upgrade update-notifier to -proposed
  # - re-run apt_check --human-readable to assert ESM pkg counts ARE reported

  set -e
  UA_TOKEN=$1
  if [ -z "$1" ]; then
   echo "Usage: $0 <contractTOKEN>"
   exit 1
  fi

  cat > test-un.yaml <<EOF
  #cloud-config
  ssh_import_id: [chad.smith]
  package_update: true
  package_upgrade: true
  apt:
    sources:
        ua.proposed:
            source: deb http://ppa.launchpad.net/ua-client/staging/ubuntu \$RELEASE main
            keyid: 6E34E7116C0BC933
  EOF

  cat > setup_proposed.sh <<EOF
  #/bin/bash
  mirror=http://archive.ubuntu.com/ubuntu
  echo deb \$mirror \$(lsb_release -sc)-proposed main | tee /etc/apt/sources.list.d/proposed.list
  apt-get update -q
  apt-get install -qy update-notifier-common
  EOF

  wait_for_boot() {
    local vm=$1 release=$2
    echo "--- Wait for cloud-init to finish"
    sleep 5
      lxc exec ${vm} -- cloud-init status --wait --long
  }

  for release in xenial bionic; do
    echo "--- BEGIN $release update-notifier testing"
    vm=test-sru-$release
    echo "--- Launch cloud-init with ppa:ua-client/proposed enabled"
    lxc launch ubuntu-daily:${release} ${vm} -c user.user-data="$(cat test-un.yaml)"
    wait_for_boot ${vm} ${release}
    echo "--- Attach Ubuntu-Advantage, enabling services"
    lxc exec ${vm} -- ua attach ${UA_TOKEN}
    case "$release" in
          xenial)
              UPGRADE_MATCH="0 updates are security updates";
              downrev_pkg="libkrad0=1.13.2+dfsg-5";;
          bionic)
              UPGRADE_MATCH="1 update is a security update"
              downrev_pkg="libkrad0=1.16-2build1";;
          focal)
              UPGRADE_MATCH="0 updates are security updates"
              downrev_pkg="hello=2.10-2ubuntu2";;
          groovy)
              UPGRADE_MATCH="1 of these updates is a security update"
              downrev_pkg="apport-retrace=2.20.11-0ubuntu50";;
    esac
    echo "-- Downgrading package to stable ubuntu release $downrev_pkg"
    lxc exec ${vm} -- apt-get install $downrev_pkg --yes -q
    lxc exec ${vm} -- dpkg-query --show update-notifier
    if [ "$release" = "xenial" ]; then
        # Xenial-updates have already included esm package updates.
        # Drop the xenial-updates apt source so we can be sure we are seeing only
        # available esm updates
        lxc exec ${vm} -- sed -e "/xenial-updates/ s/^#*/#/" -i /etc/apt/sources.list
        lxc exec ${vm} -- sed -e "/xenial-security/ s/^#*/#/" -i /etc/apt/sources.list
        lxc exec ${vm} -- apt-get update
    fi
    MOTD=`lxc exec ${vm} -- /usr/lib/update-notifier/apt-check --human-readable`
    echo ${MOTD}
    POST_UPGRADE_MSG="UA Infra: Extended Security Maintenance (ESM) is enabled"
    echo $MOTD | grep -q "${POST_UPGRADE_MSG}" && echo "FAILURE: found ${POST_UPGRADE_MSG}" ||  echo "SUCCESS: did not find ${POST_UPGRADE_MSG=}"
    echo $MOTD | grep -q "${UPGRADE_MATCH}" && echo "SUCCESS: found ${UPGRADE_MATCH} security updates pre-upgrade" || echo "FAILURE: did not find expected ${UPGRADE_MATCH} ESM security updates"
    echo "--- Upgrade update-notifier from -proposed"
    lxc file push setup_proposed.sh ${vm}/
    lxc exec ${vm} -- bash /setup_proposed.sh | grep update-notifier
    lxc exec ${vm} -- dpkg-query --show update-notifier
     MOTD=`lxc exec ${vm} -- /usr/lib/update-notifier/apt-check --human-readable`
    echo $MOTD | grep -q "${POST_UPGRADE_MSG}" && echo "SUCCESS: found ${POST_UPGRADE_MSG}" ||  echo "FAILURE: did not find ${POST_UPGRADE_MSG=}"
    echo "--- Expect non-zero upgradable packages for MOTD from apt_check AFTER upgrade"
    lxc exec ${vm} -- /usr/lib/update-notifier/apt-check --human-readable
    lxc exec ${vm} -- /usr/lib/update-notifier/apt-check --human-readable | grep '1 of these updates is a security update' && echo "SUCCESS: found 1 ESM security updates post-upgrade" || echo "FAILURE: did not find expected 1 ESM security updates post-upgrade"
  done

  [Regression Potential]
  Only strings are changing in this update and this could be considered a follow up SRU to bug 1822340 which created no issues.

  [Notice]
  This is only being SRU'ed to Ubuntu 14.04 (as with the previous SRU) as Ubuntu 16.04 and Ubuntu 18.04 will have some additional changes.

To manage notifications about this bug go to:
https://bugs.launchpad.net/ubuntu/+source/update-notifier/+bug/1842508/+subscriptions



More information about the foundations-bugs mailing list