diff options
| author | Jenkins <jenkins@review.openstack.org> | 2013-02-20 15:08:58 +0000 |
|---|---|---|
| committer | Gerrit Code Review <review@openstack.org> | 2013-02-20 15:08:58 +0000 |
| commit | f43d05e8438efe915f6cd88f351265d89c01ff65 (patch) | |
| tree | 6c3b959fd731d2d6adc9af8c4abf1d8cb393518e | |
| parent | 96a4518575ea550d8e997444bfc243b7a822ec11 (diff) | |
| parent | 3769633faba091711c42c8780444f9c12fb054a2 (diff) | |
| download | nova-f43d05e8438efe915f6cd88f351265d89c01ff65.tar.gz nova-f43d05e8438efe915f6cd88f351265d89c01ff65.tar.xz nova-f43d05e8438efe915f6cd88f351265d89c01ff65.zip | |
Merge "Enhance IPAdresses migration tests"
| -rw-r--r-- | nova/tests/test_migrations.py | 29 |
1 files changed, 23 insertions, 6 deletions
diff --git a/nova/tests/test_migrations.py b/nova/tests/test_migrations.py index e2ab2df1f..52e201799 100644 --- a/nova/tests/test_migrations.py +++ b/nova/tests/test_migrations.py @@ -44,6 +44,7 @@ import collections import commands import ConfigParser import datetime +import netaddr import os import sqlalchemy import urlparse @@ -535,9 +536,15 @@ class TestMigrations(BaseMigrationTestCase): {'protocol': 'tcp', 'from_port': 1234, 'to_port': 1234, 'cidr': "128.128.128.128/16"}, {'protocol': 'tcp', 'from_port': 1234, + 'to_port': 1234, 'cidr': "128.128.128.128/32"}, + {'protocol': 'tcp', 'from_port': 1234, 'to_port': 1234, 'cidr': "2001:db8::1:2/48"}, {'protocol': 'tcp', 'from_port': 1234, - 'to_port': 1234, 'cidr': "::1/64"} + 'to_port': 1234, 'cidr': "::1/64"}, + {'protocol': 'tcp', 'from_port': 1234, 'to_port': 1234, + 'cidr': "0000:0000:0000:2013:0000:6535:abcd:ef11/64"}, + {'protocol': 'tcp', 'from_port': 1234, 'to_port': 1234, + 'cidr': "0000:1020:0000:2013:0000:6535:abcd:ef11/128"}, ], 'console_pools': [ @@ -545,6 +552,7 @@ class TestMigrations(BaseMigrationTestCase): {'address': '128.100.100.100'}, {'address': '2002:2002:2002:2002:2002:2002:2002:2002'}, {'address': '::1'}, + {'address': '0000:0000:0000:2013:0000:6535:abcd:ef11'} ] } @@ -559,18 +567,20 @@ class TestMigrations(BaseMigrationTestCase): provider_fw_rules = get_table(engine, 'provider_fw_rules') result = provider_fw_rules.select().execute() - iplist = map(lambda x: x['cidr'], data['provider_fw_rules']) + iplist = map(lambda x: str(netaddr.IPNetwork(x['cidr'])), + data['provider_fw_rules']) for row in result: - self.assertIn(row['cidr'], iplist) + self.assertIn(str(netaddr.IPNetwork(row['cidr'])), iplist) console_pools = get_table(engine, 'console_pools') result = console_pools.select().execute() - iplist = map(lambda x: x['address'], data['console_pools']) + iplist = map(lambda x: str(netaddr.IPAddress(x['address'])), + data['console_pools']) for row in result: - self.assertIn(row['address'], iplist) + self.assertIn(str(netaddr.IPAddress(row['address'])), iplist) # migration 151 - changes period_beginning and period_ending to DateTime def _prerun_151(self, engine): @@ -758,9 +768,15 @@ class TestMigrations(BaseMigrationTestCase): {'protocol': 'tcp', 'from_port': 1234, 'to_port': 1234, 'cidr': "128.128.128.128/16"}, {'protocol': 'tcp', 'from_port': 1234, + 'to_port': 1234, 'cidr': "128.128.128.128/32"}, + {'protocol': 'tcp', 'from_port': 1234, 'to_port': 1234, 'cidr': "2001:db8::1:2/48"}, {'protocol': 'tcp', 'from_port': 1234, - 'to_port': 1234, 'cidr': "::1/64"} + 'to_port': 1234, 'cidr': "::1/64"}, + {'protocol': 'tcp', 'from_port': 1234, 'to_port': 1234, + 'cidr': "0000:0000:0000:2013:0000:6535:abcd:ef11/64"}, + {'protocol': 'tcp', 'from_port': 1234, 'to_port': 1234, + 'cidr': "0000:1020:0000:2013:0000:6535:abcd:ef11/128"}, ], 'console_pools': [ @@ -768,6 +784,7 @@ class TestMigrations(BaseMigrationTestCase): {'address': '128.100.100.100'}, {'address': '2002:2002:2002:2002:2002:2002:2002:2002'}, {'address': '::1'}, + {'address': '0000:0000:0000:2013:0000:6535:abcd:ef11'} ] } return data |
