~jtv/maas/bug-1302772

« back to all changes in this revision

Viewing changes to src/provisioningserver/tests/test_config.py

  • Committer: jtv at canonical
  • Date: 2014-04-07 09:00:25 UTC
  • Revision ID: jtv@canonical.com-20140407090025-4dbm848q2cn3gclj
Reproduce bug: pre-1.5 pserv.yaml now breaks the parser.

Show diffs side-by-side

added added

removed removed

Lines of Context:
387
387
            partial(Config.parse, config),
388
388
            Raises(expected))
389
389
 
 
390
    def test_accepts_1_4_config_file(self):
 
391
        # A config file that was valid with MAAS 1.4 still loads, even though
 
392
        # its "boot" section is no longer used.
 
393
        broker_password = factory.make_name('pass')
 
394
        config = Config.parse(dedent("""\
 
395
            logfile: "/dev/null"
 
396
            oops:
 
397
              directory: "logs/oops"
 
398
              reporter: "maas-pserv"
 
399
            broker:
 
400
              host: "localhost"
 
401
              port: 5673
 
402
              username: brokeruser
 
403
              password: "%s"
 
404
              vhost: "/"
 
405
            tftp:
 
406
              root: /var/lib/maas/tftp
 
407
              port: 5244
 
408
              generator: http://localhost:5243/api/1.0/pxeconfig/
 
409
            boot:
 
410
              architectures: ['i386', 'armhf']
 
411
              ephemeral:
 
412
                images_directory: /var/lib/maas/ephemeral
 
413
                releases: ['precise', 'saucy']
 
414
            """) % broker_password)
 
415
        # This does not fail.
 
416
        self.assertEqual(broker_password, config['broker']['password'])
 
417
 
390
418
 
391
419
class TestBootConfig(MAASTestCase):
392
420
    """Tests for `provisioningserver.config.BootConfig`."""