-
-func (s *TestSuite) TestStdoutNoSuchDir(c *C) {
- tmpdir, _ := ioutil.TempDir("", "test-stdout")
- defer func() {
- os.RemoveAll(tmpdir)
- }()
-
- helperRecord := `{`
- helperRecord += `"command": ["/bin/sh", "-c", "echo $FROBIZ"],`
- helperRecord += `"container_image": "d4ab34d3d4f8a72f5c4973051ae69fab+122",`
- helperRecord += `"cwd": "/bin",`
- helperRecord += `"environment": {"FROBIZ": "bilbo"},`
- helperRecord += `"mounts": {"stdout": {"kind": "file", "path": "` + tmpdir + `/nosuchsubdir/a/b/c.out"} },`
- helperRecord += `"output_path": "` + tmpdir + `/nosuchsubdir",`
- helperRecord += `"priority": 1,`
- helperRecord += `"runtime_constraints": {}`
- helperRecord += `}`
-
- _, _, err := StdoutErrorRunHelper(c, helperRecord, func(t *TestDockerClient) {})
- c.Check(err, NotNil)
- c.Check(strings.Contains(err.Error(), "/nosuchsubdir: no such file or directory"), Equals, true)
-}