Ejemplo n.º 1
0
 def _mock_module(self):
     mock_module = Mock()
     mock_module.params = {'gather_subset': self.gather_subset,
                           'gather_timeout': 5,
                           'filter': '*'}
     mock_module.get_bin_path = Mock(return_value=None)
     return mock_module
Ejemplo n.º 2
0
    def test_lsblk_uuid_no_lsblk(self):
        module = Mock()
        module.get_bin_path = Mock(return_value=None)
        lh = facts.LinuxHardware(module=module, load_on_init=False)
        lsblk_uuids = lh._lsblk_uuid()

        self.assertIsInstance(lsblk_uuids, dict)
        self.assertEquals(len(lsblk_uuids), 0)
Ejemplo n.º 3
0
    def test_find_bind_mounts_no_findmnts(self):
        module = Mock()
        module.get_bin_path = Mock(return_value=None)
        lh = facts.LinuxHardware(module=module, load_on_init=False)
        bind_mounts = lh._find_bind_mounts()

        self.assertIsInstance(bind_mounts, set)
        self.assertEqual(len(bind_mounts), 0)
Ejemplo n.º 4
0
    def test_lsblk_uuid_no_lsblk(self):
        module = Mock()
        module.get_bin_path = Mock(return_value=None)
        lh = facts.LinuxHardware(module=module, load_on_init=False)
        lsblk_uuids = lh._lsblk_uuid()

        self.assertIsInstance(lsblk_uuids, dict)
        self.assertEquals(len(lsblk_uuids), 0)
Ejemplo n.º 5
0
    def test_find_bind_mounts_no_findmnts(self):
        module = Mock()
        module.get_bin_path = Mock(return_value=None)
        lh = facts.LinuxHardware(module=module, load_on_init=False)
        bind_mounts = lh._find_bind_mounts()

        self.assertIsInstance(bind_mounts, set)
        self.assertEqual(len(bind_mounts), 0)
Ejemplo n.º 6
0
 def _mock_module(self):
     mock_module = Mock()
     mock_module.params = {'gather_subset': self.gather_subset,
                           'gather_timeout': 10,
                           'filter': '*'}
     mock_module.get_bin_path = Mock(return_value='/usr/bin/lsb_release')
     mock_module.run_command = Mock(return_value=(0, lsb_release_a_fedora_output, ''))
     return mock_module
Ejemplo n.º 7
0
 def _mock_module(self):
     mock_module = Mock()
     mock_module.params = {'gather_subset': self.gather_subset,
                           'gather_timeout': 10,
                           'filter': '*'}
     mock_module.get_bin_path = Mock(return_value='/usr/sbin/capsh')
     mock_module.run_command = Mock(return_value=(0, 'Current: =ep', ''))
     return mock_module
Ejemplo n.º 8
0
 def _mock_module(self):
     mock_module = Mock()
     mock_module.params = {'gather_subset': self.gather_subset,
                           'gather_timeout': 10,
                           'filter': '*'}
     mock_module.get_bin_path = Mock(return_value='/not/actually/facter')
     mock_module.run_command = Mock(return_value=(0, facter_json_output, ''))
     return mock_module
Ejemplo n.º 9
0
def mock_module(gather_subset=None):
    if gather_subset is None:
        gather_subset = ['all', '!facter', '!ohai']
    mock_module = Mock()
    mock_module.params = {'gather_subset': gather_subset,
                          'gather_timeout': 5,
                          'filter': '*'}
    mock_module.get_bin_path = Mock(return_value=None)
    return mock_module
 def _mock_module(self):
     mock_module = Mock()
     mock_module.params = {
         'gather_subset': self.gather_subset,
         'gather_timeout': 10,
         'filter': '*'
     }
     mock_module.get_bin_path = Mock(return_value='/usr/sbin/capsh')
     mock_module.run_command = Mock(return_value=(0, 'Current: =ep', ''))
     return mock_module
Ejemplo n.º 11
0
def mock_module(gather_subset=None):
    if gather_subset is None:
        gather_subset = ['all', '!facter', '!ohai']
    mock_module = Mock()
    mock_module.params = {
        'gather_subset': gather_subset,
        'gather_timeout': 5,
        'filter': '*'
    }
    mock_module.get_bin_path = Mock(return_value=None)
    return mock_module
Ejemplo n.º 12
0
 def _mock_module(self):
     mock_module = Mock()
     mock_module.params = {
         'gather_subset': self.gather_subset,
         'gather_timeout': 10,
         'filter': '*'
     }
     mock_module.get_bin_path = Mock(return_value='/usr/bin/lsb_release')
     mock_module.run_command = Mock(
         return_value=(0, lsb_release_a_fedora_output, ''))
     return mock_module