示例#1
0
 def test_virtual_bails_without_partprobe(self):
     '''If partprobe not in PATH, __virtual__ shouldn't register module'''
     ret = parted.__virtual__()
     err = (
         False,
         'The parted execution module failed to load partprobe binary is not in the path.'
     )
     self.assertEqual(err, ret)
示例#2
0
 def test_virtual(self):
     '''On expected platform with correct utils in PATH, register
     "partition" module'''
     with patch('salt.utils.platform.is_windows', lambda: False), \
             patch('salt.utils.path.which', lambda exe: exe in ('parted', 'lsblk', 'partprobe')):
         ret = parted.__virtual__()
         expect = 'partition'
         self.assertEqual(ret, expect)
示例#3
0
 def test_virtual_bails_on_windows(self):
     '''If running windows, __virtual__ shouldn't register module'''
     ret = parted.__virtual__()
     err = (
         False,
         'The parted execution module failed to load Windows systems are not supported.'
     )
     self.assertEqual(err, ret)
示例#4
0
 def test_virtual_bails_on_windows(self):
     '''
     If running windows, __virtual__ shouldn't register module
     '''
     with patch('salt.utils.platform.is_windows', lambda: True):
         ret = parted.__virtual__()
         err = (False, 'The parted execution module failed to load Windows systems are not supported.')
         self.assertEqual(err, ret)
示例#5
0
 def test_virtual_bails_without_lsblk(self):
     '''If lsblk not in PATH, __virtual__ shouldn't register module'''
     with patch('salt.utils.path.which', lambda exe: not exe == "lsblk"):
         ret = parted.__virtual__()
         err = (
             False,
             'The parted execution module failed to load lsblk binary is not in the path.'
         )
         self.assertEqual(err, ret)
示例#6
0
 def test_virtual_bails_without_partprobe(self):
     '''
     If partprobe not in PATH, __virtual__ shouldn't register module
     '''
     with patch('salt.utils.path.which', lambda exe: not exe == "partprobe"),\
             patch('salt.utils.platform.is_windows', return_value=False):
         ret = parted.__virtual__()
         err = (False, 'The parted execution module failed to load partprobe binary is not in the path.')
         self.assertEqual(err, ret)
示例#7
0
 def test_virtual(self):
     '''On expected platform with correct utils in PATH, register
     "partition" module'''
     ret = parted.__virtual__()
     expect = 'partition'
     self.assertEqual(ret, expect)
示例#8
0
 def test_virtual_bails_without_partprobe(self):
     '''If partprobe not in PATH, __virtual__ shouldn't register module'''
     ret = parted.__virtual__()
     self.assertFalse(ret)
示例#9
0
 def test_virtual_bails_on_windows(self):
     '''If running windows, __virtual__ shouldn't register module'''
     ret = parted.__virtual__()
     self.assertFalse(ret)
示例#10
0
 def test_virtual(self):
     '''On expected platform with correct utils in PATH, register
     "partition" module'''
     ret = parted.__virtual__()
     expect = 'partition'
     self.assertEqual(ret, expect)
示例#11
0
 def test_virtual_bails_without_partprobe(self):
     '''If partprobe not in PATH, __virtual__ shouldn't register module'''
     ret = parted.__virtual__()
     self.assertFalse(ret)
示例#12
0
 def test_virtual_bails_on_windows(self):
     '''If running windows, __virtual__ shouldn't register module'''
     ret = parted.__virtual__()
     self.assertFalse(ret)
示例#13
0
 def test_virtual_bails_without_partprobe(self):
     """If partprobe not in PATH, __virtual__ shouldn't register module"""
     ret = parted.__virtual__()
     err = (False, "The parted execution module failed to load partprobe binary is not in the path.")
     self.assertEqual(err, ret)
示例#14
0
 def test_virtual_bails_on_windows(self):
     """If running windows, __virtual__ shouldn't register module"""
     ret = parted.__virtual__()
     err = (False, "The parted execution module failed to load Windows systems are not supported.")
     self.assertEqual(err, ret)