981
981
@skipUnless(TEST_CUSTOM_IMAGES, "Not testing custom images")
982
982
def test_set_custom_boot_source(self):
983
# Get the keyring file from the custom image server
984
os.environ['http_proxy'] = HTTP_PROXY
985
keyring_filename = "/etc/maas/maas-crew.gpg"
987
"wget", "http://10.55.32.203/maas-crew.gpg",
988
"-O", keyring_filename
990
# Update permissions so MAAS accepts it
991
with open(keyring_filename, 'wb') as gpgkey:
992
os.fchown(gpgkey.fileno(), 0, pwd.getpwnam('maas').pw_uid)
993
os.fchmod(gpgkey.fileno(), 0o644)
994
boot_source_url = "http://10.55.32.203/proposed"
995
# The more correct way of doing this is to delete the existing
996
# boot source and create a new one, but this requires re-instating
997
# the boot source selections
998
pause_until_released('custom boot')
983
boot_source_url = "http://10.55.32.203/proposed/streams/v1/index.json"
999
984
output, _ = self._run_maas_cli([
1000
985
"boot-source", "update", "1",
1001
"url=" + boot_source_url,
1002
"keyring_filename=" + keyring_filename,
986
"url=" + boot_source_url),
1004
988
boot_source = loads(output)
1005
989
self.assertThat(boot_source['url'], Equals(boot_source_url))