Exemple #1
0
 def _MockVm(
     self, name: str, remote_command_text: str
 ) -> linux_virtual_machine.BaseLinuxVirtualMachine:
     vm_spec = pkb_common_test_case.CreateTestVmSpec()
     vm = pkb_common_test_case.TestLinuxVirtualMachine(vm_spec=vm_spec)
     vm.OS_TYPE = 'debian9'
     vm.name = name
     vm.RemoteCommand = mock.Mock(return_value=(remote_command_text, ''))
     return vm
Exemple #2
0
def Vm(os_type, responses):
  vm_spec = pkb_common_test_case.CreateTestVmSpec()
  vm = pkb_common_test_case.TestLinuxVirtualMachine(vm_spec=vm_spec)
  # pylint: disable=invalid-name
  vm.OS_TYPE = os_type
  vm.RemoteCommand = mock.Mock()
  vm.InstallPackages = mock.Mock()
  vm.RemoteCommand.side_effect = [(text, '') for text in responses]
  # pylint: enable=invalid-name
  return vm
Exemple #3
0
def CreateCentos7Vm():
    vm_spec = pkb_common_test_case.CreateTestVmSpec()
    return TestCentos7VirtualMachine(vm_spec)
Exemple #4
0
def CreateTestLinuxVm():
    vm_spec = pkb_common_test_case.CreateTestVmSpec()
    return pkb_common_test_case.TestLinuxVirtualMachine(vm_spec=vm_spec)