~brendan-donegan/maas/fix_juju_bootstrap

« back to all changes in this revision

Viewing changes to maas-integration.py

  • Committer: Brendan Donegan
  • Date: 2016-10-11 20:19:50 UTC
  • mfrom: (451.2.18 custom_boot_source)
  • Revision ID: brendan.donegan@canonical.com-20161011201950-i2284fhk83n7vsbi
Merge correct revision of lp:~brendan-donegan/maas/qa-lab-tests_custom_boot_source

Show diffs side-by-side

added added

removed removed

Lines of Context:
980
980
 
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"
986
 
        run_command([
987
 
            "wget", "http://10.55.32.203/maas-crew.gpg",
988
 
            "-O", keyring_filename
989
 
        ], env=os.environ)
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),
1003
987
        ])
1004
988
        boot_source = loads(output)
1005
989
        self.assertThat(boot_source['url'], Equals(boot_source_url))