github.com/containerd/containerd@v22.0.0-20200918172823-438c87b8e050+incompatible/client_windows_test.go (about) 1 /* 2 Copyright The containerd Authors. 3 4 Licensed under the Apache License, Version 2.0 (the "License"); 5 you may not use this file except in compliance with the License. 6 You may obtain a copy of the License at 7 8 http://www.apache.org/licenses/LICENSE-2.0 9 10 Unless required by applicable law or agreed to in writing, software 11 distributed under the License is distributed on an "AS IS" BASIS, 12 WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 See the License for the specific language governing permissions and 14 limitations under the License. 15 */ 16 17 package containerd 18 19 import ( 20 "fmt" 21 "os" 22 "path/filepath" 23 24 "github.com/Microsoft/hcsshim/osversion" 25 _ "github.com/Microsoft/hcsshim/test/functional/manifest" // For rsrc_amd64.syso 26 ) 27 28 const ( 29 defaultAddress = `\\.\pipe\containerd-containerd-test` 30 ) 31 32 var ( 33 defaultRoot = filepath.Join(os.Getenv("programfiles"), "containerd", "root-test") 34 defaultState = filepath.Join(os.Getenv("programfiles"), "containerd", "state-test") 35 testImage string 36 shortCommand = withTrue() 37 longCommand = withProcessArgs("ping", "-t", "localhost") 38 ) 39 40 func init() { 41 b := osversion.Build() 42 switch b { 43 case osversion.RS1: 44 testImage = "mcr.microsoft.com/windows/nanoserver:sac2016" 45 case osversion.RS3: 46 testImage = "mcr.microsoft.com/windows/nanoserver:1709" 47 case osversion.RS4: 48 testImage = "mcr.microsoft.com/windows/nanoserver:1803" 49 case osversion.RS5: 50 testImage = "mcr.microsoft.com/windows/nanoserver:1809" 51 case osversion.V19H1: 52 testImage = "mcr.microsoft.com/windows/nanoserver:1903" 53 case 18363: // this isn't in osversion yet, but the image should be available 54 testImage = "mcr.microsoft.com/windows/nanoserver:1909" 55 case 19041: // this isn't in osversion yet, but the image should be available 56 testImage = "mcr.microsoft.com/windows/nanoserver:2004" 57 default: 58 fmt.Println("No test image defined for Windows build version:", b) 59 panic("No windows test image found for this Windows build") 60 } 61 62 fmt.Println("Windows test image:", testImage, ", Windows build version:", b) 63 }