Comment 12 for bug 2006705

Revision history for this message
Lucas Albuquerque Medeiros de Moura (lamoura) wrote :

Yes, excellent point. I am now providing manual test for all of the other releases:

-----------------------------

#!/bin/bash
set -e

series=$1

name=$series-test

function cleanup {
  lxc delete $name --force
}

function on_err {
  echo -e "Test Failed"
  cleanup
  exit 1
}

trap on_err ERR

if [ $series == "xenial" ]; then
    security_id="CVE-2020-26262"
elif [ $series == "focal" ]; then
    security_id="USN-4539-1"
elif [ $series == "jammy" ]; then
    security_id="CVE-2023-1326"
elif [ $series == "kinetic" ]; then
    security_id="CVE-2023-1326"
fi

function upgrade_to_proposed {
    echo -e "\n-------------------------------------------"
    echo "** upgrading to 27.14.4 from proposed"
    echo "-------------------------------------------"
    lxc exec $name -- sh -c "echo \"deb http://archive.ubuntu.com/ubuntu $series-proposed main\" | tee /etc/apt/sources.list.d/proposed.list"
    lxc exec $name -- apt-get update > /dev/null
    lxc exec $name -- apt-get install ubuntu-advantage-tools -y
    lxc exec $name -- apt-cache policy ubuntu-advantage-tools
    echo "-------------------------------------------"
}

function set_up_env {
    echo -e "\n-------------------------------------------"
    echo "** Setting up environment for $series machine"
    echo "-------------------------------------------"
    if [ $series == "xenial" ]; then
        lxc exec $name -- apt-get install -y coturn=4.5.0.3-1build1 > /dev/null
    elif [ $series == "focal" ]; then
        lxc exec $name -- apt-get install -y libawl-php=0.60-1 > /dev/null
    elif [ $series == "jammy" ]; then
        lxc exec $name -- apt-get install -y apport=2.20.11-0ubuntu82.3 > /dev/null
    elif [ $series == "kinetic" ]; then
        lxc exec $name -- apt-get install -y apport=2.23.1-0ubuntu3.1 > /dev/null
    fi
    echo "-------------------------------------------"
}

lxc launch ubuntu-daily:$series $name
sleep 5
upgrade_to_proposed
set_up_env

echo -e "\n-------------------------------------------"
echo "** Verify pro fix command cannot install the update"
lxc exec $name -- sed -i "/$series-updates/d" /etc/apt/sources.list
lxc exec $name -- sed -i "/$series-security/d" /etc/apt/sources.list
lxc exec $name -- rm /etc/apt/sources.list.d/proposed.list

lxc exec $name -- apt-get update > /dev/null
lxc exec $name -- sh -c "pro fix $security_id || true"
echo "-------------------------------------------"

cleanup

---------------------------------