From 23e945ecfd54abfcc3148604b5c1635ce43249c9 Mon Sep 17 00:00:00 2001 From: Aaron Lee Date: Wed, 16 Nov 2011 13:41:42 -0600 Subject: [PATCH] split rxtx_factor into network and instance_type This includes a migration and a change to the flavors extension. update1: removing tabs from the sql files & a quick refactoring update2: Fixing whitespace problem in the sqlite upgrayedd Change-Id: I665f402fe0ab1b301ab6761e80b11b101656065e --- nova/tests/test_instance_types.py | 11 ++++------- nova/tests/test_network.py | 1 + 2 files changed, 5 insertions(+), 7 deletions(-) diff --git a/nova/tests/test_instance_types.py b/nova/tests/test_instance_types.py index 58f0cb00..6c7b9d76 100644 --- a/nova/tests/test_instance_types.py +++ b/nova/tests/test_instance_types.py @@ -77,8 +77,7 @@ class InstanceTypeTestCase(test.TestCase): self.assertEqual(inst_type['vcpus'], 1) self.assertEqual(inst_type['local_gb'], 120) self.assertEqual(inst_type['swap'], 0) - self.assertEqual(inst_type['rxtx_quota'], 0) - self.assertEqual(inst_type['rxtx_cap'], 0) + self.assertEqual(inst_type['rxtx_factor'], 1) # make sure new type shows up in list new_list = instance_types.get_all_types() @@ -124,11 +123,9 @@ class InstanceTypeTestCase(test.TestCase): (('Negative swap', 256, 1, 10, 'flavor1'), {'swap': -1}), (('Non-integer swap', 256, 1, 10, 'flavor1'), {'swap': -1}), - (('Negative rxtx_quota', 256, 1, 10, 'f1'), {'rxtx_quota': -1}), - (('Non-integer rxtx_quota', 256, 1, 10, 'f1'), {'rxtx_quota': -1}), - - (('Negative rxtx_cap', 256, 1, 10, 'f1'), {'rxtx_cap': -1}), - (('Non-integer rxtx_cap', 256, 1, 10, 'f1'), {'rxtx_cap': 'a'}), + (('Negative rxtx_factor', 256, 1, 10, 'f1'), {'rxtx_factor': -1}), + (('Non-integer rxtx_factor', 256, 1, 10, 'f1'), + {'rxtx_factor': "d"}), ] for (args, kwargs) in invalid_sigs: diff --git a/nova/tests/test_network.py b/nova/tests/test_network.py index 2fac6324..9e12ed76 100644 --- a/nova/tests/test_network.py +++ b/nova/tests/test_network.py @@ -164,6 +164,7 @@ class FlatNetworkTestCase(test.TestCase): 'ips': 'DONTCARE', 'label': 'test%d' % i, 'mac': 'DE:AD:BE:EF:00:%02x' % i, + 'rxtx_cap': "%d" % i * 3, 'vif_uuid': '00000000-0000-0000-0000-00000000000000%02d' % i, 'rxtx_cap': 3,