mirror of
https://github.com/valitydev/salt.git
synced 2024-11-07 08:58:59 +00:00
Merge pull request #39058 from sergeizv/fix-lvm-fullversion
Fix salt.modules.linux_lvm.fullversion
This commit is contained in:
commit
86b4b77bfe
@ -56,7 +56,7 @@ def fullversion():
|
||||
out = __salt__['cmd.run'](cmd).splitlines()
|
||||
for line in out:
|
||||
comps = line.split(':')
|
||||
ret[comps[0].strip()] = comps[1].strip()
|
||||
ret[comps[0].strip()] = comps[1].strip()
|
||||
return ret
|
||||
|
||||
|
||||
|
@ -34,18 +34,29 @@ class LinuxLVMTestCase(TestCase):
|
||||
'''
|
||||
Tests LVM version info from lvm version
|
||||
'''
|
||||
mock = MagicMock(return_value='Library version : 1')
|
||||
mock = MagicMock(return_value=
|
||||
' LVM version: 2.02.168(2) (2016-11-30)\n'
|
||||
' Library version: 1.03.01 (2016-11-30)\n'
|
||||
' Driver version: 4.35.0\n'
|
||||
)
|
||||
with patch.dict(linux_lvm.__salt__, {'cmd.run': mock}):
|
||||
self.assertEqual(linux_lvm.version(), '1')
|
||||
self.assertEqual(linux_lvm.version(), '2.02.168(2) (2016-11-30)')
|
||||
|
||||
def test_fullversion(self):
|
||||
'''
|
||||
Tests all version info from lvm version
|
||||
'''
|
||||
mock = MagicMock(return_value='Library version : 1')
|
||||
mock = MagicMock(return_value=
|
||||
' LVM version: 2.02.168(2) (2016-11-30)\n'
|
||||
' Library version: 1.03.01 (2016-11-30)\n'
|
||||
' Driver version: 4.35.0\n'
|
||||
)
|
||||
with patch.dict(linux_lvm.__salt__, {'cmd.run': mock}):
|
||||
self.assertDictEqual(linux_lvm.fullversion(),
|
||||
{'Library version': '1'})
|
||||
{'LVM version': '2.02.168(2) (2016-11-30)',
|
||||
'Library version': '1.03.01 (2016-11-30)',
|
||||
'Driver version': '4.35.0',
|
||||
})
|
||||
|
||||
def test_pvdisplay(self):
|
||||
'''
|
||||
|
Loading…
Reference in New Issue
Block a user