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.apiv2: add test cases for committing an image from a container #6461

Merged
merged 1 commit into from
Jun 3, 2020
Merged

test.apiv2: add test cases for committing an image from a container #6461

merged 1 commit into from
Jun 3, 2020

Conversation

chuanchang
Copy link
Contributor

Testing query parameters: container, repo, tag, comment, author, pause.

ok 1 [20-containers] GET libpod/containers/json (at start: clean slate) : status=200
ok 2 [20-containers] GET libpod/containers/json (at start: clean slate) : length=0
ok 3 [20-containers] GET libpod/containers/json : status=200
ok 4 [20-containers] GET libpod/containers/json : length=0
ok 5 [20-containers] GET libpod/containers/json?all=true : status=200
ok 6 [20-containers] GET libpod/containers/json?all=true : length=1
ok 7 [20-containers] GET libpod/containers/json?all=true : .[0].Id~[0-9a-f]\{12\}
ok 8 [20-containers] GET libpod/containers/json?all=true : .[0].Image=quay.io/libpod/alpine_labels:latest
ok 9 [20-containers] GET libpod/containers/json?all=true : .[0].Command[0]=true
ok 10 [20-containers] GET libpod/containers/json?all=true : .[0].State~\(exited\|stopped\)
ok 11 [20-containers] GET libpod/containers/json?all=true : .[0].ExitCode=0
ok 12 [20-containers] GET libpod/containers/json?all=true : .[0].IsInfra=false
ok 13 [20-containers] DELETE libpod/containers/35b5ea620e953e6132ec0f248e61c7136da20bf9c245c467ec0b6aeccadcbf10 : status=204
ok 14 [20-containers] GET libpod/containers/json?all=true : status=200
ok 15 [20-containers] POST libpod/commit?container=nonesuch [] : status=404
ok 16 [20-containers] POST libpod/commit?container=myfoo&repo=newrepo&comment=foo&author=bob [] : status=500
ok 17 [20-containers] POST libpod/commit?container=myfoo [] : status=200
ok 18 [20-containers] GET libpod/images/43dee98fd21c79e14d3b610bd7e8d7efd0cccf01763b7eed2e6d606d2f391a9c/json : status=200
ok 19 [20-containers] GET libpod/images/43dee98fd21c79e14d3b610bd7e8d7efd0cccf01763b7eed2e6d606d2f391a9c/json : .RepoTags[0]=null
ok 20 [20-containers] GET libpod/images/43dee98fd21c79e14d3b610bd7e8d7efd0cccf01763b7eed2e6d606d2f391a9c/json : .Author=
ok 21 [20-containers] GET libpod/images/43dee98fd21c79e14d3b610bd7e8d7efd0cccf01763b7eed2e6d606d2f391a9c/json : .Comment=
ok 22 [20-containers] POST libpod/commit?container=myfoo&repo=newrepo&comment=foo&author=bob&format=docker [] : status=200
ok 23 [20-containers] GET libpod/images/newrepo:latest/json : status=200
ok 24 [20-containers] GET libpod/images/newrepo:latest/json : .RepoTags[0]=localhost/newrepo:latest
ok 25 [20-containers] GET libpod/images/newrepo:latest/json : .Author=bob
ok 26 [20-containers] GET libpod/images/newrepo:latest/json : .Comment=foo
ok 27 [20-containers] POST libpod/commit?container=453ccae856ebd4fd4de0f1238edb5d63bb1e9b378a913613f09eef07c9b844d2&repo=newrepo&tag=v1&author=alice&pause=false [] : status=200
ok 28 [20-containers] GET libpod/images/newrepo:v1/json : status=200
ok 29 [20-containers] GET libpod/images/newrepo:v1/json : .RepoTags[0]=localhost/newrepo:v1
ok 30 [20-containers] GET libpod/images/newrepo:v1/json : .Author=alice
ok 31 [20-containers] POST libpod/commit?container=453ccae856eb&repo=newrepo&tag=v2&comment=bar&author=eric&format=docker&pause=true [] : status=200
ok 32 [20-containers] GET libpod/images/newrepo:v2/json : status=200
ok 33 [20-containers] GET libpod/images/newrepo:v2/json : .RepoTags[0]=localhost/newrepo:v2
ok 34 [20-containers] GET libpod/images/newrepo:v2/json : .Author=eric
ok 35 [20-containers] GET libpod/images/newrepo:v2/json : .Comment=bar
ok 36 [20-containers] DELETE images/localhost/newrepo:latest?force=true : status=200
ok 37 [20-containers] DELETE images/localhost/newrepo:v1?force=true : status=200
ok 38 [20-containers] DELETE images/localhost/newrepo:v2?force=true : status=200
ok 39 [20-containers] DELETE libpod/containers/453ccae856ebd4fd4de0f1238edb5d63bb1e9b378a913613f09eef07c9b844d2 : status=204
1..39

