{"action":"created","comment":{"url":"https://api.github.com/repos/snapcore/snapd/pulls/comments/194053132","pull_request_review_id":127143534,"id":194053132,"node_id":"MDI0OlB1bGxSZXF1ZXN0UmV2aWV3Q29tbWVudDE5NDA1MzEzMg==","diff_hunk":"@@ -225,3 +225,65 @@ func (c *deepContainsChecker) Check(params []interface{}, names []string) (resul\n \t\treturn false, fmt.Sprintf(\"%T is not a supported container\", container)\n \t}\n }\n+\n+type syscallsEqualChecker struct {\n+\t*check.CheckerInfo\n+}\n+\n+// SyscallsEqual checks that one sequence of system calls is equal to another.\n+var SyscallsEqual check.Checker = &syscallsEqualChecker{\n+\tCheckerInfo: &check.CheckerInfo{Name: \"SyscallsEqual\", Params: []string{\"actualList\", \"expectedList\"}},\n+}\n+\n+func (c *syscallsEqualChecker) Check(params []interface{}, names []string) (result bool, error string) {\n+\tactualList, ok := params[0].([]CallResultError)\n+\tif !ok {\n+\t\treturn false, \"left-hand-side argument must be of type []CallResultError\"\n+\t}\n+\texpectedList, ok := params[1].([]CallResultError)\n+\tif !ok {\n+\t\treturn false, \"right-hand-side argument must be of type []CallResultError\"\n+\t}\n+\n+\tfor i, actual := range actualList {\n+\t\tif i >= len(expectedList) {\n+\t\t\treturn false, fmt.Sprintf(\"system call #%d %#q unexpectedly present, got %d system call(s) but expected only %d\",\n+\t\t\t\ti, actual.C, len(actualList), len(expectedList))\n+\t\t}\n+\t\texpected := expectedList[i]\n+\t\tif actual.C != expected.C {\n+\t\t\treturn false, fmt.Sprintf(\"system call #%d differs in operation, actual %#q, expected %#q\", i, actual.C, expected.C)\n+\t\t}\n+\t\tif !reflect.DeepEqual(actual, expected) {\n+\t\t\tswitch {\n+\t\t\tcase actual.E == nil && expected.E == nil && !reflect.DeepEqual(actual.R, expected.R):\n+\t\t\t\t// The call succeeded but not like we expected.\n+\t\t\t\treturn false, fmt.Sprintf(\"system call #%d %#q differs in result, actual: %#v, expected: %#v\",\n+\t\t\t\t\ti, actual.C, actual.R, expected.R)\n+\t\t\tcase actual.E != nil && expected.E != nil && !reflect.DeepEqual(actual.E, expected.E):\n+\t\t\t\t// The call failed but not like we expected.\n+\t\t\t\treturn false, fmt.Sprintf(\"system call #%d %#q differs in error, actual: %s, expected: %s\",\n+\t\t\t\t\ti, actual.C, actual.E, expected.E)\n+\t\t\tcase actual.E != nil && expected.E == nil && expected.R == nil:\n+\t\t\t\t// The call failed but we expected it to succeed.\n+\t\t\t\treturn false, fmt.Sprintf(\"system call #%d %#q unexpectedly failed, actual error: %s\", i, actual.C, actual.E)\n+\t\t\tcase actual.E != nil && expected.E == nil && expected.R != nil:\n+\t\t\t\t// The call failed but we expected it to succeed with some result.\n+\t\t\t\treturn false, fmt.Sprintf(\"system call #%d %#q unexpectedly failed, actual error: %s, expected result: %#v\", i, actual.C, actual.E, expected.R)\n+\t\t\tcase actual.E == nil && expected.E != nil && actual.R == nil:\n+\t\t\t\t// The call succeeded with some result but we expected it to fail.\n+\t\t\t\treturn false, fmt.Sprintf(\"system call #%d %#q unexpectedly succeeded, expected error: %s\", i, actual.C, expected.E)","path":"testutil/checkers.go","position":51,"original_position":51,"commit_id":"1a34d101f08edeb70b5860e6ee66599ac5cc25b9","original_commit_id":"1a34d101f08edeb70b5860e6ee66599ac5cc25b9","user":{"login":"jdstrand","id":1663079,"node_id":"MDQ6VXNlcjE2NjMwNzk=","avatar_url":"https://avatars0.githubusercontent.com/u/1663079?v=4","gravatar_id":"","url":"https://api.github.com/users/jdstrand","html_url":"https://github.com/jdstrand","followers_url":"https://api.github.com/users/jdstrand/followers","following_url":"https://api.github.com/users/jdstrand/following{/other_user}","gists_url":"https://api.github.com/users/jdstrand/gists{/gist_id}","starred_url":"https://api.github.com/users/jdstrand/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/jdstrand/subscriptions","organizations_url":"https://api.github.com/users/jdstrand/orgs","repos_url":"https://api.github.com/users/jdstrand/repos","events_url":"https://api.github.com/users/jdstrand/events{/privacy}","received_events_url":"https://api.github.com/users/jdstrand/received_events","type":"User","site_admin":false},"body":"Note, this also combines the case where actual.R is nil and actual.R is !nil, but I think that is ok because we want to tell the developer how it should've failed.","created_at":"2018-06-08T13:14:53Z","updated_at":"2018-06-08T13:30:13Z","html_url":"https://github.com/snapcore/snapd/pull/5287#discussion_r194053132","pull_request_url":"https://api.github.com/repos/snapcore/snapd/pulls/5287","author_association":"CONTRIBUTOR","_links":{"self":{"href":"https://api.github.com/repos/snapcore/snapd/pulls/comments/194053132"},"html":{"href":"https://github.com/snapcore/snapd/pull/5287#discussion_r194053132"},"pull_request":{"href":"https://api.github.com/repos/snapcore/snapd/pulls/5287"}}},"pull_request":{"url":"https://api.github.com/repos/snapcore/snapd/pulls/5287","id":193589118,"node_id":"MDExOlB1bGxSZXF1ZXN0MTkzNTg5MTE4","html_url":"https://github.com/snapcore/snapd/pull/5287","diff_url":"https://github.com/snapcore/snapd/pull/5287.diff","patch_url":"https://github.com/snapcore/snapd/pull/5287.patch","issue_url":"https://api.github.com/repos/snapcore/snapd/issues/5287","number":5287,"state":"open","locked":false,"title":"testutil: syscall sequence checker","user":{"login":"zyga","id":784262,"node_id":"MDQ6VXNlcjc4NDI2Mg==","avatar_url":"https://avatars0.githubusercontent.com/u/784262?v=4","gravatar_id":"","url":"https://api.github.com/users/zyga","html_url":"https://github.com/zyga","followers_url":"https://api.github.com/users/zyga/followers","following_url":"https://api.github.com/users/zyga/following{/other_user}","gists_url":"https://api.github.com/users/zyga/gists{/gist_id}","starred_url":"https://api.github.com/users/zyga/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/zyga/subscriptions","organizations_url":"https://api.github.com/users/zyga/orgs","repos_url":"https://api.github.com/users/zyga/repos","events_url":"https://api.github.com/users/zyga/events{/privacy}","received_events_url":"https://api.github.com/users/zyga/received_events","type":"User","site_admin":false},"body":"This patch adds a new checker that aids in testing sequences of system\r\ncalls. Unlike the default DeepEquals checker it stops at the first\r\nmismatching system call result / error object, giving useful information\r\nthat is easier to read than the full output of the expected vs actual\r\nresults that can be, sometimes, very long.\r\n\r\nSigned-off-by: Zygmunt Krynicki <zygmunt.krynicki@canonical.com>\r\n","created_at":"2018-06-08T11:43:06Z","updated_at":"2018-06-08T13:30:13Z","closed_at":null,"merged_at":null,"merge_commit_sha":"d823d5d076c3c7b45c0c3898a66f34e2c1f18f88","assignee":null,"assignees":[],"requested_reviewers":[],"requested_teams":[],"labels":[],"milestone":null,"commits_url":"https://api.github.com/repos/snapcore/snapd/pulls/5287/commits","review_comments_url":"https://api.github.com/repos/snapcore/snapd/pulls/5287/comments","review_comment_url":"https://api.github.com/repos/snapcore/snapd/pulls/comments{/number}","comments_url":"https://api.github.com/repos/snapcore/snapd/issues/5287/comments","statuses_url":"https://api.github.com/repos/snapcore/snapd/statuses/1a34d101f08edeb70b5860e6ee66599ac5cc25b9","head":{"label":"zyga:feature/rcall-checker","ref":"feature/rcall-checker","sha":"1a34d101f08edeb70b5860e6ee66599ac5cc25b9","user":{"login":"zyga","id":784262,"node_id":"MDQ6VXNlcjc4NDI2Mg==","avatar_url":"https://avatars0.githubusercontent.com/u/784262?v=4","gravatar_id":"","url":"https://api.github.com/users/zyga","html_url":"https://github.com/zyga","followers_url":"https://api.github.com/users/zyga/followers","following_url":"https://api.github.com/users/zyga/following{/other_user}","gists_url":"https://api.github.com/users/zyga/gists{/gist_id}","starred_url":"https://api.github.com/users/zyga/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/zyga/subscriptions","organizations_url":"https://api.github.com/users/zyga/orgs","repos_url":"https://api.github.com/users/zyga/repos","events_url":"https://api.github.com/users/zyga/events{/privacy}","received_events_url":"https://api.github.com/users/zyga/received_events","type":"User","site_admin":false},"repo":{"id":45263078,"node_id":"MDEwOlJlcG9zaXRvcnk0NTI2MzA3OA==","name":"snapd","full_name":"zyga/snapd","owner":{"login":"zyga","id":784262,"node_id":"MDQ6VXNlcjc4NDI2Mg==","avatar_url":"https://avatars0.githubusercontent.com/u/784262?v=4","gravatar_id":"","url":"https://api.github.com/users/zyga","html_url":"https://github.com/zyga","followers_url":"https://api.github.com/users/zyga/followers","following_url":"https://api.github.com/users/zyga/following{/other_user}","gists_url":"https://api.github.com/users/zyga/gists{/gist_id}","starred_url":"https://api.github.com/users/zyga/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/zyga/subscriptions","organizations_url":"https://api.github.com/users/zyga/orgs","repos_url":"https://api.github.com/users/zyga/repos","events_url":"https://api.github.com/users/zyga/events{/privacy}","received_events_url":"https://api.github.com/users/zyga/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/zyga/snapd","description":"Snappy is the software at the heart of Ubuntu Core.","fork":true,"url":"https://api.github.com/repos/zyga/snapd","forks_url":"https://api.github.com/repos/zyga/snapd/forks","keys_url":"https://api.github.com/repos/zyga/snapd/keys{/key_id}","collaborators_url":"https://api.github.com/repos/zyga/snapd/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/zyga/snapd/teams","hooks_url":"https://api.github.com/repos/zyga/snapd/hooks","issue_events_url":"https://api.github.com/repos/zyga/snapd/issues/events{/number}","events_url":"https://api.github.com/repos/zyga/snapd/events","assignees_url":"https://api.github.com/repos/zyga/snapd/assignees{/user}","branches_url":"https://api.github.com/repos/zyga/snapd/branches{/branch}","tags_url":"https://api.github.com/repos/zyga/snapd/tags","blobs_url":"https://api.github.com/repos/zyga/snapd/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/zyga/snapd/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/zyga/snapd/git/refs{/sha}","trees_url":"https://api.github.com/repos/zyga/snapd/git/trees{/sha}","statuses_url":"https://api.github.com/repos/zyga/snapd/statuses/{sha}","languages_url":"https://api.github.com/repos/zyga/snapd/languages","stargazers_url":"https://api.github.com/repos/zyga/snapd/stargazers","contributors_url":"https://api.github.com/repos/zyga/snapd/contributors","subscribers_url":"https://api.github.com/repos/zyga/snapd/subscribers","subscription_url":"https://api.github.com/repos/zyga/snapd/subscription","commits_url":"https://api.github.com/repos/zyga/snapd/commits{/sha}","git_commits_url":"https://api.github.com/repos/zyga/snapd/git/commits{/sha}","comments_url":"https://api.github.com/repos/zyga/snapd/comments{/number}","issue_comment_url":"https://api.github.com/repos/zyga/snapd/issues/comments{/number}","contents_url":"https://api.github.com/repos/zyga/snapd/contents/{+path}","compare_url":"https://api.github.com/repos/zyga/snapd/compare/{base}...{head}","merges_url":"https://api.github.com/repos/zyga/snapd/merges","archive_url":"https://api.github.com/repos/zyga/snapd/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/zyga/snapd/downloads","issues_url":"https://api.github.com/repos/zyga/snapd/issues{/number}","pulls_url":"https://api.github.com/repos/zyga/snapd/pulls{/number}","milestones_url":"https://api.github.com/repos/zyga/snapd/milestones{/number}","notifications_url":"https://api.github.com/repos/zyga/snapd/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/zyga/snapd/labels{/name}","releases_url":"https://api.github.com/repos/zyga/snapd/releases{/id}","deployments_url":"https://api.github.com/repos/zyga/snapd/deployments","created_at":"2015-10-30T16:30:25Z","updated_at":"2018-05-30T11:44:23Z","pushed_at":"2018-06-08T13:21:22Z","git_url":"git://github.com/zyga/snapd.git","ssh_url":"git@github.com:zyga/snapd.git","clone_url":"https://github.com/zyga/snapd.git","svn_url":"https://github.com/zyga/snapd","homepage":null,"size":65304,"stargazers_count":1,"watchers_count":1,"language":"Go","has_issues":false,"has_projects":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":0,"mirror_url":null,"archived":false,"open_issues_count":0,"license":{"key":"gpl-3.0","name":"GNU General Public License v3.0","spdx_id":"GPL-3.0","url":"https://api.github.com/licenses/gpl-3.0","node_id":"MDc6TGljZW5zZTk="},"forks":0,"open_issues":0,"watchers":1,"default_branch":"master"}},"base":{"label":"snapcore:master","ref":"master","sha":"86d2a52795054493ea7304c03aa987fd229d36e4","user":{"login":"snapcore","id":19532717,"node_id":"MDEyOk9yZ2FuaXphdGlvbjE5NTMyNzE3","avatar_url":"https://avatars1.githubusercontent.com/u/19532717?v=4","gravatar_id":"","url":"https://api.github.com/users/snapcore","html_url":"https://github.com/snapcore","followers_url":"https://api.github.com/users/snapcore/followers","following_url":"https://api.github.com/users/snapcore/following{/other_user}","gists_url":"https://api.github.com/users/snapcore/gists{/gist_id}","starred_url":"https://api.github.com/users/snapcore/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/snapcore/subscriptions","organizations_url":"https://api.github.com/users/snapcore/orgs","repos_url":"https://api.github.com/users/snapcore/repos","events_url":"https://api.github.com/users/snapcore/events{/privacy}","received_events_url":"https://api.github.com/users/snapcore/received_events","type":"Organization","site_admin":false},"repo":{"id":44672744,"node_id":"MDEwOlJlcG9zaXRvcnk0NDY3Mjc0NA==","name":"snapd","full_name":"snapcore/snapd","owner":{"login":"snapcore","id":19532717,"node_id":"MDEyOk9yZ2FuaXphdGlvbjE5NTMyNzE3","avatar_url":"https://avatars1.githubusercontent.com/u/19532717?v=4","gravatar_id":"","url":"https://api.github.com/users/snapcore","html_url":"https://github.com/snapcore","followers_url":"https://api.github.com/users/snapcore/followers","following_url":"https://api.github.com/users/snapcore/following{/other_user}","gists_url":"https://api.github.com/users/snapcore/gists{/gist_id}","starred_url":"https://api.github.com/users/snapcore/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/snapcore/subscriptions","organizations_url":"https://api.github.com/users/snapcore/orgs","repos_url":"https://api.github.com/users/snapcore/repos","events_url":"https://api.github.com/users/snapcore/events{/privacy}","received_events_url":"https://api.github.com/users/snapcore/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/snapcore/snapd","description":"The snapd and snap tools enable systems to work with .snap files.","fork":false,"url":"https://api.github.com/repos/snapcore/snapd","forks_url":"https://api.github.com/repos/snapcore/snapd/forks","keys_url":"https://api.github.com/repos/snapcore/snapd/keys{/key_id}","collaborators_url":"https://api.github.com/repos/snapcore/snapd/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/snapcore/snapd/teams","hooks_url":"https://api.github.com/repos/snapcore/snapd/hooks","issue_events_url":"https://api.github.com/repos/snapcore/snapd/issues/events{/number}","events_url":"https://api.github.com/repos/snapcore/snapd/events","assignees_url":"https://api.github.com/repos/snapcore/snapd/assignees{/user}","branches_url":"https://api.github.com/repos/snapcore/snapd/branches{/branch}","tags_url":"https://api.github.com/repos/snapcore/snapd/tags","blobs_url":"https://api.github.com/repos/snapcore/snapd/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/snapcore/snapd/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/snapcore/snapd/git/refs{/sha}","trees_url":"https://api.github.com/repos/snapcore/snapd/git/trees{/sha}","statuses_url":"https://api.github.com/repos/snapcore/snapd/statuses/{sha}","languages_url":"https://api.github.com/repos/snapcore/snapd/languages","stargazers_url":"https://api.github.com/repos/snapcore/snapd/stargazers","contributors_url":"https://api.github.com/repos/snapcore/snapd/contributors","subscribers_url":"https://api.github.com/repos/snapcore/snapd/subscribers","subscription_url":"https://api.github.com/repos/snapcore/snapd/subscription","commits_url":"https://api.github.com/repos/snapcore/snapd/commits{/sha}","git_commits_url":"https://api.github.com/repos/snapcore/snapd/git/commits{/sha}","comments_url":"https://api.github.com/repos/snapcore/snapd/comments{/number}","issue_comment_url":"https://api.github.com/repos/snapcore/snapd/issues/comments{/number}","contents_url":"https://api.github.com/repos/snapcore/snapd/contents/{+path}","compare_url":"https://api.github.com/repos/snapcore/snapd/compare/{base}...{head}","merges_url":"https://api.github.com/repos/snapcore/snapd/merges","archive_url":"https://api.github.com/repos/snapcore/snapd/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/snapcore/snapd/downloads","issues_url":"https://api.github.com/repos/snapcore/snapd/issues{/number}","pulls_url":"https://api.github.com/repos/snapcore/snapd/pulls{/number}","milestones_url":"https://api.github.com/repos/snapcore/snapd/milestones{/number}","notifications_url":"https://api.github.com/repos/snapcore/snapd/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/snapcore/snapd/labels{/name}","releases_url":"https://api.github.com/repos/snapcore/snapd/releases{/id}","deployments_url":"https://api.github.com/repos/snapcore/snapd/deployments","created_at":"2015-10-21T11:51:46Z","updated_at":"2018-06-08T12:41:16Z","pushed_at":"2018-06-08T13:23:44Z","git_url":"git://github.com/snapcore/snapd.git","ssh_url":"git@github.com:snapcore/snapd.git","clone_url":"https://github.com/snapcore/snapd.git","svn_url":"https://github.com/snapcore/snapd","homepage":"","size":65068,"stargazers_count":946,"watchers_count":946,"language":"Go","has_issues":false,"has_projects":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":236,"mirror_url":null,"archived":false,"open_issues_count":33,"license":{"key":"gpl-3.0","name":"GNU General Public License v3.0","spdx_id":"GPL-3.0","url":"https://api.github.com/licenses/gpl-3.0","node_id":"MDc6TGljZW5zZTk="},"forks":236,"open_issues":33,"watchers":946,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/snapcore/snapd/pulls/5287"},"html":{"href":"https://github.com/snapcore/snapd/pull/5287"},"issue":{"href":"https://api.github.com/repos/snapcore/snapd/issues/5287"},"comments":{"href":"https://api.github.com/repos/snapcore/snapd/issues/5287/comments"},"review_comments":{"href":"https://api.github.com/repos/snapcore/snapd/pulls/5287/comments"},"review_comment":{"href":"https://api.github.com/repos/snapcore/snapd/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/snapcore/snapd/pulls/5287/commits"},"statuses":{"href":"https://api.github.com/repos/snapcore/snapd/statuses/1a34d101f08edeb70b5860e6ee66599ac5cc25b9"}},"author_association":"CONTRIBUTOR"}}
{"actor":{"display_login":"jdstrand"}}