Project

General

Profile

Actions

Bug #37504

closed

TestValidDevice tests are failing

Added by Jan Fajerski over 5 years ago. Updated over 4 years ago.

Status:
Can't reproduce
Priority:
Normal
Assignee:
-
Target version:
-
% Done:

0%

Source:
Tags:
Backport:
Regression:
No
Severity:
3 - minor
Reviewed:
Affected Versions:
ceph-qa-suite:
Pull request ID:
Crash signature (v1):
Crash signature (v2):

Description

_________________________________________________ TestValidDevice.test_path_is_valid _________________________________________________

self = <test_arg_validators.TestValidDevice object at 0x7f0c15c885f8>
fake_call = <ceph_volume.tests.conftest.Capture object at 0x7f0c15c88748>

    def test_path_is_valid(self, fake_call):
>       result = self.validator('/')

ceph_volume/tests/util/test_arg_validators.py:82: 
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 
ceph_volume/util/arg_validators.py:16: in __call__
    device = Device(string)
ceph_volume/util/device.py:90: in __init__
    self._parse()
ceph_volume/util/device.py:111: in _parse
    sys_info.devices = disk.get_devices()
ceph_volume/util/disk.py:778: in get_devices
    if lvm.is_lv(diskname):
ceph_volume/api/lvm.py:269: in is_lv
    splitname = dmsetup_splitname(dev)
ceph_volume/api/lvm.py:262: in dmsetup_splitname
    return _splitname_parser(out)
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 

line = []

    def _splitname_parser(line):
        """ 
        Parses the output from ``dmsetup splitname``, that should contain prefixes
        (--nameprefixes) and set the separator to ";" 

        Output for /dev/mapper/vg-lv will usually look like::

            DM_VG_NAME='/dev/mapper/vg';DM_LV_NAME='lv';DM_LV_LAYER=''

        The ``VG_NAME`` will usually not be what other callers need (e.g. just 'vg'
        in the example), so this utility will split ``/dev/mapper/`` out, so that
        the actual volume group name is kept

        :returns: dictionary with stripped prefixes
        """ 
>       parts = line[0].split(';')
E       IndexError: list index out of range

ceph_volume/api/lvm.py:70: IndexError
________________________________________________ TestValidDevice.test_path_is_invalid ________________________________________________

self = <test_arg_validators.TestValidDevice object at 0x7f0c15c39400>
fake_call = <ceph_volume.tests.conftest.Capture object at 0x7f0c15c39908>

    def test_path_is_invalid(self, fake_call):
        with pytest.raises(argparse.ArgumentError):
>           self.validator('/device/does/not/exist')

ceph_volume/tests/util/test_arg_validators.py:87: 
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 
ceph_volume/util/arg_validators.py:16: in __call__
    device = Device(string)
ceph_volume/util/device.py:90: in __init__
    self._parse()
ceph_volume/util/device.py:111: in _parse
    sys_info.devices = disk.get_devices()
ceph_volume/util/disk.py:778: in get_devices
    if lvm.is_lv(diskname):
ceph_volume/api/lvm.py:269: in is_lv
    splitname = dmsetup_splitname(dev)
ceph_volume/api/lvm.py:262: in dmsetup_splitname
    return _splitname_parser(out)
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 

line = []

    def _splitname_parser(line):
        """ 
        Parses the output from ``dmsetup splitname``, that should contain prefixes
        (--nameprefixes) and set the separator to ";" 

        Output for /dev/mapper/vg-lv will usually look like::

            DM_VG_NAME='/dev/mapper/vg';DM_LV_NAME='lv';DM_LV_LAYER=''

        The ``VG_NAME`` will usually not be what other callers need (e.g. just 'vg'
        in the example), so this utility will split ``/dev/mapper/`` out, so that
        the actual volume group name is kept

        :returns: dictionary with stripped prefixes
        """ 
>       parts = line[0].split(';')
E       IndexError: list index out of range

ceph_volume/api/lvm.py:70: IndexError

These two tests are always failing. Its a python3 environment though it seems like this doesn't matter. Both tests are called with the fake_call fixture which always return ([], [], 0) iiuc. Seems like we need a fixture for dmsetup splitname calls?

Actions #1

Updated by Jan Fajerski over 4 years ago

  • Status changed from New to Can't reproduce
Actions

Also available in: Atom PDF