diff options
author | Isaku Yamahata <yamahata@valinux.co.jp> | 2011-06-22 12:54:56 +0900 |
---|---|---|
committer | Isaku Yamahata <yamahata@valinux.co.jp> | 2011-06-22 12:54:56 +0900 |
commit | aadb9a0a8a9a0b947643c04f24b623412db7d48d (patch) | |
tree | 098e43b97320b0b50552ffe024abeceee8c87309 /nova/tests/test_api.py | |
parent | ac9ed64077eaad6b4df91fbf90af7933a6bddd5a (diff) | |
download | nova-aadb9a0a8a9a0b947643c04f24b623412db7d48d.tar.gz nova-aadb9a0a8a9a0b947643c04f24b623412db7d48d.tar.xz nova-aadb9a0a8a9a0b947643c04f24b623412db7d48d.zip |
ec2utils: an unit test for ec2utils.properties_root_defice_name.
Diffstat (limited to 'nova/tests/test_api.py')
-rw-r--r-- | nova/tests/test_api.py | 11 |
1 files changed, 11 insertions, 0 deletions
diff --git a/nova/tests/test_api.py b/nova/tests/test_api.py index bea4b4e9d..ebc5508cc 100644 --- a/nova/tests/test_api.py +++ b/nova/tests/test_api.py @@ -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""" |