-
Notifications
You must be signed in to change notification settings - Fork 2.1k
Migrate TestTrustedCreateFromBadTrustServer from moby into cli/e2e #1517
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
Conversation
|
Please sign your commits following these rules: $ git clone -b "migrate-test-from-moby" git@github.com:glefloch/cli.git somewhere
$ cd somewhere
$ git rebase -i HEAD~842353912952
editor opens
change each 'pick' to 'edit'
save the file and quit
$ git commit --amend -s --no-edit
$ git rebase --continue # and repeat the amend for each commit
$ git push -fAmending updates the existing PR. You DO NOT need to open a new one. |
Codecov Report
@@ Coverage Diff @@
## master #1517 +/- ##
==========================================
- Coverage 55.22% 55.14% -0.08%
==========================================
Files 289 289
Lines 19384 19371 -13
==========================================
- Hits 10705 10683 -22
- Misses 7983 7997 +14
+ Partials 696 691 -5 |
d8d09e7 to
436e05c
Compare
eiais
left a comment
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.
Thanks for working on this!
eiais
left a comment
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.
LGTM. Please squash your commits.
ea062ca to
f568785
Compare
|
@thaJeztah PTAL |
e2e/container/create_test.go
Outdated
| fixtures.WithNotary, | ||
| ).Assert(t, icmd.Expected{ | ||
| ExitCode: 1, | ||
| Err: "remote trust data does not exist for registry:5000/evil-alpine", |
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.
When I look at the removed test on moby/moby I can't see the same result as yours.
Can you add some context in the PR comment to explain why you expect this result, and maybe in the test too?
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.
Good catch! fixtures.WithNotary is using the normal notary server which won't have the evil alpine image.
@glefloch Can you make WithNotary take the notary server as an argument? This will also change the returned error.
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.
Yes, I'm going to make this change and re run tests
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.
Well, updating the WithNotary ends up with the command exitCode equals to 0. There may be another problem with the configuration.
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.
Finally, after looking to the previous test, I was actually missing the first part. I updated the test and report comments from the previous test.
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 can't see the comments from moby/moby test, did you push them?
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.
Sorry for this, I just pushed the update.
silvin-lubecki
left a comment
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.
LGTM for code, but may need some comments in the tests. Thank you @glefloch for this PR!!
c075c19 to
cfc8ebf
Compare
e2e/container/create_test.go
Outdated
| icmd.Command("docker", "create", image), | ||
| fixtures.WithConfig(dir.Path()), | ||
| fixtures.WithTrust, | ||
| fixtures.WithNotaryServer("https://invalidnotaryserver"), |
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.
There is an IETF recommendation for invalid domains: https://tools.ietf.org/html/rfc2606#page-2 - so better to use notary.invalid.
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.
You right, this is better. I pushed the update.
|
One minor comment but otherwise LGTM |
Signed-off-by: glefloch <glfloch@gmail.com>
cfc8ebf to
37679bf
Compare
thaJeztah
left a comment
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.
LGTM, thanks!
Signed-off-by: glefloch glfloch@gmail.com
- What I did
I have migrate
TestTrustedCreateFromBadTrustServerfrommoby/mobyrepository intodocker/clirepository. This aims to closes #1218- How I did it
I have added a new notary-server into
e2etest environment calledevil-notary-server. Then duplicate the behavior of the test describe in moby repository.- How to verify it
You can verify it by running e2e tests.
- Description for the changelog
Add test on container creation using a wrong notary server
- A picture of a cute animal (not mandatory but encouraged)