.github: add Ubuntu VM test

Signed-off-by: David Crawshaw <crawshaw@tailscale.com>
pull/2759/head
David Crawshaw 3 years ago committed by David Crawshaw
parent 73280595a8
commit 9b7fc2ed1f

@ -1,31 +1,30 @@
name: "integration-vms" name: VM
on: on:
pull_request: pull_request:
paths: branches:
- "tstest/integration/vms/**" - '*'
release:
types: [ created ]
jobs: jobs:
experimental-linux-vm-test: ubuntu2004-LTS-cloud-base:
# To set up a new runner, see tstest/integration/vms/runner.nix runs-on: [ self-hosted, linux, vm ]
runs-on: [ self-hosted, linux, vm_integration_test ]
if: "!contains(github.event.head_commit.message, '[ci skip]')" if: "!contains(github.event.head_commit.message, '[ci skip]')"
steps: steps:
- name: Set up Go
uses: actions/setup-go@v1
with:
go-version: 1.17
id: go
- name: Checkout Code - name: Checkout Code
uses: actions/checkout@v1 uses: actions/checkout@v1
- name: Download VM Images
run: go test ./tstest/integration/vms -run-vm-tests -run=Download -timeout=60m -no-s3
env:
XDG_CACHE_HOME: "/var/lib/ghrunner/cache"
- name: Run VM tests - name: Run VM tests
run: go test ./tstest/integration/vms -v -run-vm-tests run: go test ./tstest/integration/vms -v -no-s3 -run-vm-tests -run=TestRunUbuntu2004
env: env:
HOME: "/tmp"
TMPDIR: "/tmp" TMPDIR: "/tmp"
XDG_CACHE_HOME: "/var/lib/ghrunner/cache" XDG_CACHE_HOME: "/var/lib/ghrunner/cache"

@ -246,13 +246,14 @@ func fetchDistro(t *testing.T, resultDistro Distro) string {
t.Fatalf("%s replied %s", resultDistro.URL, resp.Status) t.Fatalf("%s replied %s", resultDistro.URL, resp.Status)
} }
if _, err = io.Copy(fout, resp.Body); err != nil { if n, err := io.Copy(fout, resp.Body); err != nil {
t.Fatalf("download of %s failed: %v", resultDistro.URL, err) t.Fatalf("download of %s failed: %v", resultDistro.URL, err)
} else if n == 0 {
t.Fatalf("download of %s got zero-length file", resultDistro.URL)
} }
resp.Body.Close() resp.Body.Close()
err = fout.Close() if err = fout.Close(); err != nil {
if err != nil {
t.Fatalf("can't close fout: %v", err) t.Fatalf("can't close fout: %v", err)
} }

Loading…
Cancel
Save