def test_udevadm_uuid(self):
        module = Mock()
        module.run_command = Mock(return_value=(0, UDEVADM_OUTPUT,
                                                ''))  # (rc, out, err)
        lh = linux.LinuxHardware(module=module, load_on_init=False)
        udevadm_uuid = lh._udevadm_uuid('mock_device')

        self.assertEqual(udevadm_uuid, '57b1a3e7-9019-4747-9809-7ec52bba9179')
 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
예제 #3
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
예제 #4
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