Skip to content

Commit

Permalink
[testing] Add test
Browse files Browse the repository at this point in the history
  • Loading branch information
jsturtevant committed Nov 9, 2021
1 parent fff5d9e commit c999d23
Show file tree
Hide file tree
Showing 2 changed files with 36 additions and 12 deletions.
41 changes: 29 additions & 12 deletions .cirrus.yml
Original file line number Diff line number Diff line change
@@ -1,14 +1,31 @@
freebsd_instance:
image_family: freebsd-13-0
#freebsd_instance:
# image_family: freebsd-13-0
#
#task:
# name: test-freebsd-amd64
# env:
# NERDCTL_RUN_ARGS: --net none knast/freebsd:13-STABLE echo "Nerdctl is up and running."
# install_script:
# - pkg install -y go containerd runj
# - daemon -o containerd.out containerd
# test_script:
# - go test -v ./pkg/...
# - cd cmd/nerdctl
# - sudo go run . run $NERDCTL_RUN_ARGS | grep running

task:
name: test-freebsd-amd64
docker_builder:
name: windows
platform: windows
os_version: 2019
env:
NERDCTL_RUN_ARGS: --net none knast/freebsd:13-STABLE echo "Nerdctl is up and running."
install_script:
- pkg install -y go containerd runj
- daemon -o containerd.out containerd
test_script:
- go test -v ./pkg/...
- cd cmd/nerdctl
- sudo go run . run $NERDCTL_RUN_ARGS | grep running
CGO_ENABLED: 0
build_script:
- choco install golang
- $Version=1.5.7
- curl.exe -L https://github.com/containerd/containerd/releases/download/v$Version/containerd-$Version-windows-amd64.tar.gz -o containerd-windows-amd64.tar.gz
- Copy-Item -Path ".\bin\" -Destination "$Env:ProgramFiles\containerd" -Recurse -Force
- cd $Env:ProgramFiles\containerd\
- .\containerd.exe config default | Out-File config.toml -Encoding ascii
- .\containerd.exe --register-service
- Start-Service containerd
- go test -v -run ^\QTestRunEnvFile\E$ ./cmd/...
7 changes: 7 additions & 0 deletions pkg/testutil/testutil.go
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,7 @@ import (
"io"
"os"
"os/exec"
"runtime"
"strings"
"testing"
"time"
Expand Down Expand Up @@ -399,6 +400,12 @@ func NewBase(t *testing.T) *Base {
}

func mirrorOf(s string) string {
if runtime.GOOS == "windows" {
// use gcr.io/k8s-staging-e2e-test-images/busybox:1.29-2-windows-amd64-ltsc2022 locally on windows 11
// https://github.com/microsoft/Windows-Containers/issues/179
return "gcr.io/k8s-staging-e2e-test-images/busybox:1.29-2"
}

// plain mirror, NOT stargz-converted images
return fmt.Sprintf("ghcr.io/stargz-containers/%s-org", s)
}
Expand Down

0 comments on commit c999d23

Please sign in to comment.