ec2utils: an unit test for ec2utils.properties_root_defice_name.

This commit is contained in:
Isaku Yamahata
2011-06-22 12:54:56 +09:00
parent 85dcec117a
commit fab201b485

View File

@@ -142,6 +142,17 @@ class Ec2utilsTestCase(test.TestCase):
self.assertDictMatch(out_dict, expected_dict)
def test_properties_root_defice_name(self):
mappings = [{"device": "/dev/sda1", "virtual": "root"}]
properties0 = {'mappings': mappings}
properties1 = {'root_device_name': '/dev/sdb', 'mappings': mappings}
root_device_name = ec2utils.properties_root_device_name(properties0)
self.assertEqual(root_device_name, '/dev/sda1')
root_device_name = ec2utils.properties_root_device_name(properties1)
self.assertEqual(root_device_name, '/dev/sdb')
class ApiEc2TestCase(test.TestCase):
"""Unit test for the cloud controller on an EC2 API"""