{"action":"created","comment":{"url":"https://api.github.com/repos/docker/docker/pulls/comments/27625761","id":27625761,"diff_hunk":"@@ -828,3 +828,66 @@ func TestDaemonUnixSockCleanedUp(t *testing.T) {\n \n \tlogDone(\"daemon - unix socket is cleaned up\")\n }\n+\n+func TestDaemonwithwrongkey(t *testing.T) {\n+\ttype Config struct {\n+\t\tCrv string `json:\"crv\"`\n+\t\tD   string `json:\"d\"`\n+\t\tKid string `json:\"kid\"`\n+\t\tKty string `json:\"kty\"`\n+\t\tX   string `json:\"x\"`\n+\t\tY   string `json:\"y\"`\n+\t}\n+\n+\tos.Remove(\"/etc/docker/key.json\")\n+\tk, err := libtrust.GenerateECP256PrivateKey()\n+\tif err != nil {\n+\t\tt.Fatalf(\"Error generating private key: %s\", err)\n+\t}\n+\tif err := os.MkdirAll(filepath.Join(os.Getenv(\"HOME\"), \".docker\"), 0755); err != nil {\n+\t\tt.Fatalf(\"Error creating .docker directory: %s\", err)\n+\t}\n+\tif err := libtrust.SaveKey(filepath.Join(os.Getenv(\"HOME\"), \".docker\", \"key.json\"), k); err != nil {\n+\t\tt.Fatalf(\"Error saving private key: %s\", err)\n+\t}\n+\td := NewDaemon(t)\n+\tif err := d.Start(); err != nil {\n+\t\tt.Fatalf(\"Failed to start daemon: %v\", err)\n+\t}\n+\n+\tif err := d.Stop(); err != nil {\n+\t\tt.Fatalf(\"Could not stop daemon: %v\", err)\n+\t}\n+\n+\tconfig := &Config{}\n+\tbytes, err := ioutil.ReadFile(\"/etc/docker/key.json\")\n+\tif err != nil {\n+\t\tt.Fatalf(\"Error reading key.json file: %s\", err)\n+\t}\n+\n+\t// byte[] to Data-Struct\n+\tif err := json.Unmarshal(bytes, &config); err != nil {\n+\t\tt.Fatalf(\"Error Unmarshal: %s\", err)\n+\t}\n+\n+\t//replace config.D with the fake value\n+\tconfig.D = \"VSAJ:FUYR:X3H2:B2VZ:KZ6U:CJD5:K7BX:ZXHY:UZXT:P4FT:MJWG:HRJ4\"","path":"integration-cli/docker_cli_daemon_test.go","position":47,"original_position":47,"commit_id":"47d516c30c09dabc50b00f2d2e239626533c0b4a","original_commit_id":"47d516c30c09dabc50b00f2d2e239626533c0b4a","user":{"login":"sunyuan3","id":10508990,"avatar_url":"https://avatars.githubusercontent.com/u/10508990?v=3","gravatar_id":"","url":"https://api.github.com/users/sunyuan3","html_url":"https://github.com/sunyuan3","followers_url":"https://api.github.com/users/sunyuan3/followers","following_url":"https://api.github.com/users/sunyuan3/following{/other_user}","gists_url":"https://api.github.com/users/sunyuan3/gists{/gist_id}","starred_url":"https://api.github.com/users/sunyuan3/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/sunyuan3/subscriptions","organizations_url":"https://api.github.com/users/sunyuan3/orgs","repos_url":"https://api.github.com/users/sunyuan3/repos","events_url":"https://api.github.com/users/sunyuan3/events{/privacy}","received_events_url":"https://api.github.com/users/sunyuan3/received_events","type":"User","site_admin":false},"body":"Yes, you are right.","created_at":"2015-04-02T00:45:07Z","updated_at":"2015-04-02T00:45:07Z","html_url":"https://github.com/docker/docker/pull/11324#discussion_r27625761","pull_request_url":"https://api.github.com/repos/docker/docker/pulls/11324","_links":{"self":{"href":"https://api.github.com/repos/docker/docker/pulls/comments/27625761"},"html":{"href":"https://github.com/docker/docker/pull/11324#discussion_r27625761"},"pull_request":{"href":"https://api.github.com/repos/docker/docker/pulls/11324"}}},"pull_request":{"url":"https://api.github.com/repos/docker/docker/pulls/11324","id":30957665,"html_url":"https://github.com/docker/docker/pull/11324","diff_url":"https://github.com/docker/docker/pull/11324.diff","patch_url":"https://github.com/docker/docker/pull/11324.patch","issue_url":"https://api.github.com/repos/docker/docker/issues/11324","number":11324,"state":"open","locked":false,"title":"add TestDaemonwithwrongkey test case","user":{"login":"sunyuan3","id":10508990,"avatar_url":"https://avatars.githubusercontent.com/u/10508990?v=3","gravatar_id":"","url":"https://api.github.com/users/sunyuan3","html_url":"https://github.com/sunyuan3","followers_url":"https://api.github.com/users/sunyuan3/followers","following_url":"https://api.github.com/users/sunyuan3/following{/other_user}","gists_url":"https://api.github.com/users/sunyuan3/gists{/gist_id}","starred_url":"https://api.github.com/users/sunyuan3/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/sunyuan3/subscriptions","organizations_url":"https://api.github.com/users/sunyuan3/orgs","repos_url":"https://api.github.com/users/sunyuan3/repos","events_url":"https://api.github.com/users/sunyuan3/events{/privacy}","received_events_url":"https://api.github.com/users/sunyuan3/received_events","type":"User","site_admin":false},"body":"Make sure that it is failed to start daemon with a wrong key.json file.\r\nSigned-off-by: Yuan Sun <sunyuan3@huawei.com>","created_at":"2015-03-11T16:05:22Z","updated_at":"2015-04-02T00:45:07Z","closed_at":null,"merged_at":null,"merge_commit_sha":"8d751e2606c7eb732c2f69ea8cde4eee719b4f8c","assignee":null,"milestone":null,"commits_url":"https://api.github.com/repos/docker/docker/pulls/11324/commits","review_comments_url":"https://api.github.com/repos/docker/docker/pulls/11324/comments","review_comment_url":"https://api.github.com/repos/docker/docker/pulls/comments{/number}","comments_url":"https://api.github.com/repos/docker/docker/issues/11324/comments","statuses_url":"https://api.github.com/repos/docker/docker/statuses/47d516c30c09dabc50b00f2d2e239626533c0b4a","head":{"label":"sunyuan3:TestDaemonwithwrongkey","ref":"TestDaemonwithwrongkey","sha":"47d516c30c09dabc50b00f2d2e239626533c0b4a","user":{"login":"sunyuan3","id":10508990,"avatar_url":"https://avatars.githubusercontent.com/u/10508990?v=3","gravatar_id":"","url":"https://api.github.com/users/sunyuan3","html_url":"https://github.com/sunyuan3","followers_url":"https://api.github.com/users/sunyuan3/followers","following_url":"https://api.github.com/users/sunyuan3/following{/other_user}","gists_url":"https://api.github.com/users/sunyuan3/gists{/gist_id}","starred_url":"https://api.github.com/users/sunyuan3/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/sunyuan3/subscriptions","organizations_url":"https://api.github.com/users/sunyuan3/orgs","repos_url":"https://api.github.com/users/sunyuan3/repos","events_url":"https://api.github.com/users/sunyuan3/events{/privacy}","received_events_url":"https://api.github.com/users/sunyuan3/received_events","type":"User","site_admin":false},"repo":{"id":29171573,"name":"docker","full_name":"sunyuan3/docker","owner":{"login":"sunyuan3","id":10508990,"avatar_url":"https://avatars.githubusercontent.com/u/10508990?v=3","gravatar_id":"","url":"https://api.github.com/users/sunyuan3","html_url":"https://github.com/sunyuan3","followers_url":"https://api.github.com/users/sunyuan3/followers","following_url":"https://api.github.com/users/sunyuan3/following{/other_user}","gists_url":"https://api.github.com/users/sunyuan3/gists{/gist_id}","starred_url":"https://api.github.com/users/sunyuan3/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/sunyuan3/subscriptions","organizations_url":"https://api.github.com/users/sunyuan3/orgs","repos_url":"https://api.github.com/users/sunyuan3/repos","events_url":"https://api.github.com/users/sunyuan3/events{/privacy}","received_events_url":"https://api.github.com/users/sunyuan3/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/sunyuan3/docker","description":"Docker - the open-source application container engine","fork":true,"url":"https://api.github.com/repos/sunyuan3/docker","forks_url":"https://api.github.com/repos/sunyuan3/docker/forks","keys_url":"https://api.github.com/repos/sunyuan3/docker/keys{/key_id}","collaborators_url":"https://api.github.com/repos/sunyuan3/docker/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/sunyuan3/docker/teams","hooks_url":"https://api.github.com/repos/sunyuan3/docker/hooks","issue_events_url":"https://api.github.com/repos/sunyuan3/docker/issues/events{/number}","events_url":"https://api.github.com/repos/sunyuan3/docker/events","assignees_url":"https://api.github.com/repos/sunyuan3/docker/assignees{/user}","branches_url":"https://api.github.com/repos/sunyuan3/docker/branches{/branch}","tags_url":"https://api.github.com/repos/sunyuan3/docker/tags","blobs_url":"https://api.github.com/repos/sunyuan3/docker/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/sunyuan3/docker/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/sunyuan3/docker/git/refs{/sha}","trees_url":"https://api.github.com/repos/sunyuan3/docker/git/trees{/sha}","statuses_url":"https://api.github.com/repos/sunyuan3/docker/statuses/{sha}","languages_url":"https://api.github.com/repos/sunyuan3/docker/languages","stargazers_url":"https://api.github.com/repos/sunyuan3/docker/stargazers","contributors_url":"https://api.github.com/repos/sunyuan3/docker/contributors","subscribers_url":"https://api.github.com/repos/sunyuan3/docker/subscribers","subscription_url":"https://api.github.com/repos/sunyuan3/docker/subscription","commits_url":"https://api.github.com/repos/sunyuan3/docker/commits{/sha}","git_commits_url":"https://api.github.com/repos/sunyuan3/docker/git/commits{/sha}","comments_url":"https://api.github.com/repos/sunyuan3/docker/comments{/number}","issue_comment_url":"https://api.github.com/repos/sunyuan3/docker/issues/comments{/number}","contents_url":"https://api.github.com/repos/sunyuan3/docker/contents/{+path}","compare_url":"https://api.github.com/repos/sunyuan3/docker/compare/{base}...{head}","merges_url":"https://api.github.com/repos/sunyuan3/docker/merges","archive_url":"https://api.github.com/repos/sunyuan3/docker/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/sunyuan3/docker/downloads","issues_url":"https://api.github.com/repos/sunyuan3/docker/issues{/number}","pulls_url":"https://api.github.com/repos/sunyuan3/docker/pulls{/number}","milestones_url":"https://api.github.com/repos/sunyuan3/docker/milestones{/number}","notifications_url":"https://api.github.com/repos/sunyuan3/docker/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/sunyuan3/docker/labels{/name}","releases_url":"https://api.github.com/repos/sunyuan3/docker/releases{/id}","created_at":"2015-01-13T03:50:41Z","updated_at":"2015-04-01T02:13:55Z","pushed_at":"2015-04-01T09:05:20Z","git_url":"git://github.com/sunyuan3/docker.git","ssh_url":"git@github.com:sunyuan3/docker.git","clone_url":"https://github.com/sunyuan3/docker.git","svn_url":"https://github.com/sunyuan3/docker","homepage":"http://www.docker.com","size":47720,"stargazers_count":0,"watchers_count":0,"language":"Go","has_issues":false,"has_downloads":true,"has_wiki":false,"has_pages":false,"forks_count":0,"mirror_url":null,"open_issues_count":0,"forks":0,"open_issues":0,"watchers":0,"default_branch":"master"}},"base":{"label":"docker:master","ref":"master","sha":"98cfa2aecdb208ebc30dfc17ee3ed8ebbb05a72a","user":{"login":"docker","id":5429470,"avatar_url":"https://avatars.githubusercontent.com/u/5429470?v=3","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":7691631,"name":"docker","full_name":"docker/docker","owner":{"login":"docker","id":5429470,"avatar_url":"https://avatars.githubusercontent.com/u/5429470?v=3","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},"private":false,"html_url":"https://github.com/docker/docker","description":"Docker - the open-source application container engine","fork":false,"url":"https://api.github.com/repos/docker/docker","forks_url":"https://api.github.com/repos/docker/docker/forks","keys_url":"https://api.github.com/repos/docker/docker/keys{/key_id}","collaborators_url":"https://api.github.com/repos/docker/docker/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/docker/docker/teams","hooks_url":"https://api.github.com/repos/docker/docker/hooks","issue_events_url":"https://api.github.com/repos/docker/docker/issues/events{/number}","events_url":"https://api.github.com/repos/docker/docker/events","assignees_url":"https://api.github.com/repos/docker/docker/assignees{/user}","branches_url":"https://api.github.com/repos/docker/docker/branches{/branch}","tags_url":"https://api.github.com/repos/docker/docker/tags","blobs_url":"https://api.github.com/repos/docker/docker/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/docker/docker/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/docker/docker/git/refs{/sha}","trees_url":"https://api.github.com/repos/docker/docker/git/trees{/sha}","statuses_url":"https://api.github.com/repos/docker/docker/statuses/{sha}","languages_url":"https://api.github.com/repos/docker/docker/languages","stargazers_url":"https://api.github.com/repos/docker/docker/stargazers","contributors_url":"https://api.github.com/repos/docker/docker/contributors","subscribers_url":"https://api.github.com/repos/docker/docker/subscribers","subscription_url":"https://api.github.com/repos/docker/docker/subscription","commits_url":"https://api.github.com/repos/docker/docker/commits{/sha}","git_commits_url":"https://api.github.com/repos/docker/docker/git/commits{/sha}","comments_url":"https://api.github.com/repos/docker/docker/comments{/number}","issue_comment_url":"https://api.github.com/repos/docker/docker/issues/comments{/number}","contents_url":"https://api.github.com/repos/docker/docker/contents/{+path}","compare_url":"https://api.github.com/repos/docker/docker/compare/{base}...{head}","merges_url":"https://api.github.com/repos/docker/docker/merges","archive_url":"https://api.github.com/repos/docker/docker/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/docker/docker/downloads","issues_url":"https://api.github.com/repos/docker/docker/issues{/number}","pulls_url":"https://api.github.com/repos/docker/docker/pulls{/number}","milestones_url":"https://api.github.com/repos/docker/docker/milestones{/number}","notifications_url":"https://api.github.com/repos/docker/docker/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/docker/docker/labels{/name}","releases_url":"https://api.github.com/repos/docker/docker/releases{/id}","created_at":"2013-01-18T18:10:57Z","updated_at":"2015-04-01T23:53:02Z","pushed_at":"2015-04-02T00:40:04Z","git_url":"git://github.com/docker/docker.git","ssh_url":"git@github.com:docker/docker.git","clone_url":"https://github.com/docker/docker.git","svn_url":"https://github.com/docker/docker","homepage":"http://www.docker.com","size":162645,"stargazers_count":20470,"watchers_count":20470,"language":"Go","has_issues":true,"has_downloads":true,"has_wiki":false,"has_pages":false,"forks_count":4583,"mirror_url":null,"open_issues_count":873,"forks":4583,"open_issues":873,"watchers":20470,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/docker/docker/pulls/11324"},"html":{"href":"https://github.com/docker/docker/pull/11324"},"issue":{"href":"https://api.github.com/repos/docker/docker/issues/11324"},"comments":{"href":"https://api.github.com/repos/docker/docker/issues/11324/comments"},"review_comments":{"href":"https://api.github.com/repos/docker/docker/pulls/11324/comments"},"review_comment":{"href":"https://api.github.com/repos/docker/docker/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/docker/docker/pulls/11324/commits"},"statuses":{"href":"https://api.github.com/repos/docker/docker/statuses/47d516c30c09dabc50b00f2d2e239626533c0b4a"}}}}