Skip to content

Commit

Permalink
wip
Browse files Browse the repository at this point in the history
  • Loading branch information
orndorffgrant committed Feb 21, 2024
1 parent 1991e7c commit dd615e3
Showing 1 changed file with 35 additions and 4 deletions.
39 changes: 35 additions & 4 deletions sru/release-31/binary-package-renames-install-upc.sh
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,10 @@ set -e

series=$1
install_from=$2 # 'staging', or 'proposed', or the name of a ppa
version=$3

name=$series-test
specify_proposed=""

function cleanup {
lxc delete $name --force
Expand All @@ -24,7 +26,7 @@ sleep 5
# Install latest ubuntu-advantage-tools
lxc exec $name -- apt-get update > /dev/null
lxc exec $name -- apt-get install -y ubuntu-advantage-tools > /dev/null
echo -e "\n* Latest u-a-t is installed"
echo -e "\n* Latest u-a-t is installed from -updates"
echo "###########################################"
lxc exec $name -- apt-cache policy ubuntu-advantage-tools
echo -e "###########################################\n"
Expand All @@ -37,6 +39,7 @@ if [ $install_from == 'staging' ]; then
elif [ $install_from == 'proposed' ]; then
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
specify_proposed="/$series-proposed"
else
lxc exec $name -- sudo add-apt-repository $install_from -y > /dev/null
lxc exec $name -- apt-get update > /dev/null
Expand All @@ -49,11 +52,20 @@ echo "###########################################"
lxc exec $name -- pro attach $UACLIENT_BEHAVE_CONTRACT_TOKEN
echo -e "###########################################\n"

echo -e "\n* upgrade to rename"
echo "###########################################"
set -x
# lxc exec $name -- apt install ubuntu-advantage-tools/$series-proposed -y
# lxc exec $name -- apt install ubuntu-pro-client/$series-proposed -y
# lxc exec $name -- apt install ubuntu-pro-client/$series-proposed=$version -y
lxc exec $name -- apt install ubuntu-pro-client${specify_proposed}=$version -y
set +x
echo -e "###########################################\n"

echo -e "\n* installing only ubuntu-pro-client brings ubuntu-advantage-tools too"
echo -e "\n* autoremove just to make sure it doesn't do anything unexpected"
echo "###########################################"
set -x
lxc exec $name -- apt-get install ubuntu-pro-client -y || true
lxc exec $name -- apt autoremove -y
set +x
echo -e "###########################################\n"

Expand All @@ -65,7 +77,26 @@ echo -e "###########################################\n"
echo -e "\n* appropriate versions of ubuntu-advantage-tools and ubuntu-pro-client are installed"
echo "###########################################"
lxc exec $name -- apt policy ubuntu-advantage-tools ubuntu-pro-client
lxc exec $name -- apt show ubuntu-pro-client
echo -e "###########################################\n"

if [ "$series" != "xenial" ] && [ "$series" != "bionic" ]; then
echo -e "\n* reinstall just to make sure it doesn't do anything unexpected"
echo "###########################################"
set -x
lxc exec $name -- apt reinstall ubuntu-advantage-tools
lxc exec $name -- apt reinstall ubuntu-pro-client
set +x
echo -e "###########################################\n"

echo -e "\n* still attached"
echo "###########################################"
lxc exec $name -- pro status
echo -e "###########################################\n"

echo -e "\n* appropriate versions of ubuntu-advantage-tools and ubuntu-pro-client are installed"
echo "###########################################"
lxc exec $name -- apt policy ubuntu-advantage-tools ubuntu-pro-client
echo -e "###########################################\n"
fi

cleanup

0 comments on commit dd615e3

Please sign in to comment.