Skip to content

Commit

Permalink
Merge pull request #907 from Letty5411/lxctest
Browse files Browse the repository at this point in the history
bugfix: fix lxc test error
  • Loading branch information
HusterWan authored Mar 17, 2018
2 parents f5dbffe + 5bb886a commit ddc18e0
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 6 deletions.
6 changes: 4 additions & 2 deletions hack/make.sh
Original file line number Diff line number Diff line change
Expand Up @@ -74,8 +74,10 @@ function target()
docker run --rm -v $(pwd):$SOURCEDIR $IMAGE bash -c "make check"
;;
build)
docker run --rm -v $(pwd):$SOURCEDIR $IMAGE bash -c "make build" >$TMP/build.log
install_pouch >$TMP/install.log
docker run --rm -v $(pwd):$SOURCEDIR $IMAGE bash -c "make build" >$TMP/build.log ||
{ echo "make build log:"; cat $TMP/build.log; return 1; }
install_pouch >$TMP/install.log ||
{ echo "install pouch log:"; cat $TMP/install.log; return 1; }
;;
unit-test)
docker run --rm -v $(pwd):$SOURCEDIR $IMAGE bash -c "make unit-test"
Expand Down
7 changes: 5 additions & 2 deletions test/cli_run_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -184,12 +184,15 @@ func (suite *PouchRunSuite) TestRunInWrongWay(c *check.C) {
func (suite *PouchRunSuite) TestRunEnableLxcfs(c *check.C) {
name := "test-run-lxcfs"

res := command.PouchRun("run", "--name", name, "-m", "512M", "--enableLxcfs=true", busyboxImage, "head", "-n", "1", "/proc/meminfo")
command.PouchRun("run", "--name", name, "-m", "512M", "--enableLxcfs=true",
busyboxImage, "sleep", "10000").Assert(c, icmd.Success)

res := command.PouchRun("exec", name, "head", "-n", "5", "/proc/meminfo")
res.Assert(c, icmd.Success)

// the memory should be equal to 512M
if out := res.Combined(); !strings.Contains(out, "524288 kB") {
c.Fatalf("upexpected output %s expected %s\n", out, "524288 kB")
c.Fatalf("upexpected output %v, expected %s\n", res, "524288 kB")
}
DelContainerForceMultyTime(c, name)
}
Expand Down
4 changes: 2 additions & 2 deletions test/cli_top_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -17,8 +17,8 @@ func init() {
check.Suite(&PouchTopSuite{})
}

// SetupSuite does common setup in the beginning of each test suite.
func (suite *PouchTopSuite) SetupSuite(c *check.C) {
// SetUpSuite does common setup in the beginning of each test suite.
func (suite *PouchTopSuite) SetUpSuite(c *check.C) {
SkipIfFalse(c, environment.IsLinux)

environment.PruneAllContainers(apiClient)
Expand Down

0 comments on commit ddc18e0

Please sign in to comment.