Skip to content

Commit

Permalink
Changed the timeout number
Browse files Browse the repository at this point in the history
  • Loading branch information
paull committed Feb 27, 2024
1 parent e18e1b6 commit 57b8abb
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 5 deletions.
2 changes: 1 addition & 1 deletion lisa/node.py
Original file line number Diff line number Diff line change
Expand Up @@ -238,7 +238,7 @@ def create(
)
return node

def reboot(self, time_out: int = 300) -> None:
def reboot(self, time_out: int = 900) -> None:
self.tools[Reboot].reboot(time_out)

def execute(
Expand Down
9 changes: 7 additions & 2 deletions lisa/sut_orchestrator/azure/Enable-SSH.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,11 @@ $acl | Set-Acl
Start-Service sshd

# enable key authentication and restart for effective.
$sshd_config = "C:\ProgramData\ssh\sshd_config"
(Get-Content $sshd_config) -replace '#PubkeyAuthentication', 'PubkeyAuthentication' | Out-File -encoding ASCII $sshd_config
$ssh_server = Get-Service sshd | Where-Object { $_.Name -like 'sshd' -and $_.Status -like "Running" }
if ($ssh_server)
{
Write-Output "sshd server is running"
$sshd_config = "C:\ProgramData\ssh\sshd_config"
(Get-Content $sshd_config) -replace '#PubkeyAuthentication', 'PubkeyAuthentication' | Out-File -encoding ASCII $sshd_config
}
Restart-Service sshd
4 changes: 2 additions & 2 deletions lisa/tools/reboot.py
Original file line number Diff line number Diff line change
Expand Up @@ -149,7 +149,7 @@ def command(self) -> str:
def _check_exists(self) -> bool:
return True

def reboot(self, time_out: int = 600) -> None:
def reboot(self, time_out: int = 1200) -> None:
last_boot_time = self.node.tools[Uptime].since_time()
self.node.tools[PowerShell].run_cmdlet(
"Restart-Computer -Force", force_run=True
Expand All @@ -162,7 +162,7 @@ def reboot(self, time_out: int = 600) -> None:

timeout_start = time.time()
is_ready = False
self._log.debug("Waiting for VM to reboot")
self._log.debug(f"Waiting for VM to reboot, time_out: {time_out}")
while time.time() - timeout_start < time_out:
try:
# check that vm has accessible ssh port
Expand Down

0 comments on commit 57b8abb

Please sign in to comment.