Signed-off-by: Alex Jia [email protected]

@openshift-ci-robot openshift-ci-robot added the needs-ok-to-test Indicates a PR that requires an org member to verify it is safe to test. label Jun 2, 2020
@openshift-ci-robot
Copy link
Collaborator

Hi @chuanchang. Thanks for your PR.

I'm waiting for a containers member to verify that this patch is reasonable to test. If it is, they should reply with /ok-to-test on its own line. Until that is done, I will not automatically test new commits in this PR, but the usual testing commands by org members will still work. Regular contributors should join the org to skip this step.

Once the patch is verified, the new status will be reflected by the ok-to-test label.

I understand the commands that are listed here.

Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes/test-infra repository.

@rhatdan
Copy link
Member

rhatdan commented Jun 2, 2020

/ok-to-test
/approve

@openshift-ci-robot openshift-ci-robot added ok-to-test approved Indicates a PR has been approved by an approver from all required OWNERS files. and removed needs-ok-to-test Indicates a PR that requires an org member to verify it is safe to test. labels Jun 2, 2020
@baude
Copy link
Member

baude commented Jun 2, 2020

@chuanchang thanks for your contributions! Excellent!
LGTM

@mheon
Copy link
Member

mheon commented Jun 2, 2020

LGTM, but would like a final signoff from @edsantiago

Copy link
Member

@edsantiago edsantiago left a comment

Choose a reason for hiding this comment

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

Nice work! One wording change request, and two places where you should do result validation. LGTM after that, thank you.

test/apiv2/20-containers.at Outdated Show resolved Hide resolved
test/apiv2/20-containers.at Outdated Show resolved Hide resolved
test/apiv2/20-containers.at Outdated Show resolved Hide resolved
Testing query parameters: container, repo, tag, comment, author, changes
and pause.

Signed-off-by: Alex Jia <[email protected]>
@chuanchang
Copy link
Contributor Author

Nice work! One wording change request, and two places where you should do result validation. LGTM after that, thank you.

@edsantiago thank you, done, and also added testing for 'changes' query parameter, test result as below.

