~ubuntu-branches/ubuntu/raring/nova/raring-proposed

« back to all changes in this revision

Viewing changes to .pc/fix-ubuntu-tests.patch/nova/tests/test_api.py

  • Committer: Package Import Robot
  • Author(s): Chuck Short, Adam Gandelman, Chuck Short
  • Date: 2012-11-23 09:04:58 UTC
  • mfrom: (1.1.66)
  • Revision ID: package-import@ubuntu.com-20121123090458-91565o7aev1i1h71
Tags: 2013.1~g1-0ubuntu1
[ Adam Gandelman ]
* debian/control: Ensure novaclient is upgraded with nova,
  require python-keystoneclient >= 1:2.9.0. (LP: #1073289)
* debian/patches/{ubuntu/*, rbd-security.patch}: Dropped, applied
  upstream.
* debian/control: Add python-testtools to Build-Depends.

[ Chuck Short ]
* New upstream version.
* Refreshed debian/patches/avoid_setuptools_git_dependency.patch.
* debian/rules: FTBFS if missing binaries.
* debian/nova-scheudler.install: Add missing rabbit-queues and
  nova-rpc-zmq-receiver.
* Remove nova-volume since it doesnt exist anymore, transition to cinder-*.
* debian/rules: install apport hook in the right place.
* debian/patches/ubuntu-show-tests.patch: Display test failures.
* debian/control: Add depends on genisoimage
* debian/control: Suggest guestmount.
* debian/control: Suggest websockify. (LP: #1076442)
* debian/nova.conf: Disable nova-volume service.
* debian/control: Depend on xen-system-* rather than the hypervisor.
* debian/control, debian/mans/nova-conductor.8, debian/nova-conductor.init,
  debian/nova-conductor.install, debian/nova-conductor.logrotate
  debian/nova-conductor.manpages, debian/nova-conductor.postrm
  debian/nova-conductor.upstart.in: Add nova-conductor service.
* debian/control: Add python-fixtures as a build deps.

Show diffs side-by-side

added added

removed removed

Lines of Context:
38
38
from nova import block_device
39
39
from nova import context
40
40
from nova import exception
41
 
from nova import flags
42
41
from nova.openstack.common import timeutils
43
42
from nova import test
44
 
 
45
 
 
46
 
FLAGS = flags.FLAGS
 
43
from nova.tests import matchers
47
44
 
48
45
 
49
46
class FakeHttplibSocket(object):
163
160
                  'virtual_name': 'ephemeral0'}}}
164
161
        out_dict = ec2utils.dict_from_dotted_str(in_str)
165
162
 
166
 
        self.assertDictMatch(out_dict, expected_dict)
 
163
        self.assertThat(out_dict, matchers.DictMatches(expected_dict))
167
164
 
168
165
    def test_properties_root_defice_name(self):
169
166
        mappings = [{"device": "/dev/sda1", "virtual": "root"}]
209
206
             'device': '/dev/sdc1'},
210
207
            {'virtual': 'ephemeral1',
211
208
             'device': '/dev/sdc1'}]
212
 
        self.assertDictListMatch(block_device.mappings_prepend_dev(mappings),
213
 
                                 expected_result)
 
209
        self.assertThat(block_device.mappings_prepend_dev(mappings),
 
210
                        matchers.DictListMatches(expected_result))
214
211
 
215
212
 
216
213
class ApiEc2TestCase(test.TestCase):
366
363
        for test in test_raise:
367
364
            self.expect_http()
368
365
            self.mox.ReplayAll()
369
 
            FLAGS.ec2_strict_validation = test[0]
 
366
            self.flags(ec2_strict_validation=test[0])
370
367
            self.assertRaises(boto_exc.EC2ResponseError,
371
368
                              self.ec2.create_security_group,
372
369
                              test[1],
378
375
        for test in test_accept:
379
376
            self.expect_http()
380
377
            self.mox.ReplayAll()
381
 
            FLAGS.ec2_strict_validation = test[0]
 
378
            self.flags(ec2_strict_validation=test[0])
382
379
            self.ec2.create_security_group(test[1], test[2])
383
380
            self.expect_http()
384
381
            self.mox.ReplayAll()
431
428
                group.authorize(*args)
432
429
            except boto_exc.EC2ResponseError as e:
433
430
                self.assertEqual(e.status, 400, 'Expected status to be 400')
434
 
                self.assertIn(message, e.error_message, e.error_message)
 
431
                self.assertIn(message, e.error_message)
435
432
            else:
436
433
                raise self.failureException, 'EC2ResponseError not raised'
437
434
 
448
445
        # Invalid Cidr for ICMP type
449
446
        _assert('Invalid CIDR', 'icmp', -1, -1, '0.0.444.0/4')
450
447
        # Invalid protocol
451
 
        _assert('An unknown error has occurred', 'xyz', 1, 14, '0.0.0.0/0')
 
448
        _assert('Invalid IP protocol', 'xyz', 1, 14, '0.0.0.0/0')
452
449
        # Invalid port
453
450
        _assert('An unknown error has occurred', 'tcp', " ", "81", '0.0.0.0/0')
454
451
        # Invalid icmp port