Fix client tests to work on Windows.
- Powershell is no longer available in nanoserver, so change commands to run accordingly. - Set platform specific commands for short and long running containers - Skips 2 tests which do not run on Windows. Signed-off-by: Brian Goff <cpuguy83@gmail.com>
This commit is contained in:
@@ -31,13 +31,13 @@ const newLine = "\r\n"
|
||||
|
||||
func withExitStatus(es int) oci.SpecOpts {
|
||||
return func(_ context.Context, _ oci.Client, _ *containers.Container, s *specs.Spec) error {
|
||||
s.Process.Args = []string{"powershell", "-noprofile", "exit", strconv.Itoa(es)}
|
||||
s.Process.Args = []string{"cmd", "/c", "exit", strconv.Itoa(es)}
|
||||
return nil
|
||||
}
|
||||
}
|
||||
|
||||
func withProcessArgs(args ...string) oci.SpecOpts {
|
||||
return oci.WithProcessArgs(append([]string{"powershell", "-noprofile"}, args...)...)
|
||||
return oci.WithProcessArgs(append([]string{"cmd", "/c"}, args...)...)
|
||||
}
|
||||
|
||||
func withCat() oci.SpecOpts {
|
||||
@@ -49,9 +49,9 @@ func withTrue() oci.SpecOpts {
|
||||
}
|
||||
|
||||
func withExecExitStatus(s *specs.Process, es int) {
|
||||
s.Args = []string{"powershell", "-noprofile", "exit", strconv.Itoa(es)}
|
||||
s.Args = []string{"cmd", "/c", "exit", strconv.Itoa(es)}
|
||||
}
|
||||
|
||||
func withExecArgs(s *specs.Process, args ...string) {
|
||||
s.Args = append([]string{"powershell", "-noprofile"}, args...)
|
||||
s.Args = append([]string{"cmd", "/c"}, args...)
|
||||
}
|
||||
|
Reference in New Issue
Block a user