Skip to content

Commit

Permalink
wip: manual test for upgrade to renamed package
Browse files Browse the repository at this point in the history
  • Loading branch information
orndorffgrant committed Dec 15, 2023
1 parent 0f5d0a8 commit ed8ac84
Showing 1 changed file with 71 additions and 0 deletions.
71 changes: 71 additions & 0 deletions sru/release-31/binary-package-renames-install-upc.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,71 @@
#!/bin/bash
set -e

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

name=$series-test

function cleanup {
lxc delete $name --force
}

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


lxc launch ubuntu-daily:$series $name
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 "###########################################"
lxc exec $name -- apt-cache policy ubuntu-advantage-tools
echo -e "###########################################\n"

# Set up source for installing new version
# ----------------------------------------------------------------
if [ $install_from == 'staging' ]; then
lxc exec $name -- sudo add-apt-repository ppa:ua-client/staging -y > /dev/null
lxc exec $name -- apt-get update > /dev/null
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
else
lxc exec $name -- sudo add-apt-repository $install_from -y > /dev/null
lxc exec $name -- apt-get update > /dev/null
fi
# ----------------------------------------------------------------


echo -e "\n* attach prior to upgrade"
echo "###########################################"
lxc exec $name -- pro attach $UACLIENT_BEHAVE_CONTRACT_TOKEN
echo -e "###########################################\n"


echo -e "\n* installing only ubuntu-pro-client brings ubuntu-advantage-tools too"
echo "###########################################"
set -x
lxc exec $name -- apt-get install ubuntu-pro-client -y || true
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
lxc exec $name -- apt show ubuntu-pro-client
echo -e "###########################################\n"

cleanup

0 comments on commit ed8ac84

Please sign in to comment.