{"action":"created","comment":{"url":"https://api.github.com/repos/docker/cli/pulls/comments/235327300","pull_request_review_id":177164971,"id":235327300,"node_id":"MDI0OlB1bGxSZXF1ZXN0UmV2aWV3Q29tbWVudDIzNTMyNzMwMA==","diff_hunk":"@@ -32,4 +32,50 @@ func TestCreateWithContentTrust(t *testing.T) {\n \t})\n }\n \n-// FIXME(vdemeester) TestTrustedCreateFromBadTrustServer needs to be backport too (see https://github.com/moby/moby/pull/36515/files#diff-4b1e56bb77ac16f2ccf956fc24cf0a82L331)\n+func TestTrustedCreateFromUnreachableTrustServer(t *testing.T) {\n+\tdir := fixtures.SetupConfigFile(t)\n+\tdefer dir.Remove()\n+\timage := fixtures.CreateMaskedTrustedRemoteImage(t, registryPrefix, \"trust-create\", \"latest\")\n+\n+\tresult := icmd.RunCmd(\n+\t\ticmd.Command(\"docker\", \"create\", image),\n+\t\tfixtures.WithConfig(dir.Path()),\n+\t\tfixtures.WithTrust,\n+\t\tfixtures.WithNotaryServer(\"https://invalidnotaryserver\"),\n+\t)\n+\tresult.Assert(t, icmd.Expected{\n+\t\tExitCode: 1,\n+\t\tErr:      \"error contacting notary server\",\n+\t})\n+}\n+\n+func TestTrustedCreateFromBadTrustServer(t *testing.T) {\n+\tdir := fixtures.SetupConfigFile(t)\n+\tdefer dir.Remove()\n+\n+\tevilNotaryDir := fixtures.SetupConfigFileWithNotaryURL(t, fixtures.EvilNotaryURL)\n+\tdefer evilNotaryDir.Remove()\n+\n+\tevilImageName := \"registry:5000/evil-alpine:latest\"\n+\ticmd.RunCmd(icmd.Command(\"docker\", \"pull\", fixtures.AlpineImage)).Assert(t, icmd.Success)\n+\ticmd.RunCmd(icmd.Command(\"docker\", \"tag\", fixtures.AlpineImage, evilImageName),\n+\t\tfixtures.WithConfig(evilNotaryDir.Path()),\n+\t).Assert(t, icmd.Success)\n+\ticmd.RunCmd(icmd.Command(\"docker\", \"image\", \"push\", evilImageName),\n+\t\tfixtures.WithConfig(evilNotaryDir.Path()),\n+\t\tfixtures.WithPassphrase(\"root_password\", \"repo_password\"),\n+\t\tfixtures.WithTrust,\n+\t\tfixtures.WithNotaryServer(fixtures.EvilNotaryURL),\n+\t).Assert(t, icmd.Success)\n+\n+\ticmd.RunCmd(icmd.Command(\"docker\", \"image\", \"rm\", evilImageName)).Assert(t, icmd.Success)\n+\n+\ticmd.RunCmd(icmd.Command(\"docker\", \"create\", evilImageName),\n+\t\tfixtures.WithConfig(dir.Path()),\n+\t\tfixtures.WithTrust,\n+\t\tfixtures.WithNotary,\n+\t).Assert(t, icmd.Expected{\n+\t\tExitCode: 1,\n+\t\tErr:      \"remote trust data does not exist for registry:5000/evil-alpine\",","path":"e2e/container/create_test.go","position":49,"original_position":49,"commit_id":"f568785962efacda8d7dba6b21211b6b41f87556","original_commit_id":"f568785962efacda8d7dba6b21211b6b41f87556","user":{"login":"silvin-lubecki","id":31478878,"node_id":"MDQ6VXNlcjMxNDc4ODc4","avatar_url":"https://avatars0.githubusercontent.com/u/31478878?v=4","gravatar_id":"","url":"https://api.github.com/users/silvin-lubecki","html_url":"https://github.com/silvin-lubecki","followers_url":"https://api.github.com/users/silvin-lubecki/followers","following_url":"https://api.github.com/users/silvin-lubecki/following{/other_user}","gists_url":"https://api.github.com/users/silvin-lubecki/gists{/gist_id}","starred_url":"https://api.github.com/users/silvin-lubecki/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/silvin-lubecki/subscriptions","organizations_url":"https://api.github.com/users/silvin-lubecki/orgs","repos_url":"https://api.github.com/users/silvin-lubecki/repos","events_url":"https://api.github.com/users/silvin-lubecki/events{/privacy}","received_events_url":"https://api.github.com/users/silvin-lubecki/received_events","type":"User","site_admin":false},"body":"When I look at the [removed test](https://github.com/moby/moby/pull/36515/files#diff-4b1e56bb77ac16f2ccf956fc24cf0a82L360) on `moby/moby` I can't see the same result as yours.\r\nCan you add some context in the PR comment to explain why you expect this result, and maybe in the test too?","created_at":"2018-11-21T10:17:22Z","updated_at":"2018-11-21T10:17:22Z","html_url":"https://github.com/docker/cli/pull/1517#discussion_r235327300","pull_request_url":"https://api.github.com/repos/docker/cli/pulls/1517","author_association":"CONTRIBUTOR","_links":{"self":{"href":"https://api.github.com/repos/docker/cli/pulls/comments/235327300"},"html":{"href":"https://github.com/docker/cli/pull/1517#discussion_r235327300"},"pull_request":{"href":"https://api.github.com/repos/docker/cli/pulls/1517"}}},"pull_request":{"url":"https://api.github.com/repos/docker/cli/pulls/1517","id":230625085,"node_id":"MDExOlB1bGxSZXF1ZXN0MjMwNjI1MDg1","html_url":"https://github.com/docker/cli/pull/1517","diff_url":"https://github.com/docker/cli/pull/1517.diff","patch_url":"https://github.com/docker/cli/pull/1517.patch","issue_url":"https://api.github.com/repos/docker/cli/issues/1517","number":1517,"state":"open","locked":false,"title":"Migrate TestTrustedCreateFromBadTrustServer from moby into cli/e2e","user":{"login":"glefloch","id":1827790,"node_id":"MDQ6VXNlcjE4Mjc3OTA=","avatar_url":"https://avatars2.githubusercontent.com/u/1827790?v=4","gravatar_id":"","url":"https://api.github.com/users/glefloch","html_url":"https://github.com/glefloch","followers_url":"https://api.github.com/users/glefloch/followers","following_url":"https://api.github.com/users/glefloch/following{/other_user}","gists_url":"https://api.github.com/users/glefloch/gists{/gist_id}","starred_url":"https://api.github.com/users/glefloch/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/glefloch/subscriptions","organizations_url":"https://api.github.com/users/glefloch/orgs","repos_url":"https://api.github.com/users/glefloch/repos","events_url":"https://api.github.com/users/glefloch/events{/privacy}","received_events_url":"https://api.github.com/users/glefloch/received_events","type":"User","site_admin":false},"body":"Signed-off-by: glefloch <glfloch@gmail.com>\r\n\r\n<!--\r\nPlease make sure you've read and understood our contributing guidelines;\r\nhttps://github.com/docker/cli/blob/master/CONTRIBUTING.md\r\n\r\n** Make sure all your commits include a signature generated with `git commit -s` **\r\n\r\nFor additional information on our contributing process, read our contributing\r\nguide https://docs.docker.com/opensource/code/\r\n\r\nIf this is a bug fix, make sure your description includes \"fixes #xxxx\", or\r\n\"closes #xxxx\"\r\n\r\nPlease provide the following information:\r\n-->\r\n\r\n**- What I did**\r\nI have migrate `TestTrustedCreateFromBadTrustServer` from `moby/moby` repository into `docker/cli` repository. This aims to closes #1218 \r\n\r\n**- How I did it**\r\nI have added a new notary-server into `e2e` test environment called `evil-notary-server`. Then duplicate the behavior of the test describe in moby repository.\r\n\r\n**- How to verify it**\r\nYou can verify it by running e2e tests.\r\n\r\n**- Description for the changelog**\r\n<!--\r\nWrite a short (one line) summary that describes the changes in this\r\npull request for inclusion in the changelog:\r\n-->\r\nAdd test on container creation using a wrong notary server\r\n\r\n**- A picture of a cute animal (not mandatory but encouraged)**\r\n","created_at":"2018-11-13T21:08:14Z","updated_at":"2018-11-21T10:17:22Z","closed_at":null,"merged_at":null,"merge_commit_sha":"a99eb5ebaf6c1c27abe9320c43703eba0943a5cb","assignee":null,"assignees":[],"requested_reviewers":[],"requested_teams":[],"labels":[{"id":585916069,"node_id":"MDU6TGFiZWw1ODU5MTYwNjk=","url":"https://api.github.com/repos/docker/cli/labels/status/0-triage","name":"status/0-triage","color":"EEEEEE","default":false}],"milestone":null,"commits_url":"https://api.github.com/repos/docker/cli/pulls/1517/commits","review_comments_url":"https://api.github.com/repos/docker/cli/pulls/1517/comments","review_comment_url":"https://api.github.com/repos/docker/cli/pulls/comments{/number}","comments_url":"https://api.github.com/repos/docker/cli/issues/1517/comments","statuses_url":"https://api.github.com/repos/docker/cli/statuses/f568785962efacda8d7dba6b21211b6b41f87556","head":{"label":"glefloch:migrate-test-from-moby","ref":"migrate-test-from-moby","sha":"f568785962efacda8d7dba6b21211b6b41f87556","user":{"login":"glefloch","id":1827790,"node_id":"MDQ6VXNlcjE4Mjc3OTA=","avatar_url":"https://avatars2.githubusercontent.com/u/1827790?v=4","gravatar_id":"","url":"https://api.github.com/users/glefloch","html_url":"https://github.com/glefloch","followers_url":"https://api.github.com/users/glefloch/followers","following_url":"https://api.github.com/users/glefloch/following{/other_user}","gists_url":"https://api.github.com/users/glefloch/gists{/gist_id}","starred_url":"https://api.github.com/users/glefloch/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/glefloch/subscriptions","organizations_url":"https://api.github.com/users/glefloch/orgs","repos_url":"https://api.github.com/users/glefloch/repos","events_url":"https://api.github.com/users/glefloch/events{/privacy}","received_events_url":"https://api.github.com/users/glefloch/received_events","type":"User","site_admin":false},"repo":{"id":146459305,"node_id":"MDEwOlJlcG9zaXRvcnkxNDY0NTkzMDU=","name":"cli","full_name":"glefloch/cli","private":false,"owner":{"login":"glefloch","id":1827790,"node_id":"MDQ6VXNlcjE4Mjc3OTA=","avatar_url":"https://avatars2.githubusercontent.com/u/1827790?v=4","gravatar_id":"","url":"https://api.github.com/users/glefloch","html_url":"https://github.com/glefloch","followers_url":"https://api.github.com/users/glefloch/followers","following_url":"https://api.github.com/users/glefloch/following{/other_user}","gists_url":"https://api.github.com/users/glefloch/gists{/gist_id}","starred_url":"https://api.github.com/users/glefloch/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/glefloch/subscriptions","organizations_url":"https://api.github.com/users/glefloch/orgs","repos_url":"https://api.github.com/users/glefloch/repos","events_url":"https://api.github.com/users/glefloch/events{/privacy}","received_events_url":"https://api.github.com/users/glefloch/received_events","type":"User","site_admin":false},"html_url":"https://github.com/glefloch/cli","description":"The Docker CLI","fork":true,"url":"https://api.github.com/repos/glefloch/cli","forks_url":"https://api.github.com/repos/glefloch/cli/forks","keys_url":"https://api.github.com/repos/glefloch/cli/keys{/key_id}","collaborators_url":"https://api.github.com/repos/glefloch/cli/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/glefloch/cli/teams","hooks_url":"https://api.github.com/repos/glefloch/cli/hooks","issue_events_url":"https://api.github.com/repos/glefloch/cli/issues/events{/number}","events_url":"https://api.github.com/repos/glefloch/cli/events","assignees_url":"https://api.github.com/repos/glefloch/cli/assignees{/user}","branches_url":"https://api.github.com/repos/glefloch/cli/branches{/branch}","tags_url":"https://api.github.com/repos/glefloch/cli/tags","blobs_url":"https://api.github.com/repos/glefloch/cli/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/glefloch/cli/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/glefloch/cli/git/refs{/sha}","trees_url":"https://api.github.com/repos/glefloch/cli/git/trees{/sha}","statuses_url":"https://api.github.com/repos/glefloch/cli/statuses/{sha}","languages_url":"https://api.github.com/repos/glefloch/cli/languages","stargazers_url":"https://api.github.com/repos/glefloch/cli/stargazers","contributors_url":"https://api.github.com/repos/glefloch/cli/contributors","subscribers_url":"https://api.github.com/repos/glefloch/cli/subscribers","subscription_url":"https://api.github.com/repos/glefloch/cli/subscription","commits_url":"https://api.github.com/repos/glefloch/cli/commits{/sha}","git_commits_url":"https://api.github.com/repos/glefloch/cli/git/commits{/sha}","comments_url":"https://api.github.com/repos/glefloch/cli/comments{/number}","issue_comment_url":"https://api.github.com/repos/glefloch/cli/issues/comments{/number}","contents_url":"https://api.github.com/repos/glefloch/cli/contents/{+path}","compare_url":"https://api.github.com/repos/glefloch/cli/compare/{base}...{head}","merges_url":"https://api.github.com/repos/glefloch/cli/merges","archive_url":"https://api.github.com/repos/glefloch/cli/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/glefloch/cli/downloads","issues_url":"https://api.github.com/repos/glefloch/cli/issues{/number}","pulls_url":"https://api.github.com/repos/glefloch/cli/pulls{/number}","milestones_url":"https://api.github.com/repos/glefloch/cli/milestones{/number}","notifications_url":"https://api.github.com/repos/glefloch/cli/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/glefloch/cli/labels{/name}","releases_url":"https://api.github.com/repos/glefloch/cli/releases{/id}","deployments_url":"https://api.github.com/repos/glefloch/cli/deployments","created_at":"2018-08-28T14:24:03Z","updated_at":"2018-08-28T14:24:07Z","pushed_at":"2018-11-16T08:10:12Z","git_url":"git://github.com/glefloch/cli.git","ssh_url":"git@github.com:glefloch/cli.git","clone_url":"https://github.com/glefloch/cli.git","svn_url":"https://github.com/glefloch/cli","homepage":null,"size":21179,"stargazers_count":0,"watchers_count":0,"language":"Go","has_issues":false,"has_projects":true,"has_downloads":true,"has_wiki":false,"has_pages":false,"forks_count":0,"mirror_url":null,"archived":false,"open_issues_count":0,"license":{"key":"apache-2.0","name":"Apache License 2.0","spdx_id":"Apache-2.0","url":"https://api.github.com/licenses/apache-2.0","node_id":"MDc6TGljZW5zZTI="},"forks":0,"open_issues":0,"watchers":0,"default_branch":"master"}},"base":{"label":"docker:master","ref":"master","sha":"f7ea8e831b1438aae6ca06e2bde830dbb0e6faf1","user":{"login":"docker","id":5429470,"node_id":"MDEyOk9yZ2FuaXphdGlvbjU0Mjk0NzA=","avatar_url":"https://avatars1.githubusercontent.com/u/5429470?v=4","gravatar_id":"","url":"https://api.github.com/users/docker","html_url":"https://github.com/docker","followers_url":"https://api.github.com/users/docker/followers","following_url":"https://api.github.com/users/docker/following{/other_user}","gists_url":"https://api.github.com/users/docker/gists{/gist_id}","starred_url":"https://api.github.com/users/docker/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/docker/subscriptions","organizations_url":"https://api.github.com/users/docker/orgs","repos_url":"https://api.github.com/users/docker/repos","events_url":"https://api.github.com/users/docker/events{/privacy}","received_events_url":"https://api.github.com/users/docker/received_events","type":"Organization","site_admin":false},"repo":{"id":88013053,"node_id":"MDEwOlJlcG9zaXRvcnk4ODAxMzA1Mw==","name":"cli","full_name":"docker/cli","private":false,"owner":{"login":"docker","id":5429470,"node_id":"MDEyOk9yZ2FuaXphdGlvbjU0Mjk0NzA=","avatar_url":"https://avatars1.githubusercontent.com/u/5429470?v=4","gravatar_id":"","url":"https://api.github.com/users/docker","html_url":"https://github.com/docker","followers_url":"https://api.github.com/users/docker/followers","following_url":"https://api.github.com/users/docker/following{/other_user}","gists_url":"https://api.github.com/users/docker/gists{/gist_id}","starred_url":"https://api.github.com/users/docker/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/docker/subscriptions","organizations_url":"https://api.github.com/users/docker/orgs","repos_url":"https://api.github.com/users/docker/repos","events_url":"https://api.github.com/users/docker/events{/privacy}","received_events_url":"https://api.github.com/users/docker/received_events","type":"Organization","site_admin":false},"html_url":"https://github.com/docker/cli","description":"The Docker CLI","fork":false,"url":"https://api.github.com/repos/docker/cli","forks_url":"https://api.github.com/repos/docker/cli/forks","keys_url":"https://api.github.com/repos/docker/cli/keys{/key_id}","collaborators_url":"https://api.github.com/repos/docker/cli/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/docker/cli/teams","hooks_url":"https://api.github.com/repos/docker/cli/hooks","issue_events_url":"https://api.github.com/repos/docker/cli/issues/events{/number}","events_url":"https://api.github.com/repos/docker/cli/events","assignees_url":"https://api.github.com/repos/docker/cli/assignees{/user}","branches_url":"https://api.github.com/repos/docker/cli/branches{/branch}","tags_url":"https://api.github.com/repos/docker/cli/tags","blobs_url":"https://api.github.com/repos/docker/cli/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/docker/cli/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/docker/cli/git/refs{/sha}","trees_url":"https://api.github.com/repos/docker/cli/git/trees{/sha}","statuses_url":"https://api.github.com/repos/docker/cli/statuses/{sha}","languages_url":"https://api.github.com/repos/docker/cli/languages","stargazers_url":"https://api.github.com/repos/docker/cli/stargazers","contributors_url":"https://api.github.com/repos/docker/cli/contributors","subscribers_url":"https://api.github.com/repos/docker/cli/subscribers","subscription_url":"https://api.github.com/repos/docker/cli/subscription","commits_url":"https://api.github.com/repos/docker/cli/commits{/sha}","git_commits_url":"https://api.github.com/repos/docker/cli/git/commits{/sha}","comments_url":"https://api.github.com/repos/docker/cli/comments{/number}","issue_comment_url":"https://api.github.com/repos/docker/cli/issues/comments{/number}","contents_url":"https://api.github.com/repos/docker/cli/contents/{+path}","compare_url":"https://api.github.com/repos/docker/cli/compare/{base}...{head}","merges_url":"https://api.github.com/repos/docker/cli/merges","archive_url":"https://api.github.com/repos/docker/cli/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/docker/cli/downloads","issues_url":"https://api.github.com/repos/docker/cli/issues{/number}","pulls_url":"https://api.github.com/repos/docker/cli/pulls{/number}","milestones_url":"https://api.github.com/repos/docker/cli/milestones{/number}","notifications_url":"https://api.github.com/repos/docker/cli/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/docker/cli/labels{/name}","releases_url":"https://api.github.com/repos/docker/cli/releases{/id}","deployments_url":"https://api.github.com/repos/docker/cli/deployments","created_at":"2017-04-12T05:27:42Z","updated_at":"2018-11-21T08:44:59Z","pushed_at":"2018-11-21T05:33:46Z","git_url":"git://github.com/docker/cli.git","ssh_url":"git@github.com:docker/cli.git","clone_url":"https://github.com/docker/cli.git","svn_url":"https://github.com/docker/cli","homepage":null,"size":21297,"stargazers_count":957,"watchers_count":957,"language":"Go","has_issues":true,"has_projects":false,"has_downloads":true,"has_wiki":false,"has_pages":false,"forks_count":582,"mirror_url":null,"archived":false,"open_issues_count":343,"license":{"key":"apache-2.0","name":"Apache License 2.0","spdx_id":"Apache-2.0","url":"https://api.github.com/licenses/apache-2.0","node_id":"MDc6TGljZW5zZTI="},"forks":582,"open_issues":343,"watchers":957,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/docker/cli/pulls/1517"},"html":{"href":"https://github.com/docker/cli/pull/1517"},"issue":{"href":"https://api.github.com/repos/docker/cli/issues/1517"},"comments":{"href":"https://api.github.com/repos/docker/cli/issues/1517/comments"},"review_comments":{"href":"https://api.github.com/repos/docker/cli/pulls/1517/comments"},"review_comment":{"href":"https://api.github.com/repos/docker/cli/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/docker/cli/pulls/1517/commits"},"statuses":{"href":"https://api.github.com/repos/docker/cli/statuses/f568785962efacda8d7dba6b21211b6b41f87556"}},"author_association":"NONE"}}
{"actor":{"display_login":"silvin-lubecki"}}