Exemple #1
0
 def _wait_for_vmware_tools(self):
     """ Wait until vmware tools is ready """
     timeout_loop(
         self.timeout, 'Vmware tools readiness', 1, False,
         lambda: self._vm_object.summary.guest.toolsRunningStatus ==
         'guestToolsRunning'
     )
Exemple #2
0
 def _wait_for_ssh_service(self, username, password):
     """
     Wait until ssh service is ready
     :param username: SSH username
     :param password: SSH password
     """
     timeout_loop(self.timeout, 'Check SSH service', 1, True,
                  check_ssh_service, self.ip(), username, password)
Exemple #3
0
 def _wait_for_winrm_service(self, username, password, **kwargs):
     """
     Wait until winrm service is ready
     :param username: WinRM username
     :param password: WinRM password
     :param kwargs: pywinrm Protocol kwargs
     """
     timeout_loop(self.timeout,
                  'Check WinRM service', 1, True, check_winrm_service,
                  self.ip(), username, password, **kwargs)
Exemple #4
0
    def ip(self):
        """
        Poll vcenter to get the virtual machine IP

        :return: Return the ip
        """
        if self._vm_object:
            if not self._vm_object.summary.guest.ipAddress:
                timeout_loop(self.timeout, 'Get IP', 1, False,
                             lambda: self._vm_object.summary.guest.ipAddress)
            ip = self._vm_object.summary.guest.ipAddress
            validate_ip(ip)
            return ip
Exemple #5
0
def test_timeout_loop_fail():
    with pytest.raises(TimeoutError):
        timeout_loop(1, '', 1, False, lambda: False)
Exemple #6
0
def test_timeout_loop_success():
    timeout_loop(1, '', 1, False, lambda: True)
def wait_for_power_state_or_die(vm_object, state):
    timeout_loop(300, '', 1, True,
                 lambda: vm_object.summary.runtime.powerState == state)