~andreserl/maas/qa-lab-tests_user_data_comp

« back to all changes in this revision

Viewing changes to maas-integration.py

  • Committer: Andres Rodriguez
  • Date: 2016-07-27 19:32:04 UTC
  • mfrom: (440.1.6 qa-lab-tests)
  • Revision ID: andreserl@ubuntu.com-20160727193204-z7v50jkg8nbowmvy
Add test to update the Main Archive

Show diffs side-by-side

added added

removed removed

Lines of Context:
105
105
    LAB_DNS_CONFIG,
106
106
    LENOVO_LAB,
107
107
    MAAS_URL,
 
108
    MAIN_ARCHIVE,
108
109
    NODE_SERIES,
109
110
    PASSWORD,
110
111
    POWER_PASS,
183
184
    "test_update_preseed_arm",
184
185
    "test_login_api",
185
186
    "test_maas_logged_in",
 
187
    "test_set_main_archive",
186
188
    "test_set_http_proxy",
187
189
    "test_region_rack_connected",
188
190
    # From this point on, we can connect to the external world.
569
571
        self.assertEqual(0, retcode)
570
572
        self.assertEqual('', err)
571
573
 
 
574
    def test_set_main_archive(self):
 
575
        output, err = self._run_maas_cli([
 
576
            "maas", "set-config", "name=main_archive",
 
577
            "value=%s" % MAIN_ARCHIVE])
 
578
        self.assertThat(output, Contains("OK"))
 
579
        output, err = self._run_maas_cli([
 
580
            "maas", "get-config", "name=main_archive"])
 
581
        self.assertThat(output, Contains(MAIN_ARCHIVE))
 
582
 
 
583
        # Check that the user-data passed on to nodes have the proxy address.
 
584
        output = urlopen(USER_DATA_URL).read().decode('utf-8')
 
585
        self.assertThat(output, Contains(
 
586
            "primary: %s" % MAIN_ARCHIVE))
 
587
 
572
588
    def test_set_http_proxy(self):
573
589
        output, err = self._run_maas_cli([
574
590
            "maas", "set-config", "name=http_proxy",