.github: add Ubuntu VM test

Signed-off-by: David Crawshaw <crawshaw@tailscale.com>
This commit is contained in:
David Crawshaw
2021-08-31 07:17:07 -07:00
committed by David Crawshaw
parent 73280595a8
commit 9b7fc2ed1f
2 changed files with 17 additions and 17 deletions

View File

@@ -246,13 +246,14 @@ func fetchDistro(t *testing.T, resultDistro Distro) string {
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)
} else if n == 0 {
t.Fatalf("download of %s got zero-length file", resultDistro.URL)
}
resp.Body.Close()
err = fout.Close()
if err != nil {
if err = fout.Close(); err != nil {
t.Fatalf("can't close fout: %v", err)
}