Ejemplo n.º 1
0
    def test_mountpoint_to_number(self):
        cases = {
            "sda": 0,
            "sdp": 15,
            "hda": 0,
            "hdp": 15,
            "vda": 0,
            "xvda": 0,
            "0": 0,
            "10": 10,
            "vdq": -1,
            "sdq": -1,
            "hdq": -1,
            "xvdq": -1,
        }

        for (input, expected) in cases.iteritems():
            actual = volume_utils._mountpoint_to_number(input)
            self.assertEqual(actual, expected, "%s yielded %s, not %s" % (input, actual, expected))
Ejemplo n.º 2
0
    def test_mountpoint_to_number(self):
        cases = {
            'sda': 0,
            'sdp': 15,
            'hda': 0,
            'hdp': 15,
            'vda': 0,
            'xvda': 0,
            '0': 0,
            '10': 10,
            'vdq': -1,
            'sdq': -1,
            'hdq': -1,
            'xvdq': -1,
        }

        for (input, expected) in six.iteritems(cases):
            actual = volume_utils._mountpoint_to_number(input)
            self.assertEqual(actual, expected,
                    '%s yielded %s, not %s' % (input, actual, expected))
Ejemplo n.º 3
0
    def test_mountpoint_to_number(self):
        cases = {
            'sda': 0,
            'sdp': 15,
            'hda': 0,
            'hdp': 15,
            'vda': 0,
            'xvda': 0,
            '0': 0,
            '10': 10,
            'vdq': -1,
            'sdq': -1,
            'hdq': -1,
            'xvdq': -1,
        }

        for (input, expected) in cases.iteritems():
            actual = volume_utils._mountpoint_to_number(input)
            self.assertEqual(actual, expected,
                    '%s yielded %s, not %s' % (input, actual, expected))
Ejemplo n.º 4
0
    def test_mountpoint_to_number(self):
        cases = {
            'sda': 0,
            'sdp': 15,
            'hda': 0,
            'hdp': 15,
            'vda': 0,
            'xvda': 0,
            '0': 0,
            '10': 10,
            'vdq': -1,
            'sdq': -1,
            'hdq': -1,
            'xvdq': -1,
        }

        for (input, expected) in six.iteritems(cases):
            actual = volume_utils._mountpoint_to_number(input)
            self.assertEqual(actual, expected,
                    '{0!s} yielded {1!s}, not {2!s}'.format(input, actual, expected))