Skip to content

Commit

Permalink
Merge pull request opencontainers#504 from q384566678/fix-validate-test
Browse files Browse the repository at this point in the history
validate_test: add cwd check to TestCheckProcess
  • Loading branch information
Ma Shimiao authored Nov 3, 2017
2 parents dea65b0 + 630f06a commit 11c0459
Showing 1 changed file with 43 additions and 0 deletions.
43 changes: 43 additions & 0 deletions validate/validate_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -206,6 +206,49 @@ func TestCheckProcess(t *testing.T) {
platform: "linux",
expected: specerror.NonError,
},
{
val: rspec.Spec{
Version: "1.0.0",
Process: &rspec.Process{
Args: []string{"sh"},
Cwd: "/",
},
},
platform: "windows",
expected: specerror.ProcCwdAbs,
},
{
val: rspec.Spec{
Version: "1.0.0",
Process: &rspec.Process{
Args: []string{"sh"},
Cwd: "c:\\foo",
},
},
platform: "linux",
expected: specerror.ProcCwdAbs,
},
{
val: rspec.Spec{
Version: "1.0.0",
Process: &rspec.Process{
Args: []string{"sh"},
Cwd: "c:\\foo",
},
},
platform: "windows",
expected: specerror.NonError,
},
{
val: rspec.Spec{
Version: "1.0.0",
Process: &rspec.Process{
Cwd: "/",
},
},
platform: "linux",
expected: specerror.ProcArgsOneEntryRequired,
},
{
val: rspec.Spec{
Version: "1.0.0",
Expand Down

0 comments on commit 11c0459

Please sign in to comment.