~andreserl/maas/qa-lab-tests-django16

« back to all changes in this revision

Viewing changes to maas-integration.py

  • Committer: MAAS Lander
  • Author(s): Gavin Panella
  • Date: 2015-06-24 15:40:40 UTC
  • mfrom: (271.1.3 qa-lab-tests.regiond-conf)
  • Revision ID: maas_lander-20150624154040-vvu8nqrfullqo407
[r=rvb][bug=][author=allenap] Use `maas-region-admin local_config_set ...` where available.

Show diffs side-by-side

added added

removed removed

Lines of Context:
232
232
tests_order = [
233
233
    "test_create_admin",
234
234
    "test_restart_dbus_avahi",
 
235
    "test_update_maas_url_old",
235
236
    "test_update_maas_url",
236
237
    "test_restart_provisioning_server",
237
238
    "test_check_initial_services",
338
339
        expected_output = 'avahi-daemon start/running'
339
340
        assertCommandReturnCode(self, cmd, expected_output)
340
341
 
341
 
    def test_update_maas_url(self):
 
342
    @unittest.skipIf(
 
343
        get_maas_revision() >= 3839,  # TODO: Update revision after landing.
 
344
        "maas_local_settings.py is not used anymore")
 
345
    def test_update_maas_url_old(self):
342
346
        # XXX: matsubara For some reason using a debconf file to set the
343
347
        # initial value of DEFAULT_MAAS_URL is not working.
344
348
        maas_fd = open("/etc/maas/maas_local_settings.py", "r+")
360
364
        else:
361
365
            self.fail("apache2 cannot be restarted")
362
366
 
 
367
    @unittest.skipIf(
 
368
        get_maas_revision() < 3839,  # TODO: Update revision after landing.
 
369
        "local_config_set was not available")
 
370
    def test_update_maas_url(self):
 
371
        # XXX: allenap: Using a debconf file to set the initial value of the
 
372
        # MAAS URL should not work; see test_update_maas_url_old(), but I'm
 
373
        # not sure if that's true.
 
374
        cmd = [
 
375
            "maas-region-admin", "local_config_set", "--maas-url",
 
376
            "http://10.245.136.6/MAAS",
 
377
        ]
 
378
        assertCommandReturnCode(self, cmd, "")
 
379
        # Restart apache2.
 
380
        cmd = ["service", "apache2", "restart"]
 
381
        for retry in retries(delay=10, timeout=60):
 
382
            retcode, output, err = run_command(cmd)
 
383
            if retcode == 0:
 
384
                break
 
385
        else:
 
386
            self.fail("apache2 cannot be restarted")
 
387
 
363
388
    def test_restart_provisioning_server(self):
364
389
        # Restart the provisioning server as MAAS is installed before the
365
390
        # network is properly configured, which makes pserv listen only in