From 3795dd41aefc833e5647d397baf8712af89278b5 Mon Sep 17 00:00:00 2001 From: "Paul \"TBBle\" Hampson" Date: Tue, 28 Jul 2020 22:33:59 +1000 Subject: [PATCH 1/3] Always report server log from verbose integration test runs If you're adding `-v` to TESTFLAGS, you probably want to see the server logs, as well as the extra output from the testing framework. Signed-off-by: Paul "TBBle" Hampson --- client_test.go | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/client_test.go b/client_test.go index be57edde8..4d6ff964b 100644 --- a/client_test.go +++ b/client_test.go @@ -169,8 +169,9 @@ func TestMain(m *testing.M) { fmt.Fprintln(os.Stderr, "failed to remove test root dir", err) os.Exit(1) } - // only print containerd logs if the test failed - if status != 0 { + + // only print containerd logs if the test failed or tests were run with -v + if status != 0 || testing.Verbose() { fmt.Fprintln(os.Stderr, buf.String()) } } From faa4ff56e41793dfa22041b89ba2c838bacd5714 Mon Sep 17 00:00:00 2001 From: "Paul \"TBBle\" Hampson" Date: Tue, 28 Jul 2020 22:35:33 +1000 Subject: [PATCH 2/3] Usefully fail tests with unknown or bad Windows Build version Signed-off-by: Paul "TBBle" Hampson --- client_windows_test.go | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/client_windows_test.go b/client_windows_test.go index dc92767c3..04e0c1997 100644 --- a/client_windows_test.go +++ b/client_windows_test.go @@ -51,6 +51,12 @@ func init() { testImage = "mcr.microsoft.com/windows/nanoserver:1903" case 18363: // this isn't in osversion yet, but the image should be available testImage = "mcr.microsoft.com/windows/nanoserver:1909" + case 9200: // Missing manifest, so it's running in compatibility mode + fmt.Println("You need to copy Microsoft/hcsshim/test/functional/manifest/rsrc_amd64.syso into the containerd checkout") + panic("Running in Windows 8/Windows Server 2012 compatibility mode, failed to detect Windows build version") + default: + fmt.Println("No test image defined for Windows build version:", b) + panic("No windows test image found for this Windows build") } fmt.Println("Windows test image:", testImage, ", Windows build version:", b) From 1ec1e9eabfbf3290e2a69b9a787a24c318535c14 Mon Sep 17 00:00:00 2001 From: "Paul \"TBBle\" Hampson" Date: Tue, 28 Jul 2020 22:36:00 +1000 Subject: [PATCH 3/3] Add Windows 10/Windows Server 2004 for integration tests Signed-off-by: Paul "TBBle" Hampson --- client_windows_test.go | 2 ++ 1 file changed, 2 insertions(+) diff --git a/client_windows_test.go b/client_windows_test.go index 04e0c1997..d06d975cd 100644 --- a/client_windows_test.go +++ b/client_windows_test.go @@ -51,6 +51,8 @@ func init() { testImage = "mcr.microsoft.com/windows/nanoserver:1903" case 18363: // this isn't in osversion yet, but the image should be available testImage = "mcr.microsoft.com/windows/nanoserver:1909" + case 19041: // this isn't in osversion yet, but the image should be available + testImage = "mcr.microsoft.com/windows/nanoserver:2004" case 9200: // Missing manifest, so it's running in compatibility mode fmt.Println("You need to copy Microsoft/hcsshim/test/functional/manifest/rsrc_amd64.syso into the containerd checkout") panic("Running in Windows 8/Windows Server 2012 compatibility mode, failed to detect Windows build version")