Skip to content
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

test: add all states container restart validation #1549

Merged

Conversation

allencloud
Copy link
Collaborator

@allencloud allencloud commented Jun 19, 2018

Signed-off-by: Allen Sun [email protected]

Ⅰ. Describe what this PR did

This pr changes the test cases for restart action:

  1. add command in running container;
    2.add containers with all states to check the restart action, like running, exited, stopped, created.

this is similar to #1548

Ⅱ. Does this pull request fix one issue?

none

Ⅲ. Describe how you did it

none

Ⅳ. Describe how to verify it

none

Ⅴ. Special notes for reviews

@Letty5411

@codecov-io
Copy link

codecov-io commented Jun 19, 2018

Codecov Report

Merging #1549 into master will decrease coverage by 1.88%.
The diff coverage is n/a.

Impacted file tree graph

@@            Coverage Diff             @@
##           master    #1549      +/-   ##
==========================================
- Coverage   41.21%   39.33%   -1.89%     
==========================================
  Files         266      266              
  Lines       17313    17968     +655     
==========================================
- Hits         7136     7068      -68     
- Misses       9290    10022     +732     
+ Partials      887      878       -9
Impacted Files Coverage Δ
apis/opts/log_options.go 0% <0%> (-100%) ⬇️
daemon/logger/loggerutils/tag.go 0% <0%> (-81.82%) ⬇️
daemon/logger/syslog/validate.go 0% <0%> (-50.55%) ⬇️
daemon/logger/syslog/syslog.go 0% <0%> (-25%) ⬇️
daemon/containerio/options.go 30.76% <0%> (-20.03%) ⬇️
daemon/containerio/jsonfile.go 55.91% <0%> (-17.33%) ⬇️
daemon/mgr/container.go 34.07% <0%> (-15.11%) ⬇️
daemon/mgr/container_logs.go 72.54% <0%> (-11.67%) ⬇️
daemon/mgr/container_validation.go 41.17% <0%> (-5.5%) ⬇️
pkg/utils/utils.go 85.18% <0%> (-3.71%) ⬇️
... and 5 more

defer DelContainerForceMultyTime(c, name)

res.Assert(c, icmd.Success)
time.Sleep(1 * time.Second)
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

why this sleep is required? As you don't use -d in line 69, container is expected to be in exited state as soon as it returns, right?

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

My fault, I added -d.

@allencloud allencloud force-pushed the add-command-in-test branch from 2da4ead to e150e43 Compare June 19, 2018 11:33
@Letty5411
Copy link
Contributor

LGTM

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
areas/test LGTM one maintainer or community participant agrees to merge the pull reuqest. size/M
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants