Comment 1 for bug 1233486

Revision history for this message
Scott Moser (smoser) wrote : Re: add support for 'cloud-archive:' like 'ppa:' but for cloud archive

I've just pushed to trunk, and uploaded to ubuntu saucy.

I've tested this like the following:
#fresh launch of saucy instance

sudo apt-get update --quiet
sudo apt-get install --assume-yes --quiet lxc
r=saucy
sudo lxc-create -n source-$r-amd64 -t ubuntu-cloud -- --release=$r --arch=amd64;

sudo lxc-clone --snapshot -B overlayfs -o source-$r-amd64 -n test1-$r; done

# inside
TEST_PPA="ppa:ubuntu-server-ec2-testing-dev/testing"

# add the ppa to get new version
sudo apt-add-repository -y ppa:smoser
sudo apt-get update -qy
sudo apt-get install -qy software-properties-common

# verify you're prompted for adding a ppa
# you should see a message with info about the ppa. hit ctrl-c.
# expect it is cancelled
sudo apt-add-repository $TEST_PPA

# add again, this time saying 'yes'
sudo apt-add-repository $TEST_PPA
sudo apt-get update
sudo apt-get install smello
sudo apt-get --purge remove smello

sudo apt-add-repository --remove $TEST_PPA
sudo apt-get update
# look for 'smello' (to verify archive removed)
# this should fail with 'Unable to locate package smello'
apt-cache policy smello

## verify '-y' works.
sudo apt-add-repository -y $TEST_PPA
sudo apt-get update

## verify cloud-archive: things work

# because this is saucy, and cloud archive not supported on saucy
# this should fail. Answer 'y' and then it should fail with
# a message
sudo apt-add-repository cloud-archive:havana

# override with CA_ALLOW_CODENAME
sudo CA_ALLOW_CODENAME=$(lsb_release -sc) apt-add-repository cloud-archive:havana
## This should fail, as the pocket added would be
## saucy-updates/havana which wont exist (precise-updates/havana)
sudo apt-get update

## fix that, and make sure update works. apt-get update should succeed
## with out any problems
sudo sed -i 's,saucy,precise,g' /etc/apt/sources.list.d/cloudarchive-havana.list
sudo apt-get update

## also you should now have the ubuntu-cloud-keyring package installed
dpkg-query --show ubuntu-cloud-keyring

## cleanup outside
sudo lxc-destroy -n test1-saucy