Skip to content

Commit c999d23

Browse files
committed
[testing] Add test
1 parent fff5d9e commit c999d23

File tree

2 files changed

+36
-12
lines changed

2 files changed

+36
-12
lines changed

.cirrus.yml

Lines changed: 29 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,31 @@
1-
freebsd_instance:
2-
image_family: freebsd-13-0
1+
#freebsd_instance:
2+
# image_family: freebsd-13-0
3+
#
4+
#task:
5+
# name: test-freebsd-amd64
6+
# env:
7+
# NERDCTL_RUN_ARGS: --net none knast/freebsd:13-STABLE echo "Nerdctl is up and running."
8+
# install_script:
9+
# - pkg install -y go containerd runj
10+
# - daemon -o containerd.out containerd
11+
# test_script:
12+
# - go test -v ./pkg/...
13+
# - cd cmd/nerdctl
14+
# - sudo go run . run $NERDCTL_RUN_ARGS | grep running
315

4-
task:
5-
name: test-freebsd-amd64
16+
docker_builder:
17+
name: windows
18+
platform: windows
19+
os_version: 2019
620
env:
7-
NERDCTL_RUN_ARGS: --net none knast/freebsd:13-STABLE echo "Nerdctl is up and running."
8-
install_script:
9-
- pkg install -y go containerd runj
10-
- daemon -o containerd.out containerd
11-
test_script:
12-
- go test -v ./pkg/...
13-
- cd cmd/nerdctl
14-
- sudo go run . run $NERDCTL_RUN_ARGS | grep running
21+
CGO_ENABLED: 0
22+
build_script:
23+
- choco install golang
24+
- $Version=1.5.7
25+
- curl.exe -L https://github.com/containerd/containerd/releases/download/v$Version/containerd-$Version-windows-amd64.tar.gz -o containerd-windows-amd64.tar.gz
26+
- Copy-Item -Path ".\bin\" -Destination "$Env:ProgramFiles\containerd" -Recurse -Force
27+
- cd $Env:ProgramFiles\containerd\
28+
- .\containerd.exe config default | Out-File config.toml -Encoding ascii
29+
- .\containerd.exe --register-service
30+
- Start-Service containerd
31+
- go test -v -run ^\QTestRunEnvFile\E$ ./cmd/...

pkg/testutil/testutil.go

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,7 @@ import (
2323
"io"
2424
"os"
2525
"os/exec"
26+
"runtime"
2627
"strings"
2728
"testing"
2829
"time"
@@ -399,6 +400,12 @@ func NewBase(t *testing.T) *Base {
399400
}
400401

401402
func mirrorOf(s string) string {
403+
if runtime.GOOS == "windows" {
404+
// use gcr.io/k8s-staging-e2e-test-images/busybox:1.29-2-windows-amd64-ltsc2022 locally on windows 11
405+
// https://github.com/microsoft/Windows-Containers/issues/179
406+
return "gcr.io/k8s-staging-e2e-test-images/busybox:1.29-2"
407+
}
408+
402409
// plain mirror, NOT stargz-converted images
403410
return fmt.Sprintf("ghcr.io/stargz-containers/%s-org", s)
404411
}

0 commit comments

Comments
 (0)