{"action":"created","comment":{"url":"https://api.github.com/repos/jbenet/go-ipfs/pulls/comments/26833081","id":26833081,"diff_hunk":"@@ -0,0 +1,36 @@\n+#!/bin/bash\n+\n+test_description=\"Test swarm command\"\n+\n+. lib/test-lib.sh\n+\n+test_init_ipfs\n+test_launch_ipfs_daemon\n+\n+test_expect_success \"'ipfs swarm addrs' succeeds\" '\n+\tipfs swarm addrs >swarm_addrs_out 2>swarm_addrs_err ||\n+\ttest_fsh cat swarm_addrs_out || test_fsh cat swarm_addrs_err\n+'\n+\n+test_swarm_addrs_output() {\n+\tcat \"$1\" |\n+\twhile IFS='' read -r line || [[ -n $line ]]\n+\tdo\n+\t\tgrep '^Qm[0-9A-Za-z]\\{44\\} ([1-9][0-9]*)$' <<<\"$line\" >/dev/null || return\n+\t\taddr_count=\"$(cat <<<\"$line\" | sed \"s/^.*(//\" | sed \"s/)$//\")\"\n+\t\tfor i in $(seq \"$addr_count\")\n+\t\tdo\n+\t\t\tIFS='' read -r line || [[ -n $line ]] || return\n+\t\t\tgrep $'^\\t/[^/]*/[^/]*/[^/]*/[^/]*$' <<<\"$line\" >/dev/null || return\n+\t\tdone\n+\tdone","path":"test/sharness/t0130-swarm.sh","position":26,"original_position":26,"commit_id":"dbdc4eb43ffe8adebe60e6aa4890e5612e977a55","original_commit_id":"dbdc4eb43ffe8adebe60e6aa4890e5612e977a55","user":{"login":"jbenet","id":138401,"avatar_url":"https://avatars.githubusercontent.com/u/138401?v=3","gravatar_id":"","url":"https://api.github.com/users/jbenet","html_url":"https://github.com/jbenet","followers_url":"https://api.github.com/users/jbenet/followers","following_url":"https://api.github.com/users/jbenet/following{/other_user}","gists_url":"https://api.github.com/users/jbenet/gists{/gist_id}","starred_url":"https://api.github.com/users/jbenet/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/jbenet/subscriptions","organizations_url":"https://api.github.com/users/jbenet/orgs","repos_url":"https://api.github.com/users/jbenet/repos","events_url":"https://api.github.com/users/jbenet/events{/privacy}","received_events_url":"https://api.github.com/users/jbenet/received_events","type":"User","site_admin":false},"body":"While this may work, it's confusing and hard to edit. It may be better to do what other things do, and compare the actual output to an expected output.\r\n\r\nAddresses may be tricky, because interfaces differ, but can check for `127.0.0.1`.\r\n\r\nAnother approach still may be the check the json output.\r\n\r\nby the way, we can have dedicated programs in other languages that check these outputs, so doesn't _have to_ be in sh","created_at":"2015-03-20T11:26:51Z","updated_at":"2015-03-20T11:26:51Z","html_url":"https://github.com/jbenet/go-ipfs/pull/948#discussion_r26833081","pull_request_url":"https://api.github.com/repos/jbenet/go-ipfs/pulls/948","_links":{"self":{"href":"https://api.github.com/repos/jbenet/go-ipfs/pulls/comments/26833081"},"html":{"href":"https://github.com/jbenet/go-ipfs/pull/948#discussion_r26833081"},"pull_request":{"href":"https://api.github.com/repos/jbenet/go-ipfs/pulls/948"}}},"pull_request":{"url":"https://api.github.com/repos/jbenet/go-ipfs/pulls/948","id":31583985,"html_url":"https://github.com/jbenet/go-ipfs/pull/948","diff_url":"https://github.com/jbenet/go-ipfs/pull/948.diff","patch_url":"https://github.com/jbenet/go-ipfs/pull/948.patch","issue_url":"https://api.github.com/repos/jbenet/go-ipfs/issues/948","number":948,"state":"open","locked":false,"title":"Add `t0130-swarm.sh`","user":{"login":"kkoroviev","id":7325745,"avatar_url":"https://avatars.githubusercontent.com/u/7325745?v=3","gravatar_id":"","url":"https://api.github.com/users/kkoroviev","html_url":"https://github.com/kkoroviev","followers_url":"https://api.github.com/users/kkoroviev/followers","following_url":"https://api.github.com/users/kkoroviev/following{/other_user}","gists_url":"https://api.github.com/users/kkoroviev/gists{/gist_id}","starred_url":"https://api.github.com/users/kkoroviev/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/kkoroviev/subscriptions","organizations_url":"https://api.github.com/users/kkoroviev/orgs","repos_url":"https://api.github.com/users/kkoroviev/repos","events_url":"https://api.github.com/users/kkoroviev/events{/privacy}","received_events_url":"https://api.github.com/users/kkoroviev/received_events","type":"User","site_admin":false},"body":"Online tests for `ipfs swarm addrs`.","created_at":"2015-03-20T02:34:15Z","updated_at":"2015-03-20T11:26:51Z","closed_at":null,"merged_at":null,"merge_commit_sha":"6d3d45cc8c6e1b073f8ac8dcccd6b1ef34fd8c4a","assignee":null,"milestone":null,"commits_url":"https://api.github.com/repos/jbenet/go-ipfs/pulls/948/commits","review_comments_url":"https://api.github.com/repos/jbenet/go-ipfs/pulls/948/comments","review_comment_url":"https://api.github.com/repos/jbenet/go-ipfs/pulls/comments{/number}","comments_url":"https://api.github.com/repos/jbenet/go-ipfs/issues/948/comments","statuses_url":"https://api.github.com/repos/jbenet/go-ipfs/statuses/dbdc4eb43ffe8adebe60e6aa4890e5612e977a55","head":{"label":"kkoroviev:t0130-swarm","ref":"t0130-swarm","sha":"dbdc4eb43ffe8adebe60e6aa4890e5612e977a55","user":{"login":"kkoroviev","id":7325745,"avatar_url":"https://avatars.githubusercontent.com/u/7325745?v=3","gravatar_id":"","url":"https://api.github.com/users/kkoroviev","html_url":"https://github.com/kkoroviev","followers_url":"https://api.github.com/users/kkoroviev/followers","following_url":"https://api.github.com/users/kkoroviev/following{/other_user}","gists_url":"https://api.github.com/users/kkoroviev/gists{/gist_id}","starred_url":"https://api.github.com/users/kkoroviev/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/kkoroviev/subscriptions","organizations_url":"https://api.github.com/users/kkoroviev/orgs","repos_url":"https://api.github.com/users/kkoroviev/repos","events_url":"https://api.github.com/users/kkoroviev/events{/privacy}","received_events_url":"https://api.github.com/users/kkoroviev/received_events","type":"User","site_admin":false},"repo":{"id":31879127,"name":"go-ipfs","full_name":"kkoroviev/go-ipfs","owner":{"login":"kkoroviev","id":7325745,"avatar_url":"https://avatars.githubusercontent.com/u/7325745?v=3","gravatar_id":"","url":"https://api.github.com/users/kkoroviev","html_url":"https://github.com/kkoroviev","followers_url":"https://api.github.com/users/kkoroviev/followers","following_url":"https://api.github.com/users/kkoroviev/following{/other_user}","gists_url":"https://api.github.com/users/kkoroviev/gists{/gist_id}","starred_url":"https://api.github.com/users/kkoroviev/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/kkoroviev/subscriptions","organizations_url":"https://api.github.com/users/kkoroviev/orgs","repos_url":"https://api.github.com/users/kkoroviev/repos","events_url":"https://api.github.com/users/kkoroviev/events{/privacy}","received_events_url":"https://api.github.com/users/kkoroviev/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/kkoroviev/go-ipfs","description":"ipfs implementation in go","fork":true,"url":"https://api.github.com/repos/kkoroviev/go-ipfs","forks_url":"https://api.github.com/repos/kkoroviev/go-ipfs/forks","keys_url":"https://api.github.com/repos/kkoroviev/go-ipfs/keys{/key_id}","collaborators_url":"https://api.github.com/repos/kkoroviev/go-ipfs/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/kkoroviev/go-ipfs/teams","hooks_url":"https://api.github.com/repos/kkoroviev/go-ipfs/hooks","issue_events_url":"https://api.github.com/repos/kkoroviev/go-ipfs/issues/events{/number}","events_url":"https://api.github.com/repos/kkoroviev/go-ipfs/events","assignees_url":"https://api.github.com/repos/kkoroviev/go-ipfs/assignees{/user}","branches_url":"https://api.github.com/repos/kkoroviev/go-ipfs/branches{/branch}","tags_url":"https://api.github.com/repos/kkoroviev/go-ipfs/tags","blobs_url":"https://api.github.com/repos/kkoroviev/go-ipfs/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/kkoroviev/go-ipfs/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/kkoroviev/go-ipfs/git/refs{/sha}","trees_url":"https://api.github.com/repos/kkoroviev/go-ipfs/git/trees{/sha}","statuses_url":"https://api.github.com/repos/kkoroviev/go-ipfs/statuses/{sha}","languages_url":"https://api.github.com/repos/kkoroviev/go-ipfs/languages","stargazers_url":"https://api.github.com/repos/kkoroviev/go-ipfs/stargazers","contributors_url":"https://api.github.com/repos/kkoroviev/go-ipfs/contributors","subscribers_url":"https://api.github.com/repos/kkoroviev/go-ipfs/subscribers","subscription_url":"https://api.github.com/repos/kkoroviev/go-ipfs/subscription","commits_url":"https://api.github.com/repos/kkoroviev/go-ipfs/commits{/sha}","git_commits_url":"https://api.github.com/repos/kkoroviev/go-ipfs/git/commits{/sha}","comments_url":"https://api.github.com/repos/kkoroviev/go-ipfs/comments{/number}","issue_comment_url":"https://api.github.com/repos/kkoroviev/go-ipfs/issues/comments{/number}","contents_url":"https://api.github.com/repos/kkoroviev/go-ipfs/contents/{+path}","compare_url":"https://api.github.com/repos/kkoroviev/go-ipfs/compare/{base}...{head}","merges_url":"https://api.github.com/repos/kkoroviev/go-ipfs/merges","archive_url":"https://api.github.com/repos/kkoroviev/go-ipfs/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/kkoroviev/go-ipfs/downloads","issues_url":"https://api.github.com/repos/kkoroviev/go-ipfs/issues{/number}","pulls_url":"https://api.github.com/repos/kkoroviev/go-ipfs/pulls{/number}","milestones_url":"https://api.github.com/repos/kkoroviev/go-ipfs/milestones{/number}","notifications_url":"https://api.github.com/repos/kkoroviev/go-ipfs/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/kkoroviev/go-ipfs/labels{/name}","releases_url":"https://api.github.com/repos/kkoroviev/go-ipfs/releases{/id}","created_at":"2015-03-09T04:19:51Z","updated_at":"2015-03-09T14:48:46Z","pushed_at":"2015-03-20T02:29:56Z","git_url":"git://github.com/kkoroviev/go-ipfs.git","ssh_url":"git@github.com:kkoroviev/go-ipfs.git","clone_url":"https://github.com/kkoroviev/go-ipfs.git","svn_url":"https://github.com/kkoroviev/go-ipfs","homepage":"https://github.com/jbenet/ipfs","size":15627,"stargazers_count":0,"watchers_count":0,"language":"Go","has_issues":false,"has_downloads":true,"has_wiki":true,"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":"jbenet:master","ref":"master","sha":"59f2f2fe8db0980c72b0c4e5c9839f335bd72a52","user":{"login":"jbenet","id":138401,"avatar_url":"https://avatars.githubusercontent.com/u/138401?v=3","gravatar_id":"","url":"https://api.github.com/users/jbenet","html_url":"https://github.com/jbenet","followers_url":"https://api.github.com/users/jbenet/followers","following_url":"https://api.github.com/users/jbenet/following{/other_user}","gists_url":"https://api.github.com/users/jbenet/gists{/gist_id}","starred_url":"https://api.github.com/users/jbenet/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/jbenet/subscriptions","organizations_url":"https://api.github.com/users/jbenet/orgs","repos_url":"https://api.github.com/users/jbenet/repos","events_url":"https://api.github.com/users/jbenet/events{/privacy}","received_events_url":"https://api.github.com/users/jbenet/received_events","type":"User","site_admin":false},"repo":{"id":21233191,"name":"go-ipfs","full_name":"jbenet/go-ipfs","owner":{"login":"jbenet","id":138401,"avatar_url":"https://avatars.githubusercontent.com/u/138401?v=3","gravatar_id":"","url":"https://api.github.com/users/jbenet","html_url":"https://github.com/jbenet","followers_url":"https://api.github.com/users/jbenet/followers","following_url":"https://api.github.com/users/jbenet/following{/other_user}","gists_url":"https://api.github.com/users/jbenet/gists{/gist_id}","starred_url":"https://api.github.com/users/jbenet/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/jbenet/subscriptions","organizations_url":"https://api.github.com/users/jbenet/orgs","repos_url":"https://api.github.com/users/jbenet/repos","events_url":"https://api.github.com/users/jbenet/events{/privacy}","received_events_url":"https://api.github.com/users/jbenet/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/jbenet/go-ipfs","description":"ipfs implementation in go","fork":false,"url":"https://api.github.com/repos/jbenet/go-ipfs","forks_url":"https://api.github.com/repos/jbenet/go-ipfs/forks","keys_url":"https://api.github.com/repos/jbenet/go-ipfs/keys{/key_id}","collaborators_url":"https://api.github.com/repos/jbenet/go-ipfs/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/jbenet/go-ipfs/teams","hooks_url":"https://api.github.com/repos/jbenet/go-ipfs/hooks","issue_events_url":"https://api.github.com/repos/jbenet/go-ipfs/issues/events{/number}","events_url":"https://api.github.com/repos/jbenet/go-ipfs/events","assignees_url":"https://api.github.com/repos/jbenet/go-ipfs/assignees{/user}","branches_url":"https://api.github.com/repos/jbenet/go-ipfs/branches{/branch}","tags_url":"https://api.github.com/repos/jbenet/go-ipfs/tags","blobs_url":"https://api.github.com/repos/jbenet/go-ipfs/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/jbenet/go-ipfs/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/jbenet/go-ipfs/git/refs{/sha}","trees_url":"https://api.github.com/repos/jbenet/go-ipfs/git/trees{/sha}","statuses_url":"https://api.github.com/repos/jbenet/go-ipfs/statuses/{sha}","languages_url":"https://api.github.com/repos/jbenet/go-ipfs/languages","stargazers_url":"https://api.github.com/repos/jbenet/go-ipfs/stargazers","contributors_url":"https://api.github.com/repos/jbenet/go-ipfs/contributors","subscribers_url":"https://api.github.com/repos/jbenet/go-ipfs/subscribers","subscription_url":"https://api.github.com/repos/jbenet/go-ipfs/subscription","commits_url":"https://api.github.com/repos/jbenet/go-ipfs/commits{/sha}","git_commits_url":"https://api.github.com/repos/jbenet/go-ipfs/git/commits{/sha}","comments_url":"https://api.github.com/repos/jbenet/go-ipfs/comments{/number}","issue_comment_url":"https://api.github.com/repos/jbenet/go-ipfs/issues/comments{/number}","contents_url":"https://api.github.com/repos/jbenet/go-ipfs/contents/{+path}","compare_url":"https://api.github.com/repos/jbenet/go-ipfs/compare/{base}...{head}","merges_url":"https://api.github.com/repos/jbenet/go-ipfs/merges","archive_url":"https://api.github.com/repos/jbenet/go-ipfs/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/jbenet/go-ipfs/downloads","issues_url":"https://api.github.com/repos/jbenet/go-ipfs/issues{/number}","pulls_url":"https://api.github.com/repos/jbenet/go-ipfs/pulls{/number}","milestones_url":"https://api.github.com/repos/jbenet/go-ipfs/milestones{/number}","notifications_url":"https://api.github.com/repos/jbenet/go-ipfs/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/jbenet/go-ipfs/labels{/name}","releases_url":"https://api.github.com/repos/jbenet/go-ipfs/releases{/id}","created_at":"2014-06-26T08:14:34Z","updated_at":"2015-03-19T19:12:19Z","pushed_at":"2015-03-20T05:49:52Z","git_url":"git://github.com/jbenet/go-ipfs.git","ssh_url":"git@github.com:jbenet/go-ipfs.git","clone_url":"https://github.com/jbenet/go-ipfs.git","svn_url":"https://github.com/jbenet/go-ipfs","homepage":"https://github.com/jbenet/ipfs","size":30652,"stargazers_count":352,"watchers_count":352,"language":"Go","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":54,"mirror_url":null,"open_issues_count":193,"forks":54,"open_issues":193,"watchers":352,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/jbenet/go-ipfs/pulls/948"},"html":{"href":"https://github.com/jbenet/go-ipfs/pull/948"},"issue":{"href":"https://api.github.com/repos/jbenet/go-ipfs/issues/948"},"comments":{"href":"https://api.github.com/repos/jbenet/go-ipfs/issues/948/comments"},"review_comments":{"href":"https://api.github.com/repos/jbenet/go-ipfs/pulls/948/comments"},"review_comment":{"href":"https://api.github.com/repos/jbenet/go-ipfs/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/jbenet/go-ipfs/pulls/948/commits"},"statuses":{"href":"https://api.github.com/repos/jbenet/go-ipfs/statuses/dbdc4eb43ffe8adebe60e6aa4890e5612e977a55"}}}}