~ubuntu-branches/ubuntu/quantal/nova/quantal-proposed

« back to all changes in this revision

Viewing changes to nova/tests/api/ec2/test_cloud.py

  • Committer: Package Import Robot
  • Author(s): Adam Gandelman, Adam Gandelman, Chuck Short
  • Date: 2012-08-27 15:37:18 UTC
  • mfrom: (1.1.60)
  • Revision ID: package-import@ubuntu.com-20120827153718-lj8er44eqqz1gsrj
Tags: 2012.2~rc1~20120827.15815-0ubuntu1
[ Adam Gandelman ]
* New upstream release.

[ Chuck Short ]
* debian/patches/0001-Update-tools-hacking-for-pep8-1.2-and-
  beyond.patch: Dropped we dont run pep8 tests anymore.
* debian/control: Drop pep8 build depends
* debian/*.upstart.in: Make sure we transition correctly from runlevel
  1 to 2. (LP: #820694)

Show diffs side-by-side

added added

removed removed

Lines of Context:
42
42
from nova.openstack.common import log as logging
43
43
from nova.openstack.common import rpc
44
44
from nova import test
 
45
from nova.tests import fake_network
45
46
from nova.tests.image import fake
46
47
from nova import utils
47
48
from nova.virt import fake as fake_virt
95
96
        super(CloudTestCase, self).setUp()
96
97
        vol_tmpdir = tempfile.mkdtemp()
97
98
        self.flags(compute_driver='nova.virt.fake.FakeDriver',
98
 
                   volumes_dir=vol_tmpdir,
99
 
                   stub_network=True)
 
99
                   volumes_dir=vol_tmpdir)
100
100
 
101
101
        def fake_show(meh, context, id):
102
102
            return {'id': id,
121
121
            pass
122
122
 
123
123
        self.stubs.Set(compute_utils, 'notify_about_instance_usage', dumb)
 
124
        fake_network.set_stub_network_methods(self.stubs)
 
125
 
124
126
        # set up our cloud
125
127
        self.cloud = cloud.CloudController()
126
128
        self.flags(compute_scheduler_driver='nova.scheduler.'
688
690
        db.service_destroy(self.context, service1['id'])
689
691
        db.service_destroy(self.context, service2['id'])
690
692
 
 
693
    def test_describe_availability_zones_verbose(self):
 
694
        """Makes sure describe_availability_zones works and filters results."""
 
695
        service1 = db.service_create(self.context, {'host': 'host1_zones',
 
696
                                         'binary': "nova-compute",
 
697
                                         'topic': 'compute',
 
698
                                         'report_count': 0,
 
699
                                         'availability_zone': "zone1"})
 
700
        service2 = db.service_create(self.context, {'host': 'host2_zones',
 
701
                                         'binary': "nova-compute",
 
702
                                         'topic': 'compute',
 
703
                                         'report_count': 0,
 
704
                                         'availability_zone': "zone2"})
 
705
 
 
706
        admin_ctxt = context.get_admin_context(read_deleted="no")
 
707
        result = self.cloud.describe_availability_zones(admin_ctxt,
 
708
                                                        zone_name='verbose')
 
709
 
 
710
        self.assertEqual(len(result['availabilityZoneInfo']), 15)
 
711
        db.service_destroy(self.context, service1['id'])
 
712
        db.service_destroy(self.context, service2['id'])
 
713
 
691
714
    def test_describe_snapshots(self):
692
715
        """Makes sure describe_snapshots works and filters results."""
693
716
        vol = db.volume_create(self.context, {})