ok 1 [20-containers] GET libpod/containers/json (at start: clean slate) : status=200
ok 2 [20-containers] GET libpod/containers/json (at start: clean slate) : length=0
ok 3 [20-containers] GET libpod/containers/json : status=200
ok 4 [20-containers] GET libpod/containers/json : length=0
ok 5 [20-containers] GET libpod/containers/json?all=true : status=200
ok 6 [20-containers] GET libpod/containers/json?all=true : length=1
ok 7 [20-containers] GET libpod/containers/json?all=true : .[0].Id~[0-9a-f]\{12\}
ok 8 [20-containers] GET libpod/containers/json?all=true : .[0].Image=quay.io/libpod/alpine_labels:latest
ok 9 [20-containers] GET libpod/containers/json?all=true : .[0].Command[0]=true
ok 10 [20-containers] GET libpod/containers/json?all=true : .[0].State~\(exited\|stopped\)
ok 11 [20-containers] GET libpod/containers/json?all=true : .[0].ExitCode=0
ok 12 [20-containers] GET libpod/containers/json?all=true : .[0].IsInfra=false
ok 13 [20-containers] DELETE libpod/containers/0fd5f2f6afdd47d7be32f652831e5305fedd62bd3b18c5925d8777b2bf26d2e6 : status=204
ok 14 [20-containers] GET libpod/containers/json?all=true : status=200
ok 15 [20-containers] GET libpod/containers/json?all=true : .[0].Id~[0-9a-f]\{12\}
ok 16 [20-containers] POST libpod/commit?container=nonesuch [] : status=404
ok 17 [20-containers] POST libpod/commit?container=myfoo&repo=newrepo&comment=foo&author=bob [] : status=500
ok 18 [20-containers] POST libpod/commit?container=myfoo [] : status=200
ok 19 [20-containers] POST libpod/commit?container=myfoo [] : .Id~[0-9a-f]\{12\}
ok 20 [20-containers] GET libpod/images/20a38ea39f2c7b0d7c31261223fbdf36ccf9c39f1cf8b9c3643a7e184782f48c/json : status=200
ok 21 [20-containers] GET libpod/images/20a38ea39f2c7b0d7c31261223fbdf36ccf9c39f1cf8b9c3643a7e184782f48c/json : .RepoTags[0]=null
ok 22 [20-containers] GET libpod/images/20a38ea39f2c7b0d7c31261223fbdf36ccf9c39f1cf8b9c3643a7e184782f48c/json : .Author=
ok 23 [20-containers] GET libpod/images/20a38ea39f2c7b0d7c31261223fbdf36ccf9c39f1cf8b9c3643a7e184782f48c/json : .Comment=
ok 24 [20-containers] POST libpod/commit?container=myfoo&repo=newrepo&comment=foo&author=bob&format=docker [] : status=200
ok 25 [20-containers] GET libpod/images/newrepo:latest/json : status=200
ok 26 [20-containers] GET libpod/images/newrepo:latest/json : .RepoTags[0]=localhost/newrepo:latest
ok 27 [20-containers] GET libpod/images/newrepo:latest/json : .Author=bob
ok 28 [20-containers] GET libpod/images/newrepo:latest/json : .Comment=foo
ok 29 [20-containers] POST libpod/commit?container=037be41b4d9853e0e8d1a694319f3244c46ddd44bd85b3de2653f2d9b0c14d05&repo=newrepo&tag=v1&author=alice&pause=false [] : status=200
ok 30 [20-containers] GET libpod/images/newrepo:v1/json : status=200
ok 31 [20-containers] GET libpod/images/newrepo:v1/json : .RepoTags[0]=localhost/newrepo:v1
ok 32 [20-containers] GET libpod/images/newrepo:v1/json : .Author=alice
ok 33 [20-containers] POST libpod/commit?container=037be41b4d98&repo=newrepo&tag=v2&comment=bar&author=eric&format=docker&changes=CMD=/bin/foo&pause=true [] : status=200
ok 34 [20-containers] GET libpod/images/newrepo:v2/json : status=200
ok 35 [20-containers] GET libpod/images/newrepo:v2/json : .RepoTags[0]=localhost/newrepo:v2
ok 36 [20-containers] GET libpod/images/newrepo:v2/json : .Author=eric
ok 37 [20-containers] GET libpod/images/newrepo:v2/json : .Comment=bar
ok 38 [20-containers] GET libpod/images/newrepo:v2/json : .Config.Cmd[-1]=/bin/foo
ok 39 [20-containers] DELETE images/localhost/newrepo:latest?force=true : status=200
ok 40 [20-containers] DELETE images/localhost/newrepo:v1?force=true : status=200
ok 41 [20-containers] DELETE images/localhost/newrepo:v2?force=true : status=200
ok 42 [20-containers] DELETE libpod/containers/037be41b4d9853e0e8d1a694319f3244c46ddd44bd85b3de2653f2d9b0c14d05 : status=204
1..42

@openshift-ci-robot
Copy link
Collaborator

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: chuanchang, edsantiago, rhatdan

The full list of commands accepted by this bot can be found here.

The pull request process is described here

Needs approval from an approver in each of these files:

Approvers can indicate their approval by writing /approve in a comment
Approvers can cancel approval by writing /approve cancel in a comment

@edsantiago
Copy link
Member

Nice work, thank you!

/lgtm

[Quick suggestion for next time: it is not necessary to paste in test results.]

@openshift-ci-robot openshift-ci-robot added the lgtm Indicates that a PR is ready to be merged. label Jun 3, 2020
@openshift-merge-robot openshift-merge-robot merged commit 377554d into containers:master Jun 3, 2020
edsantiago added a commit to edsantiago/libpod that referenced this pull request Jun 3, 2020
 - (minor): apiv2 tests: check for full ID

   Observation made while reviewing containers#6461: tests were checking
   only for a 12-character container/image ID in return value.
   It's actually 64, and we should test for that. This should
   also minimize confusion in a future maintainer.

 - podman pause/unpause: new test

   Runs a 'date/sleep' loop, pauses container, sleeps 3s,
   restarts, then confirms that there's a 3- to 6-second
   gap in the logs for the container.

 - podman healthcheck: new test

   run a container with healthcheck, test both healthy
   and unhealthy conditions

 - podman pod: check '{{.Pod}}' field in podman ps

   Hey, as long as we have a pod with two running
   containers, might as well confirm that 'podman ps'
   returns the expected pod ID.

Signed-off-by: Ed Santiago <[email protected]>
@github-actions github-actions bot added the locked - please file new issue/PR Assist humans wanting to comment on an old issue or PR with locked comments. label Sep 25, 2023
@github-actions github-actions bot locked as resolved and limited conversation to collaborators Sep 25, 2023
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
approved Indicates a PR has been approved by an approver from all required OWNERS files. lgtm Indicates that a PR is ready to be merged. locked - please file new issue/PR Assist humans wanting to comment on an old issue or PR with locked comments. ok-to-test
Projects
None yet
Development

Successfully merging this pull request may close these issues.

7 participants