{"action":"created","comment":{"url":"https://api.github.com/repos/coreos/rkt/pulls/comments/31972182","id":31972182,"diff_hunk":"@@ -0,0 +1,360 @@\n+// Copyright 2015 The rkt Authors\n+//\n+// Licensed under the Apache License, Version 2.0 (the \"License\");\n+// you may not use this file except in compliance with the License.\n+// You may obtain a copy of the License at\n+//\n+//     http://www.apache.org/licenses/LICENSE-2.0\n+//\n+// Unless required by applicable law or agreed to in writing, software\n+// distributed under the License is distributed on an \"AS IS\" BASIS,\n+// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n+// See the License for the specific language governing permissions and\n+// limitations under the License.\n+\n+package main\n+\n+import (\n+\t\"encoding/json\"\n+\t\"flag\"\n+\t\"fmt\"\n+\t\"io/ioutil\"\n+\t\"os\"\n+\t\"os/exec\"\n+\t\"path\"\n+\t\"reflect\"\n+\t\"strings\"\n+\t\"testing\"\n+\n+\t\"github.com/coreos/rkt/Godeps/_workspace/src/github.com/ThomasRooney/gexpect\"\n+\t\"github.com/coreos/rkt/Godeps/_workspace/src/github.com/appc/spec/schema\"\n+\t\"github.com/coreos/rkt/Godeps/_workspace/src/github.com/appc/spec/schema/types\"\n+)\n+\n+const baseAppName = \"coreos.com/rkt-inspect\"\n+\n+func importImageAndFetchHash(t *testing.T, ctx *rktRunCtx, img string) string {\n+\t// Import the test image into store manually.\n+\tcmds := strings.Fields(ctx.cmd())\n+\tfetchCmd := exec.Command(cmds[0], cmds[1:]...)\n+\tfetchCmd.Args = append(fetchCmd.Args, \"--insecure-skip-verify\", \"fetch\", img)\n+\toutput, err := fetchCmd.Output()\n+\tif err != nil {\n+\t\tt.Fatalf(\"Cannot read the output: %v\", err)\n+\t}\n+\n+\t// Read out the image hash.\n+\tix := strings.Index(string(output), \"sha512-\")\n+\tif ix < 0 {\n+\t\tt.Fatalf(\"Unexpected result: %v, expecting a sha512 hash\", string(output))\n+\t}\n+\treturn strings.TrimSpace(string(output)[ix:])\n+}\n+\n+func isEmptyApp(app *types.App) bool {\n+\treturn reflect.DeepEqual(app, &types.App{})\n+}\n+\n+func patchPodManifest(t *testing.T, pod *schema.PodManifest, args ...string) {\n+\tvar flags flag.FlagSet\n+\tvar appName string\n+\tvar imageName string\n+\tvar imageID string\n+\tvar exec string\n+\tvar environments envMap\n+\tvar mountPoints mountPointList\n+\tvar containerPorts containerPortList\n+\tvar exposedPorts exposedPortList\n+\tvar volumes volumeList\n+\tvar user string\n+\tvar group string\n+\n+\tvar ra schema.RuntimeApp\n+\tvar app types.App\n+\n+\tflags.StringVar(&appName, \"app-name\", \"\", \"\")","path":"tests/rkt_run_pod_manifest_test.go","position":null,"original_position":75,"commit_id":"091f657f9a566b35e96edfe69b203a37e01f79a6","original_commit_id":"b9a8d8e96a81215903efb93b8b911305a08d2431","user":{"login":"yifan-gu","id":3278588,"avatar_url":"https://avatars.githubusercontent.com/u/3278588?v=3","gravatar_id":"","url":"https://api.github.com/users/yifan-gu","html_url":"https://github.com/yifan-gu","followers_url":"https://api.github.com/users/yifan-gu/followers","following_url":"https://api.github.com/users/yifan-gu/following{/other_user}","gists_url":"https://api.github.com/users/yifan-gu/gists{/gist_id}","starred_url":"https://api.github.com/users/yifan-gu/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/yifan-gu/subscriptions","organizations_url":"https://api.github.com/users/yifan-gu/orgs","repos_url":"https://api.github.com/users/yifan-gu/repos","events_url":"https://api.github.com/users/yifan-gu/events{/privacy}","received_events_url":"https://api.github.com/users/yifan-gu/received_events","type":"User","site_admin":false},"body":"Updated","created_at":"2015-06-08T23:55:58Z","updated_at":"2015-06-08T23:55:58Z","html_url":"https://github.com/coreos/rkt/pull/980#discussion_r31972182","pull_request_url":"https://api.github.com/repos/coreos/rkt/pulls/980","_links":{"self":{"href":"https://api.github.com/repos/coreos/rkt/pulls/comments/31972182"},"html":{"href":"https://github.com/coreos/rkt/pull/980#discussion_r31972182"},"pull_request":{"href":"https://api.github.com/repos/coreos/rkt/pulls/980"}}},"pull_request":{"url":"https://api.github.com/repos/coreos/rkt/pulls/980","id":36781511,"html_url":"https://github.com/coreos/rkt/pull/980","diff_url":"https://github.com/coreos/rkt/pull/980.diff","patch_url":"https://github.com/coreos/rkt/pull/980.patch","issue_url":"https://api.github.com/repos/coreos/rkt/issues/980","number":980,"state":"open","locked":false,"title":"tests: Add basic functional tests for rkt run/prepare --pod-manifest.","user":{"login":"yifan-gu","id":3278588,"avatar_url":"https://avatars.githubusercontent.com/u/3278588?v=3","gravatar_id":"","url":"https://api.github.com/users/yifan-gu","html_url":"https://github.com/yifan-gu","followers_url":"https://api.github.com/users/yifan-gu/followers","following_url":"https://api.github.com/users/yifan-gu/following{/other_user}","gists_url":"https://api.github.com/users/yifan-gu/gists{/gist_id}","starred_url":"https://api.github.com/users/yifan-gu/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/yifan-gu/subscriptions","organizations_url":"https://api.github.com/users/yifan-gu/orgs","repos_url":"https://api.github.com/users/yifan-gu/repos","events_url":"https://api.github.com/users/yifan-gu/events{/privacy}","received_events_url":"https://api.github.com/users/yifan-gu/received_events","type":"User","site_admin":false},"body":"Found a bug during tests: https://github.com/coreos/rkt/pull/978","created_at":"2015-06-02T22:30:35Z","updated_at":"2015-06-08T23:55:58Z","closed_at":null,"merged_at":null,"merge_commit_sha":"44cb0bc5beb64944acad2c9e08257f94e07789b3","assignee":null,"milestone":null,"commits_url":"https://api.github.com/repos/coreos/rkt/pulls/980/commits","review_comments_url":"https://api.github.com/repos/coreos/rkt/pulls/980/comments","review_comment_url":"https://api.github.com/repos/coreos/rkt/pulls/comments{/number}","comments_url":"https://api.github.com/repos/coreos/rkt/issues/980/comments","statuses_url":"https://api.github.com/repos/coreos/rkt/statuses/091f657f9a566b35e96edfe69b203a37e01f79a6","head":{"label":"yifan-gu:pod_manifest","ref":"pod_manifest","sha":"091f657f9a566b35e96edfe69b203a37e01f79a6","user":{"login":"yifan-gu","id":3278588,"avatar_url":"https://avatars.githubusercontent.com/u/3278588?v=3","gravatar_id":"","url":"https://api.github.com/users/yifan-gu","html_url":"https://github.com/yifan-gu","followers_url":"https://api.github.com/users/yifan-gu/followers","following_url":"https://api.github.com/users/yifan-gu/following{/other_user}","gists_url":"https://api.github.com/users/yifan-gu/gists{/gist_id}","starred_url":"https://api.github.com/users/yifan-gu/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/yifan-gu/subscriptions","organizations_url":"https://api.github.com/users/yifan-gu/orgs","repos_url":"https://api.github.com/users/yifan-gu/repos","events_url":"https://api.github.com/users/yifan-gu/events{/privacy}","received_events_url":"https://api.github.com/users/yifan-gu/received_events","type":"User","site_admin":false},"repo":{"id":31437138,"name":"rocket","full_name":"yifan-gu/rocket","owner":{"login":"yifan-gu","id":3278588,"avatar_url":"https://avatars.githubusercontent.com/u/3278588?v=3","gravatar_id":"","url":"https://api.github.com/users/yifan-gu","html_url":"https://github.com/yifan-gu","followers_url":"https://api.github.com/users/yifan-gu/followers","following_url":"https://api.github.com/users/yifan-gu/following{/other_user}","gists_url":"https://api.github.com/users/yifan-gu/gists{/gist_id}","starred_url":"https://api.github.com/users/yifan-gu/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/yifan-gu/subscriptions","organizations_url":"https://api.github.com/users/yifan-gu/orgs","repos_url":"https://api.github.com/users/yifan-gu/repos","events_url":"https://api.github.com/users/yifan-gu/events{/privacy}","received_events_url":"https://api.github.com/users/yifan-gu/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/yifan-gu/rocket","description":"App Container runtime","fork":true,"url":"https://api.github.com/repos/yifan-gu/rocket","forks_url":"https://api.github.com/repos/yifan-gu/rocket/forks","keys_url":"https://api.github.com/repos/yifan-gu/rocket/keys{/key_id}","collaborators_url":"https://api.github.com/repos/yifan-gu/rocket/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/yifan-gu/rocket/teams","hooks_url":"https://api.github.com/repos/yifan-gu/rocket/hooks","issue_events_url":"https://api.github.com/repos/yifan-gu/rocket/issues/events{/number}","events_url":"https://api.github.com/repos/yifan-gu/rocket/events","assignees_url":"https://api.github.com/repos/yifan-gu/rocket/assignees{/user}","branches_url":"https://api.github.com/repos/yifan-gu/rocket/branches{/branch}","tags_url":"https://api.github.com/repos/yifan-gu/rocket/tags","blobs_url":"https://api.github.com/repos/yifan-gu/rocket/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/yifan-gu/rocket/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/yifan-gu/rocket/git/refs{/sha}","trees_url":"https://api.github.com/repos/yifan-gu/rocket/git/trees{/sha}","statuses_url":"https://api.github.com/repos/yifan-gu/rocket/statuses/{sha}","languages_url":"https://api.github.com/repos/yifan-gu/rocket/languages","stargazers_url":"https://api.github.com/repos/yifan-gu/rocket/stargazers","contributors_url":"https://api.github.com/repos/yifan-gu/rocket/contributors","subscribers_url":"https://api.github.com/repos/yifan-gu/rocket/subscribers","subscription_url":"https://api.github.com/repos/yifan-gu/rocket/subscription","commits_url":"https://api.github.com/repos/yifan-gu/rocket/commits{/sha}","git_commits_url":"https://api.github.com/repos/yifan-gu/rocket/git/commits{/sha}","comments_url":"https://api.github.com/repos/yifan-gu/rocket/comments{/number}","issue_comment_url":"https://api.github.com/repos/yifan-gu/rocket/issues/comments{/number}","contents_url":"https://api.github.com/repos/yifan-gu/rocket/contents/{+path}","compare_url":"https://api.github.com/repos/yifan-gu/rocket/compare/{base}...{head}","merges_url":"https://api.github.com/repos/yifan-gu/rocket/merges","archive_url":"https://api.github.com/repos/yifan-gu/rocket/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/yifan-gu/rocket/downloads","issues_url":"https://api.github.com/repos/yifan-gu/rocket/issues{/number}","pulls_url":"https://api.github.com/repos/yifan-gu/rocket/pulls{/number}","milestones_url":"https://api.github.com/repos/yifan-gu/rocket/milestones{/number}","notifications_url":"https://api.github.com/repos/yifan-gu/rocket/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/yifan-gu/rocket/labels{/name}","releases_url":"https://api.github.com/repos/yifan-gu/rocket/releases{/id}","created_at":"2015-02-27T20:12:42Z","updated_at":"2015-04-01T01:18:09Z","pushed_at":"2015-06-08T23:53:47Z","git_url":"git://github.com/yifan-gu/rocket.git","ssh_url":"git@github.com:yifan-gu/rocket.git","clone_url":"https://github.com/yifan-gu/rocket.git","svn_url":"https://github.com/yifan-gu/rocket","homepage":"","size":6035,"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":"coreos:master","ref":"master","sha":"196da8915ba1114e1bb032c0ef3eb39633d2f1b3","user":{"login":"coreos","id":3730757,"avatar_url":"https://avatars.githubusercontent.com/u/3730757?v=3","gravatar_id":"","url":"https://api.github.com/users/coreos","html_url":"https://github.com/coreos","followers_url":"https://api.github.com/users/coreos/followers","following_url":"https://api.github.com/users/coreos/following{/other_user}","gists_url":"https://api.github.com/users/coreos/gists{/gist_id}","starred_url":"https://api.github.com/users/coreos/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/coreos/subscriptions","organizations_url":"https://api.github.com/users/coreos/orgs","repos_url":"https://api.github.com/users/coreos/repos","events_url":"https://api.github.com/users/coreos/events{/privacy}","received_events_url":"https://api.github.com/users/coreos/received_events","type":"Organization","site_admin":false},"repo":{"id":26509369,"name":"rkt","full_name":"coreos/rkt","owner":{"login":"coreos","id":3730757,"avatar_url":"https://avatars.githubusercontent.com/u/3730757?v=3","gravatar_id":"","url":"https://api.github.com/users/coreos","html_url":"https://github.com/coreos","followers_url":"https://api.github.com/users/coreos/followers","following_url":"https://api.github.com/users/coreos/following{/other_user}","gists_url":"https://api.github.com/users/coreos/gists{/gist_id}","starred_url":"https://api.github.com/users/coreos/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/coreos/subscriptions","organizations_url":"https://api.github.com/users/coreos/orgs","repos_url":"https://api.github.com/users/coreos/repos","events_url":"https://api.github.com/users/coreos/events{/privacy}","received_events_url":"https://api.github.com/users/coreos/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/coreos/rkt","description":"rkt is an App Container runtime for Linux","fork":false,"url":"https://api.github.com/repos/coreos/rkt","forks_url":"https://api.github.com/repos/coreos/rkt/forks","keys_url":"https://api.github.com/repos/coreos/rkt/keys{/key_id}","collaborators_url":"https://api.github.com/repos/coreos/rkt/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/coreos/rkt/teams","hooks_url":"https://api.github.com/repos/coreos/rkt/hooks","issue_events_url":"https://api.github.com/repos/coreos/rkt/issues/events{/number}","events_url":"https://api.github.com/repos/coreos/rkt/events","assignees_url":"https://api.github.com/repos/coreos/rkt/assignees{/user}","branches_url":"https://api.github.com/repos/coreos/rkt/branches{/branch}","tags_url":"https://api.github.com/repos/coreos/rkt/tags","blobs_url":"https://api.github.com/repos/coreos/rkt/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/coreos/rkt/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/coreos/rkt/git/refs{/sha}","trees_url":"https://api.github.com/repos/coreos/rkt/git/trees{/sha}","statuses_url":"https://api.github.com/repos/coreos/rkt/statuses/{sha}","languages_url":"https://api.github.com/repos/coreos/rkt/languages","stargazers_url":"https://api.github.com/repos/coreos/rkt/stargazers","contributors_url":"https://api.github.com/repos/coreos/rkt/contributors","subscribers_url":"https://api.github.com/repos/coreos/rkt/subscribers","subscription_url":"https://api.github.com/repos/coreos/rkt/subscription","commits_url":"https://api.github.com/repos/coreos/rkt/commits{/sha}","git_commits_url":"https://api.github.com/repos/coreos/rkt/git/commits{/sha}","comments_url":"https://api.github.com/repos/coreos/rkt/comments{/number}","issue_comment_url":"https://api.github.com/repos/coreos/rkt/issues/comments{/number}","contents_url":"https://api.github.com/repos/coreos/rkt/contents/{+path}","compare_url":"https://api.github.com/repos/coreos/rkt/compare/{base}...{head}","merges_url":"https://api.github.com/repos/coreos/rkt/merges","archive_url":"https://api.github.com/repos/coreos/rkt/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/coreos/rkt/downloads","issues_url":"https://api.github.com/repos/coreos/rkt/issues{/number}","pulls_url":"https://api.github.com/repos/coreos/rkt/pulls{/number}","milestones_url":"https://api.github.com/repos/coreos/rkt/milestones{/number}","notifications_url":"https://api.github.com/repos/coreos/rkt/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/coreos/rkt/labels{/name}","releases_url":"https://api.github.com/repos/coreos/rkt/releases{/id}","created_at":"2014-11-11T23:13:18Z","updated_at":"2015-06-08T22:21:12Z","pushed_at":"2015-06-08T23:53:47Z","git_url":"git://github.com/coreos/rkt.git","ssh_url":"git@github.com:coreos/rkt.git","clone_url":"https://github.com/coreos/rkt.git","svn_url":"https://github.com/coreos/rkt","homepage":"","size":13824,"stargazers_count":4284,"watchers_count":4284,"language":"Go","has_issues":true,"has_downloads":true,"has_wiki":false,"has_pages":false,"forks_count":329,"mirror_url":null,"open_issues_count":120,"forks":329,"open_issues":120,"watchers":4284,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/coreos/rkt/pulls/980"},"html":{"href":"https://github.com/coreos/rkt/pull/980"},"issue":{"href":"https://api.github.com/repos/coreos/rkt/issues/980"},"comments":{"href":"https://api.github.com/repos/coreos/rkt/issues/980/comments"},"review_comments":{"href":"https://api.github.com/repos/coreos/rkt/pulls/980/comments"},"review_comment":{"href":"https://api.github.com/repos/coreos/rkt/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/coreos/rkt/pulls/980/commits"},"statuses":{"href":"https://api.github.com/repos/coreos/rkt/statuses/091f657f9a566b35e96edfe69b203a37e01f79a6"}}}}