~ubuntu-branches/ubuntu/saucy/nova/saucy-proposed

« back to all changes in this revision

Viewing changes to nova/tests/test_block_device.py

  • Committer: Package Import Robot
  • Author(s): Chuck Short, Chuck Short, Adam Gandelman
  • Date: 2013-02-22 09:27:29 UTC
  • mfrom: (1.1.68)
  • Revision ID: package-import@ubuntu.com-20130222092729-nn3gt8rf97uvts77
Tags: 2013.1.g3-0ubuntu1
[ Chuck Short ]
* New usptream release. 
* debian/patches/debian/patches/fix-ubuntu-tests.patch: Refreshed.
* debian/nova-baremetal.logrotate: Fix logfile path.
* debian/control, debian/nova-spiceproxy.{install, logrotate, upstart}:
  Add spice html5 proxy support.
* debian/nova-novncproxy.upstart: Start on runlevel [2345]
* debian/rules: Call testr directly since run_tests.sh -N gives weird return
  value when tests pass.
* debian/pyddist-overrides: Add websockify.
* debian/nova-common.postinst: Removed config file conversion, since
  the option is no longer available. (LP: #1110567)
* debian/control: Add python-pyasn1 as a dependency.
* debian/control: Add python-oslo-config as a dependency.
* debian/control: Suggest sysfsutils, sg3-utils, multipath-tools for fibre
  channel support.

[ Adam Gandelman ]
* debian/control: Fix typo (websocikfy -> websockify).

Show diffs side-by-side

added added

removed removed

Lines of Context:
91
91
        self.assertEqual(block_device.strip_prefix('a'), 'a')
92
92
        self.assertEqual(block_device.strip_prefix('xvda'), 'a')
93
93
        self.assertEqual(block_device.strip_prefix('vda'), 'a')
 
94
 
 
95
    def test_volume_in_mapping(self):
 
96
        swap = {'device_name': '/dev/sdb',
 
97
                'swap_size': 1}
 
98
        ephemerals = [{'num': 0,
 
99
                       'virtual_name': 'ephemeral0',
 
100
                       'device_name': '/dev/sdc1',
 
101
                       'size': 1},
 
102
                      {'num': 2,
 
103
                       'virtual_name': 'ephemeral2',
 
104
                       'device_name': '/dev/sdd',
 
105
                       'size': 1}]
 
106
        block_device_mapping = [{'mount_device': '/dev/sde',
 
107
                                 'device_path': 'fake_device'},
 
108
                                {'mount_device': '/dev/sdf',
 
109
                                 'device_path': 'fake_device'}]
 
110
        block_device_info = {
 
111
                'root_device_name': '/dev/sda',
 
112
                'swap': swap,
 
113
                'ephemerals': ephemerals,
 
114
                'block_device_mapping': block_device_mapping}
 
115
 
 
116
        def _assert_volume_in_mapping(device_name, true_or_false):
 
117
            in_mapping = block_device.volume_in_mapping(
 
118
                    device_name, block_device_info)
 
119
            self.assertEquals(in_mapping, true_or_false)
 
120
 
 
121
        _assert_volume_in_mapping('sda', False)
 
122
        _assert_volume_in_mapping('sdb', True)
 
123
        _assert_volume_in_mapping('sdc1', True)
 
124
        _assert_volume_in_mapping('sdd', True)
 
125
        _assert_volume_in_mapping('sde', True)
 
126
        _assert_volume_in_mapping('sdf', True)
 
127
        _assert_volume_in_mapping('sdg', False)
 
128
        _assert_volume_in_mapping('sdh1', False)