[switch]$CleanupEventLog = $false
)
-$ErrorActionPreference = "Stop"
+$ErrorActionPreference = "Ignore"
function DumpEventLogEvtx($path){
foreach ($i in (Get-WinEvent -ListLog * | ? {$_.RecordCount -gt 0 })) {
$logFile = Join-Path $path $logName
& $Env:WinDir\System32\wevtutil.exe epl $i.LogName $logFile
if ($LASTEXITCODE) {
- Throw "Failed to export $($i.LogName) to $logFile"
+ Write-Output "Failed to export $($i.LogName) to $logFile"
}
}
}
Write-Output "exporting "$i.LogName" as "$logName
$logFile = Join-Path $path $logName
Get-WinEvent `
- -ErrorAction SilentlyContinue `
+ -ErrorAction "Ignore" `
-FilterHashtable @{
LogName=$i.LogName;
StartTime=$(Get-Date).AddHours(-6)
foreach ($i in (Get-WinEvent -ListLog * | ? {$_.RecordCount -gt 0 })) {
& $Env:WinDir\System32\wevtutil.exe cl $i.LogName
if ($LASTEXITCODE) {
- Throw "Failed to clear $($i.LogName) from the event log"
+ Write-Output "Failed to clear $($i.LogName) from the event log"
}
}
}
if ($CleanupEventLog) {
ClearEventLog
}
+
+Write-Output "Successfully collected Windows event logs."
SSH_TIMEOUT=15m ssh_exec python.exe /workspace/test_rbd_wnbd.py --test-name RbdFsFioTest --iterations 4
SSH_TIMEOUT=15m ssh_exec python.exe /workspace/test_rbd_wnbd.py --test-name RbdFsStampTest --iterations 4
fi
+
+echo "Windows tests succeeded."