-
Notifications
You must be signed in to change notification settings - Fork 950
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
feature: add lxcfs flag to cli #534
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -118,3 +118,23 @@ func (suite *PouchCreateSuite) TestCreateWithLabels(c *check.C) { | |
c.Errorf("failed to set label: %s", label) | ||
} | ||
} | ||
|
||
// TestCreateEnableLxcfs tries to test create a container with lxcfs. | ||
func (suite *PouchCreateSuite) TestCreateEnableLxcfs(c *check.C) { | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Actually currently pouchd has enabled lxcfs by default, right? @CodeJuan @Letty5411 There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. It's causeed by the environment. |
||
name := "create-lxcfs" | ||
|
||
res := command.PouchRun("create", "--name", name, "--enableLxcfs=true", busyboxImage) | ||
res.Assert(c, icmd.Success) | ||
|
||
output := command.PouchRun("inspect", name).Stdout() | ||
|
||
result := &types.ContainerJSON{} | ||
if err := json.Unmarshal([]byte(output), result); err != nil { | ||
c.Errorf("failed to decode inspect output: %v", err) | ||
} | ||
c.Assert(result.Config.EnableLxcfs, check.NotNil) | ||
|
||
if result.Config.EnableLxcfs != true { | ||
c.Errorf("failed to set EnableLxcfs") | ||
} | ||
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think this function is a little bit in mess, and we need to make it more clear.