I have modified the test script to install the package in proposed:
----------------------------------------------------------------------
import pycloudlib
import os
print("--- Creating base instance")
print("ip address: ", instance.ip)
print("--- Make cloud-id command fail by changing the binary")
cloud_id = instance.execute("cloud-id")
print(cloud_id.stderr)
print("--- Running postinst script for current version of uaclient")
dpkg_out = instance.execute("sudo dpkg-reconfigure ubuntu-advantage-tools")
print(instance.execute("ua version"))
print(dpkg_out.stderr)
print("------------------")
I have modified the test script to install the package in proposed: ------- ------- ------- ------- ------- ------- ------- ------- -------
-------
import pycloudlib
import os
lxd = pycloudlib. LXDVirtualMachi ne("vm" )
name = 'pycloudlib-vm'
release = "hirsute"
pub_key_path = "lxd-pubkey"
priv_key_path = "lxd-privkey"
userdata_ cloud_id_ fail = """\ cloud-id. orig
#cloud-config
bootcmd:
- cp /usr/bin/cloud-id /usr/bin/
- 'echo "error" > /usr/bin/cloud-id'
- chmod 755 /usr/bin/cloud-id
"""
pub_key, priv_key = lxd.create_ key_pair( )
with open(pub_key_path, "w") as f: pub_key)
f.write(
with open(priv_key_path, "w") as f: priv_key)
f.write(
lxd.use_key( key_path= pub_key_ path, key_path= priv_key_ path
public_
private_
)
image_id = lxd.released_ image(release= release) id=image_ id, data=userdata_ cloud_id_ fail
instance = lxd.launch(
name=name,
image_
user_
)
print("--- Creating base instance") execute( "cloud- id") id.stderr) execute( "sudo dpkg-reconfigure ubuntu- advantage- tools") execute( "ua version")) out.stderr) ------- ------- ----")
print("ip address: ", instance.ip)
print("--- Make cloud-id command fail by changing the binary")
cloud_id = instance.
print(cloud_
print("--- Running postinst script for current version of uaclient")
dpkg_out = instance.
print(instance.
print(dpkg_
print("
cmd = "sudo sh -c \"echo 'deb http:// archive. ubuntu. com/ubuntu/ {}-proposed restricted main multiverse universe' >> /etc/apt/ sources. list.d/ proposed- repositories. list\"" execute( cmd.format( release) ) execute( "sh -c 'sudo apt-get update -q > /dev/null'") execute( "sh -c 'sudo apt-get install ubuntu- advantage- tools > /dev/null'") execute( "ua version")) execute( "sudo dpkg-reconfigure ubuntu- advantage- tools") out.stderr) ------- ------- ----") ------- ------- ------- ------- ------- --
print("--- Updating ua package")
out = instance.
instance.
instance.
print(instance.
dpkg_out = instance.
print(dpkg_
print("
instance.delete()
-------
Currently, pycloudlib doesn't support launching hirsute or impish vms
Therefore, the test results here are for xenial, bionic and focal.
I will run this test for hirsute and impish through multipass.
PS: this bug should not affect xenial releases