Skip to content

Commit

Permalink
test: fix TestRunWithoutCapability not take effect
Browse files Browse the repository at this point in the history
fix TestRunWithoutCapability not check error, test alway get pass
even the test is fail.

Signed-off-by: Ace-Tang <aceapril@126.com>
  • Loading branch information
Ace-Tang authored and allencloud committed Dec 25, 2018
1 parent b34d318 commit ae86ab3
Showing 1 changed file with 5 additions and 3 deletions.
8 changes: 5 additions & 3 deletions test/cli_run_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -223,13 +223,15 @@ func (suite *PouchRunSuite) TestRunWithCapability(c *check.C) {

// TestRunWithoutCapability tests running container with --cap-drop
func (suite *PouchRunSuite) TestRunWithoutCapability(c *check.C) {
capability := "chown"
capability := "CHOWN"
name := "run-capability"
expt := icmd.Expected{
Err: "Operation not permitted",
ExitCode: 1,
Out: "Operation not permitted",
}
command.PouchRun("run", "--name", name, "--cap-drop", capability,
err := command.PouchRun("run", "--name", name, "--cap-drop", capability,
busyboxImage, "chown", "755", "/tmp").Compare(expt)
c.Assert(err, check.IsNil)
defer DelContainerForceMultyTime(c, name)
}

Expand Down

0 comments on commit ae86ab3

Please sign in to comment.