merging trunk
This commit is contained in:
2
Authors
2
Authors
@@ -1,3 +1,4 @@
|
|||||||
|
Alex Meade <alex.meade@rackspace.com>
|
||||||
Andy Smith <code@term.ie>
|
Andy Smith <code@term.ie>
|
||||||
Andy Southgate <andy.southgate@citrix.com>
|
Andy Southgate <andy.southgate@citrix.com>
|
||||||
Anne Gentle <anne@openstack.org>
|
Anne Gentle <anne@openstack.org>
|
||||||
@@ -45,6 +46,7 @@ Joshua McKenty <jmckenty@gmail.com>
|
|||||||
Justin Santa Barbara <justin@fathomdb.com>
|
Justin Santa Barbara <justin@fathomdb.com>
|
||||||
Kei Masumoto <masumotok@nttdata.co.jp>
|
Kei Masumoto <masumotok@nttdata.co.jp>
|
||||||
Ken Pepple <ken.pepple@gmail.com>
|
Ken Pepple <ken.pepple@gmail.com>
|
||||||
|
Kevin Bringard <kbringard@attinteractive.com>
|
||||||
Kevin L. Mitchell <kevin.mitchell@rackspace.com>
|
Kevin L. Mitchell <kevin.mitchell@rackspace.com>
|
||||||
Koji Iida <iida.koji@lab.ntt.co.jp>
|
Koji Iida <iida.koji@lab.ntt.co.jp>
|
||||||
Lorin Hochstein <lorin@isi.edu>
|
Lorin Hochstein <lorin@isi.edu>
|
||||||
|
|||||||
@@ -29,11 +29,12 @@ from nova.utils import parse_mailmap, str_dict_replace
|
|||||||
class ProjectTestCase(test.TestCase):
|
class ProjectTestCase(test.TestCase):
|
||||||
def test_authors_up_to_date(self):
|
def test_authors_up_to_date(self):
|
||||||
topdir = os.path.normpath(os.path.dirname(__file__) + '/../../')
|
topdir = os.path.normpath(os.path.dirname(__file__) + '/../../')
|
||||||
if os.path.exists(os.path.join(topdir, '.bzr')):
|
missing = set()
|
||||||
contributors = set()
|
contributors = set()
|
||||||
|
|
||||||
mailmap = parse_mailmap(os.path.join(topdir, '.mailmap'))
|
mailmap = parse_mailmap(os.path.join(topdir, '.mailmap'))
|
||||||
|
authors_file = open(os.path.join(topdir, 'Authors'), 'r').read()
|
||||||
|
|
||||||
|
if os.path.exists(os.path.join(topdir, '.bzr')):
|
||||||
import bzrlib.workingtree
|
import bzrlib.workingtree
|
||||||
tree = bzrlib.workingtree.WorkingTree.open(topdir)
|
tree = bzrlib.workingtree.WorkingTree.open(topdir)
|
||||||
tree.lock_read()
|
tree.lock_read()
|
||||||
@@ -47,12 +48,28 @@ class ProjectTestCase(test.TestCase):
|
|||||||
for r in revs:
|
for r in revs:
|
||||||
for author in r.get_apparent_authors():
|
for author in r.get_apparent_authors():
|
||||||
email = author.split(' ')[-1]
|
email = author.split(' ')[-1]
|
||||||
|
contributors.add(str_dict_replace(email,
|
||||||
|
mailmap))
|
||||||
|
finally:
|
||||||
|
tree.unlock()
|
||||||
|
|
||||||
|
elif os.path.exists(os.path.join(topdir, '.git')):
|
||||||
|
import git
|
||||||
|
repo = git.Repo(topdir)
|
||||||
|
for commit in repo.head.commit.iter_parents():
|
||||||
|
email = commit.author.email
|
||||||
|
if email is None:
|
||||||
|
email = commit.author.name
|
||||||
|
if 'nova-core' in email:
|
||||||
|
continue
|
||||||
|
if email.split(' ')[-1] == '<>':
|
||||||
|
email = email.split(' ')[-2]
|
||||||
|
email = '<' + email + '>'
|
||||||
contributors.add(str_dict_replace(email, mailmap))
|
contributors.add(str_dict_replace(email, mailmap))
|
||||||
|
|
||||||
authors_file = open(os.path.join(topdir, 'Authors'),
|
else:
|
||||||
'r').read()
|
self.assertTrue(False, 'Cannot read commit history')
|
||||||
|
|
||||||
missing = set()
|
|
||||||
for contributor in contributors:
|
for contributor in contributors:
|
||||||
if contributor == 'nova-core':
|
if contributor == 'nova-core':
|
||||||
continue
|
continue
|
||||||
@@ -61,8 +78,6 @@ class ProjectTestCase(test.TestCase):
|
|||||||
|
|
||||||
self.assertTrue(len(missing) == 0,
|
self.assertTrue(len(missing) == 0,
|
||||||
'%r not listed in Authors' % missing)
|
'%r not listed in Authors' % missing)
|
||||||
finally:
|
|
||||||
tree.unlock()
|
|
||||||
|
|
||||||
|
|
||||||
class LockTestCase(test.TestCase):
|
class LockTestCase(test.TestCase):
|
||||||
|
|||||||
@@ -44,7 +44,9 @@ def _concurrency(wait, done, target):
|
|||||||
done.send()
|
done.send()
|
||||||
|
|
||||||
|
|
||||||
def _create_network_info(count=1):
|
def _create_network_info(count=1, ipv6=None):
|
||||||
|
if ipv6 is None:
|
||||||
|
ipv6 = FLAGS.use_ipv6
|
||||||
fake = 'fake'
|
fake = 'fake'
|
||||||
fake_ip = '0.0.0.0/0'
|
fake_ip = '0.0.0.0/0'
|
||||||
fake_ip_2 = '0.0.0.1/0'
|
fake_ip_2 = '0.0.0.1/0'
|
||||||
@@ -55,8 +57,11 @@ def _create_network_info(count=1):
|
|||||||
'cidr': fake_ip,
|
'cidr': fake_ip,
|
||||||
'cidr_v6': fake_ip}
|
'cidr_v6': fake_ip}
|
||||||
mapping = {'mac': fake,
|
mapping = {'mac': fake,
|
||||||
'ips': [{'ip': fake_ip}, {'ip': fake_ip}],
|
'ips': [{'ip': fake_ip}, {'ip': fake_ip}]}
|
||||||
'ip6s': [{'ip': fake_ip}, {'ip': fake_ip_2}, {'ip': fake_ip_3}]}
|
if ipv6:
|
||||||
|
mapping['ip6s'] = [{'ip': fake_ip},
|
||||||
|
{'ip': fake_ip_2},
|
||||||
|
{'ip': fake_ip_3}]
|
||||||
return [(network, mapping) for x in xrange(0, count)]
|
return [(network, mapping) for x in xrange(0, count)]
|
||||||
|
|
||||||
|
|
||||||
@@ -641,6 +646,11 @@ class LibvirtConnTestCase(test.TestCase):
|
|||||||
|
|
||||||
self.assertTrue(count)
|
self.assertTrue(count)
|
||||||
|
|
||||||
|
def test_get_host_ip_addr(self):
|
||||||
|
conn = libvirt_conn.LibvirtConnection(False)
|
||||||
|
ip = conn.get_host_ip_addr()
|
||||||
|
self.assertEquals(ip, FLAGS.my_ip)
|
||||||
|
|
||||||
def tearDown(self):
|
def tearDown(self):
|
||||||
self.manager.delete_project(self.project)
|
self.manager.delete_project(self.project)
|
||||||
self.manager.delete_user(self.user)
|
self.manager.delete_user(self.user)
|
||||||
@@ -825,12 +835,20 @@ class IptablesFirewallTestCase(test.TestCase):
|
|||||||
"TCP port 80/81 acceptance rule wasn't added")
|
"TCP port 80/81 acceptance rule wasn't added")
|
||||||
db.instance_destroy(admin_ctxt, instance_ref['id'])
|
db.instance_destroy(admin_ctxt, instance_ref['id'])
|
||||||
|
|
||||||
def test_filters_for_instance(self):
|
def test_filters_for_instance_with_ip_v6(self):
|
||||||
|
self.flags(use_ipv6=True)
|
||||||
network_info = _create_network_info()
|
network_info = _create_network_info()
|
||||||
rulesv4, rulesv6 = self.fw._filters_for_instance("fake", network_info)
|
rulesv4, rulesv6 = self.fw._filters_for_instance("fake", network_info)
|
||||||
self.assertEquals(len(rulesv4), 2)
|
self.assertEquals(len(rulesv4), 2)
|
||||||
self.assertEquals(len(rulesv6), 3)
|
self.assertEquals(len(rulesv6), 3)
|
||||||
|
|
||||||
|
def test_filters_for_instance_without_ip_v6(self):
|
||||||
|
self.flags(use_ipv6=False)
|
||||||
|
network_info = _create_network_info()
|
||||||
|
rulesv4, rulesv6 = self.fw._filters_for_instance("fake", network_info)
|
||||||
|
self.assertEquals(len(rulesv4), 2)
|
||||||
|
self.assertEquals(len(rulesv6), 0)
|
||||||
|
|
||||||
def multinic_iptables_test(self):
|
def multinic_iptables_test(self):
|
||||||
ipv4_rules_per_network = 2
|
ipv4_rules_per_network = 2
|
||||||
ipv6_rules_per_network = 3
|
ipv6_rules_per_network = 3
|
||||||
|
|||||||
Reference in New Issue
Block a user