|
@@ -179,6 +179,13 @@ Function Nuke-Everything {
|
|
}
|
|
}
|
|
}
|
|
}
|
|
|
|
|
|
|
|
+ # Kill any spurious containerd.
|
|
|
|
+ $pids=$(get-process | where-object {$_.ProcessName -like 'containerd'}).id
|
|
|
|
+ foreach ($p in $pids) {
|
|
|
|
+ Write-Host "INFO: Killing containerd with PID $p"
|
|
|
|
+ Stop-Process -Id $p -Force -ErrorAction SilentlyContinue
|
|
|
|
+ }
|
|
|
|
+
|
|
Stop-Process -name "cc1" -Force -ErrorAction SilentlyContinue 2>&1 | Out-Null
|
|
Stop-Process -name "cc1" -Force -ErrorAction SilentlyContinue 2>&1 | Out-Null
|
|
Stop-Process -name "link" -Force -ErrorAction SilentlyContinue 2>&1 | Out-Null
|
|
Stop-Process -name "link" -Force -ErrorAction SilentlyContinue 2>&1 | Out-Null
|
|
Stop-Process -name "compile" -Force -ErrorAction SilentlyContinue 2>&1 | Out-Null
|
|
Stop-Process -name "compile" -Force -ErrorAction SilentlyContinue 2>&1 | Out-Null
|
|
@@ -521,6 +528,15 @@ Try {
|
|
Throw "ERROR: gotestsum.exe not found...." `
|
|
Throw "ERROR: gotestsum.exe not found...." `
|
|
}
|
|
}
|
|
|
|
|
|
|
|
+ docker cp "$COMMITHASH`:c`:\containerd\bin\containerd.exe" $env:TEMP\binary\
|
|
|
|
+ if (-not (Test-Path "$env:TEMP\binary\containerd.exe")) {
|
|
|
|
+ Throw "ERROR: containerd.exe not found...." `
|
|
|
|
+ }
|
|
|
|
+ docker cp "$COMMITHASH`:c`:\containerd\bin\containerd-shim-runhcs-v1.exe" $env:TEMP\binary\
|
|
|
|
+ if (-not (Test-Path "$env:TEMP\binary\containerd-shim-runhcs-v1.exe")) {
|
|
|
|
+ Throw "ERROR: containerd-shim-runhcs-v1.exe not found...." `
|
|
|
|
+ }
|
|
|
|
+
|
|
$ErrorActionPreference = "Stop"
|
|
$ErrorActionPreference = "Stop"
|
|
|
|
|
|
# Copy the built dockerd.exe to dockerd-$COMMITHASH.exe so that easily spotted in task manager.
|
|
# Copy the built dockerd.exe to dockerd-$COMMITHASH.exe so that easily spotted in task manager.
|
|
@@ -566,8 +582,10 @@ Try {
|
|
$env:GOPATH="$env:SOURCES_DRIVE`:\$env:SOURCES_SUBDIR"
|
|
$env:GOPATH="$env:SOURCES_DRIVE`:\$env:SOURCES_SUBDIR"
|
|
Write-Host -ForegroundColor Green "INFO: GOPATH=$env:GOPATH"
|
|
Write-Host -ForegroundColor Green "INFO: GOPATH=$env:GOPATH"
|
|
|
|
|
|
- # Set the path to have the version of go from the image at the front
|
|
|
|
- $env:PATH="$env:TEMP\go\bin;$env:PATH"
|
|
|
|
|
|
+ # Set the path to have:
|
|
|
|
+ # - the version of go from the image at the front
|
|
|
|
+ # - the test binaries, not the host ones.
|
|
|
|
+ $env:PATH="$env:TEMP\go\bin;$env:TEMP\binary;$env:PATH"
|
|
|
|
|
|
# Set the GOROOT to be our copy of go from the image
|
|
# Set the GOROOT to be our copy of go from the image
|
|
$env:GOROOT="$env:TEMP\go"
|
|
$env:GOROOT="$env:TEMP\go"
|
|
@@ -594,6 +612,12 @@ Try {
|
|
$dutArgs += "-D"
|
|
$dutArgs += "-D"
|
|
}
|
|
}
|
|
|
|
|
|
|
|
+ # Arguments: Are we starting the daemon under test in containerd mode?
|
|
|
|
+ if (-not ("$env:DOCKER_WINDOWS_CONTAINERD_RUNTIME" -eq "")) {
|
|
|
|
+ Write-Host -ForegroundColor Green "INFO: Running the daemon under test in containerd mode"
|
|
|
|
+ $dutArgs += "--containerd \\.\pipe\containerd-containerd"
|
|
|
|
+ }
|
|
|
|
+
|
|
# Arguments: Are we starting the daemon under test with Hyper-V containers as the default isolation?
|
|
# Arguments: Are we starting the daemon under test with Hyper-V containers as the default isolation?
|
|
if (-not ("$env:DOCKER_DUT_HYPERV" -eq "")) {
|
|
if (-not ("$env:DOCKER_DUT_HYPERV" -eq "")) {
|
|
Write-Host -ForegroundColor Green "INFO: Running the daemon under test with Hyper-V containers as the default"
|
|
Write-Host -ForegroundColor Green "INFO: Running the daemon under test with Hyper-V containers as the default"
|
|
@@ -616,6 +640,15 @@ Try {
|
|
Write-Host -ForegroundColor Green "INFO: Args: $dutArgs"
|
|
Write-Host -ForegroundColor Green "INFO: Args: $dutArgs"
|
|
New-Item -ItemType Directory $env:TEMP\daemon -ErrorAction SilentlyContinue | Out-Null
|
|
New-Item -ItemType Directory $env:TEMP\daemon -ErrorAction SilentlyContinue | Out-Null
|
|
|
|
|
|
|
|
+ # Start containerd first
|
|
|
|
+ if (-not ("$env:DOCKER_WINDOWS_CONTAINERD_RUNTIME" -eq "")) {
|
|
|
|
+ Start-Process "$env:TEMP\binary\containerd.exe" `
|
|
|
|
+ -ArgumentList "--log-level debug" `
|
|
|
|
+ -RedirectStandardOutput "$env:TEMP\containerd.out" `
|
|
|
|
+ -RedirectStandardError "$env:TEMP\containerd.err"
|
|
|
|
+ Write-Host -ForegroundColor Green "INFO: Containerd started successfully."
|
|
|
|
+ }
|
|
|
|
+
|
|
# Cannot fathom why, but always writes to stderr....
|
|
# Cannot fathom why, but always writes to stderr....
|
|
Start-Process "$env:TEMP\binary\dockerd-$COMMITHASH" `
|
|
Start-Process "$env:TEMP\binary\dockerd-$COMMITHASH" `
|
|
-ArgumentList $dutArgs `
|
|
-ArgumentList $dutArgs `
|
|
@@ -840,7 +873,6 @@ Try {
|
|
"`$env`:PATH`='c`:\target;'+`$env:PATH`; `$env:DOCKER_HOST`='tcp`://'+(ipconfig | select -last 1).Substring(39)+'`:2357'; c:\target\runIntegrationCLI.ps1" | Out-Host } )
|
|
"`$env`:PATH`='c`:\target;'+`$env:PATH`; `$env:DOCKER_HOST`='tcp`://'+(ipconfig | select -last 1).Substring(39)+'`:2357'; c:\target\runIntegrationCLI.ps1" | Out-Host } )
|
|
} else {
|
|
} else {
|
|
$env:DOCKER_HOST=$DASHH_CUT
|
|
$env:DOCKER_HOST=$DASHH_CUT
|
|
- $env:PATH="$env:TEMP\binary;$env:PATH;" # Force to use the test binaries, not the host ones.
|
|
|
|
$env:GO111MODULE="off"
|
|
$env:GO111MODULE="off"
|
|
Write-Host -ForegroundColor Green "INFO: DOCKER_HOST at $DASHH_CUT"
|
|
Write-Host -ForegroundColor Green "INFO: DOCKER_HOST at $DASHH_CUT"
|
|
|
|
|
|
@@ -943,6 +975,15 @@ Finally {
|
|
Copy-Item "$env:TEMP\dut.out" "bundles\CIDUT.out" -Force -ErrorAction SilentlyContinue
|
|
Copy-Item "$env:TEMP\dut.out" "bundles\CIDUT.out" -Force -ErrorAction SilentlyContinue
|
|
Write-Host -ForegroundColor Green "INFO: Saving daemon under test log ($env:TEMP\dut.err) to bundles\CIDUT.err"
|
|
Write-Host -ForegroundColor Green "INFO: Saving daemon under test log ($env:TEMP\dut.err) to bundles\CIDUT.err"
|
|
Copy-Item "$env:TEMP\dut.err" "bundles\CIDUT.err" -Force -ErrorAction SilentlyContinue
|
|
Copy-Item "$env:TEMP\dut.err" "bundles\CIDUT.err" -Force -ErrorAction SilentlyContinue
|
|
|
|
+
|
|
|
|
+ Write-Host -ForegroundColor Green "INFO: Saving containerd logs to bundles"
|
|
|
|
+ if (Test-Path -Path "$env:TEMP\containerd.out") {
|
|
|
|
+ Copy-Item "$env:TEMP\containerd.out" "bundles\containerd.out" -Force -ErrorAction SilentlyContinue
|
|
|
|
+ Copy-Item "$env:TEMP\containerd.err" "bundles\containerd.err" -Force -ErrorAction SilentlyContinue
|
|
|
|
+ } else {
|
|
|
|
+ "" | Out-File -FilePath "bundles\containerd.out"
|
|
|
|
+ "" | Out-File -FilePath "bundles\containerd.err"
|
|
|
|
+ }
|
|
}
|
|
}
|
|
|
|
|
|
Set-Location "$env:SOURCES_DRIVE\$env:SOURCES_SUBDIR" -ErrorAction SilentlyContinue
|
|
Set-Location "$env:SOURCES_DRIVE\$env:SOURCES_SUBDIR" -ErrorAction SilentlyContinue
|