~tribaal/charms/trusty/nova-cloud-controller/update-charm-helpers-stable

« back to all changes in this revision

Viewing changes to unit_tests/test_nova_cc_utils.py

  • Committer: Liam Young
  • Date: 2015-04-22 19:22:30 UTC
  • mto: This revision was merged to the branch mainline in revision 161.
  • Revision ID: liam.young@canonical.com-20150422192230-1i83y5k65jn0vy8t
Add unit tests for kilo

Show diffs side-by-side

added added

removed removed

Lines of Context:
687
687
        self.assertEquals(self.ml2_migration.call_count, 0)
688
688
        self.assertTrue(migrate_nova_database.call_count, 1)
689
689
 
 
690
    @patch.object(utils, 'get_step_upgrade_source')
 
691
    @patch.object(utils, 'migrate_nova_database')
 
692
    @patch.object(utils, 'determine_packages')
 
693
    def test_upgrade_juno_kilo(self, determine_packages,
 
694
                               migrate_nova_database,
 
695
                               get_step_upgrade_source):
 
696
        "Simulate a call to do_openstack_upgrade() for juno->kilo"
 
697
        self.test_config.set('openstack-origin', 'cloud:trusty-kilo')
 
698
        get_step_upgrade_source.return_value = None
 
699
        self.os_release.return_value = 'juno'
 
700
        self.get_os_codename_install_source.return_value = 'kilo'
 
701
        self.eligible_leader.return_value = True
 
702
        self.relation_ids.return_value = []
 
703
        utils.do_openstack_upgrade()
 
704
        self.assertEquals(self.neutron_db_manage.call_count, 0)
 
705
        self.apt_update.assert_called_with(fatal=True)
 
706
        self.apt_upgrade.assert_called_with(options=DPKG_OPTS, fatal=True,
 
707
                                            dist=True)
 
708
        self.apt_install.assert_called_with(determine_packages(), fatal=True)
 
709
        self.register_configs.assert_called_with(release='kilo')
 
710
        self.assertEquals(self.ml2_migration.call_count, 0)
 
711
        self.assertTrue(migrate_nova_database.call_count, 1)
 
712
 
690
713
    @patch.object(utils, '_do_openstack_upgrade')
691
714
    def test_upgrade_grizzly_icehouse_source(self, _do_openstack_upgrade):
692
715
        "Verify get_step_upgrade_source() for grizzly->icehouse"