Skip to content

Commit

Permalink
fix: volume test fails in custom version pouch
Browse files Browse the repository at this point in the history
make TestRunWithVolumeCopyData compatible with different situation

Signed-off-by: zhuangqh <zhuangqhc@gmail.com>
  • Loading branch information
zhuangqh authored and fuweid committed Dec 7, 2018
1 parent 0270a79 commit 7101cf2
Showing 1 changed file with 7 additions and 2 deletions.
9 changes: 7 additions & 2 deletions test/cli_run_volume_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ import (
"strings"

"github.com/alibaba/pouch/apis/types"
"github.com/alibaba/pouch/pkg/utils"
"github.com/alibaba/pouch/test/command"
"github.com/alibaba/pouch/test/environment"

Expand Down Expand Up @@ -93,8 +94,12 @@ func (suite *PouchRunVolumeSuite) TestRunWithVolumeCopyData(c *check.C) {
defer DelContainerForceMultyTime(c, containerName1)
output1 := icmd.RunCommand("ls", DefaultVolumeMountPath+"/"+volumeName).Stdout()
lines := strings.Split(output1, "\n")
c.Assert(lines[0], check.Equals, "spool")
c.Assert(lines[1], check.Equals, "www")
if !utils.StringInSlice(lines, "spool") {
c.Fatalf("expected \"spool\" directory under /var directory, but got %s", output1)
}
if !utils.StringInSlice(lines, "www") {
c.Fatalf("expected \"www\" directory under /var directory, but got %s", output1)
}

command.PouchRun("run", "-t", "-v", hostdir+":/var", "--name", containerName2, busyboxImage, "ls", "/var").Assert(c, icmd.Success)
defer DelContainerForceMultyTime(c, containerName2)
Expand Down

0 comments on commit 7101cf2

Please sign in to comment.