{"action":"created","comment":{"url":"https://api.github.com/repos/SUSE/machinery/pulls/comments/40306461","id":40306461,"diff_hunk":"@@ -0,0 +1,113 @@\n+# Copyright (c) 2013-2015 SUSE LLC\n+#\n+# This program is free software; you can redistribute it and/or\n+# modify it under the terms of version 3 of the GNU General Public License as\n+# published by the Free Software Foundation.\n+#\n+# This program is distributed in the hope that it will be useful,\n+# but WITHOUT ANY WARRANTY; without even the implied warranty of\n+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.   See the\n+# GNU General Public License for more details.\n+#\n+# You should have received a copy of the GNU General Public License\n+# along with this program; if not, contact SUSE LLC.\n+#\n+# To contact SUSE about this file by physical or electronic mail,\n+# you may find current contact information at www.suse.com\n+\n+\n+shared_examples \"inspect-container --docker simple scope\" do |scope, container|\n+  describe \"--scope=#{scope}\" do\n+    it \"inspects #{scope}\" do\n+      measure(\"Inspect #{scope}\") do\n+        expect(\n+          @machinery.run_command(\n+            \"#{machinery_command} inspect-container -x --docker machinerytool/#{container} \" \\\n+              \"--scope=#{scope} --name=test\",\n+            as: \"vagrant\"\n+          )\n+        ).to succeed\n+      end\n+\n+      expected = File.read(\"spec/data/docker/#{scope}/#{container}\")\n+      show_command = @machinery.run_command(\n+        \"#{machinery_command} show test --scope=#{scope}\",\n+        as: \"vagrant\"\n+      )\n+      expect(show_command).to succeed\n+      expect(show_command.stdout).to match_machinery_show_scope(expected)\n+    end\n+  end\n+end\n+\n+[\n+  \"packages\",\n+  \"patterns\",\n+  \"repositories\",\n+  \"services\",\n+  \"os\",\n+  \"users\",\n+  \"groups\"\n+].each do |scope|\n+  shared_examples \"inspect-container --docker #{scope}\" do |container|\n+    include_examples(\"inspect-container --docker simple scope\", scope, container)\n+  end\n+end\n+\n+shared_examples \"inspect-container --docker\" do |container|\n+  describe \"inspect-container --docker #{container}\" do\n+    let(:inspect_options) {\n+      \"--remote-user=#{username}\" if username != \"root\"\n+    }\n+\n+    [\n+      \"packages\",\n+      \"patterns\",\n+      \"repositories\",\n+      \"services\",\n+      \"os\",\n+      \"users\",\n+      \"groups\",\n+      \"unmanaged-files\",\n+      \"config-files\",\n+      \"changed-managed-files\"\n+    ].each do |scope|\n+      include_examples(\"inspect-container --docker simple scope\", scope, container)\n+    end\n+\n+    context \"--scope=config-files\" do\n+      it \"extracts the files\" do\n+        ls_command =  @machinery.run_command(\n+          \"ls #{machinery_config[:machinery_dir]}/test/config_files/etc/\",\n+          as: \"vagrant\"\n+        )\n+\n+        expect(ls_command).to succeed\n+        expect(ls_command.stdout.chomp).to eq(\"securetty\")\n+      end\n+    end\n+\n+    context \"--scope=unmanaged-files\" do\n+      it \"extracts the files\" do\n+        expected = File.read(\"spec/data/docker/unmanaged-files/#{container}_files_tgz_content\")\n+        files_content_command =  @machinery.run_command(\n+          \"tar -tf #{machinery_config[:machinery_dir]}/test/unmanaged_files/files.tgz\",\n+          as: \"vagrant\"\n+        )\n+\n+        expect(files_content_command).to succeed\n+        expect(files_content_command.stdout).to eq(expected)\n+      end\n+      it \"extracts the trees\" do\n+        expected = File.read(\"spec/data/docker/unmanaged-files/#{container}_etc_lxc_tgz_content\")\n+        tree_content_command =  @machinery.run_command(","path":"spec/integration/support/inspect_docker_examples.rb","position":103,"original_position":103,"commit_id":"480e7d418a4706fb1f008a9edb92e41b13595f31","original_commit_id":"480e7d418a4706fb1f008a9edb92e41b13595f31","user":{"login":"houndci","id":6697940,"avatar_url":"https://avatars.githubusercontent.com/u/6697940?v=3","gravatar_id":"","url":"https://api.github.com/users/houndci","html_url":"https://github.com/houndci","followers_url":"https://api.github.com/users/houndci/followers","following_url":"https://api.github.com/users/houndci/following{/other_user}","gists_url":"https://api.github.com/users/houndci/gists{/gist_id}","starred_url":"https://api.github.com/users/houndci/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/houndci/subscriptions","organizations_url":"https://api.github.com/users/houndci/orgs","repos_url":"https://api.github.com/users/houndci/repos","events_url":"https://api.github.com/users/houndci/events{/privacy}","received_events_url":"https://api.github.com/users/houndci/received_events","type":"User","site_admin":false},"body":"Unnecessary spacing detected.","created_at":"2015-09-24T10:50:28Z","updated_at":"2015-09-24T10:50:28Z","html_url":"https://github.com/SUSE/machinery/pull/1401#discussion_r40306461","pull_request_url":"https://api.github.com/repos/SUSE/machinery/pulls/1401","_links":{"self":{"href":"https://api.github.com/repos/SUSE/machinery/pulls/comments/40306461"},"html":{"href":"https://github.com/SUSE/machinery/pull/1401#discussion_r40306461"},"pull_request":{"href":"https://api.github.com/repos/SUSE/machinery/pulls/1401"}}},"pull_request":{"url":"https://api.github.com/repos/SUSE/machinery/pulls/1401","id":45749709,"html_url":"https://github.com/SUSE/machinery/pull/1401","diff_url":"https://github.com/SUSE/machinery/pull/1401.diff","patch_url":"https://github.com/SUSE/machinery/pull/1401.patch","issue_url":"https://api.github.com/repos/SUSE/machinery/issues/1401","number":1401,"state":"open","locked":false,"title":"[Review] Request from 'aduffeck' @ 'SUSE/machinery/inspect_container2'","user":{"login":"aduffeck","id":203813,"avatar_url":"https://avatars.githubusercontent.com/u/203813?v=3","gravatar_id":"","url":"https://api.github.com/users/aduffeck","html_url":"https://github.com/aduffeck","followers_url":"https://api.github.com/users/aduffeck/followers","following_url":"https://api.github.com/users/aduffeck/following{/other_user}","gists_url":"https://api.github.com/users/aduffeck/gists{/gist_id}","starred_url":"https://api.github.com/users/aduffeck/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/aduffeck/subscriptions","organizations_url":"https://api.github.com/users/aduffeck/orgs","repos_url":"https://api.github.com/users/aduffeck/repos","events_url":"https://api.github.com/users/aduffeck/events{/privacy}","received_events_url":"https://api.github.com/users/aduffeck/received_events","type":"User","site_admin":false},"body":"Please review the following changes:\r\n  * 43f75fe Add changelog entry for docker container inspection\r\n  * becb2b2 Only remove the helper binary after doing the file extraction\r\n  * 833cd12 Implement \"machinery inspect-container\" command\r\n  * 022ad06 Add DockerSystem and DockerContainer for working with docker containers\r\n  * 5e43b33 Store the system type in the environment scope\r\n  * 182875b Pass a System object to InspectTask instead of a hostname","created_at":"2015-09-23T07:20:39Z","updated_at":"2015-09-24T10:50:28Z","closed_at":null,"merged_at":null,"merge_commit_sha":"69d75634bf6579efd9c6ea68d8b082dfb54b8963","assignee":null,"milestone":null,"commits_url":"https://api.github.com/repos/SUSE/machinery/pulls/1401/commits","review_comments_url":"https://api.github.com/repos/SUSE/machinery/pulls/1401/comments","review_comment_url":"https://api.github.com/repos/SUSE/machinery/pulls/comments{/number}","comments_url":"https://api.github.com/repos/SUSE/machinery/issues/1401/comments","statuses_url":"https://api.github.com/repos/SUSE/machinery/statuses/480e7d418a4706fb1f008a9edb92e41b13595f31","head":{"label":"SUSE:inspect_container2","ref":"inspect_container2","sha":"480e7d418a4706fb1f008a9edb92e41b13595f31","user":{"login":"SUSE","id":1067733,"avatar_url":"https://avatars.githubusercontent.com/u/1067733?v=3","gravatar_id":"","url":"https://api.github.com/users/SUSE","html_url":"https://github.com/SUSE","followers_url":"https://api.github.com/users/SUSE/followers","following_url":"https://api.github.com/users/SUSE/following{/other_user}","gists_url":"https://api.github.com/users/SUSE/gists{/gist_id}","starred_url":"https://api.github.com/users/SUSE/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/SUSE/subscriptions","organizations_url":"https://api.github.com/users/SUSE/orgs","repos_url":"https://api.github.com/users/SUSE/repos","events_url":"https://api.github.com/users/SUSE/events{/privacy}","received_events_url":"https://api.github.com/users/SUSE/received_events","type":"Organization","site_admin":false},"repo":{"id":21424418,"name":"machinery","full_name":"SUSE/machinery","owner":{"login":"SUSE","id":1067733,"avatar_url":"https://avatars.githubusercontent.com/u/1067733?v=3","gravatar_id":"","url":"https://api.github.com/users/SUSE","html_url":"https://github.com/SUSE","followers_url":"https://api.github.com/users/SUSE/followers","following_url":"https://api.github.com/users/SUSE/following{/other_user}","gists_url":"https://api.github.com/users/SUSE/gists{/gist_id}","starred_url":"https://api.github.com/users/SUSE/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/SUSE/subscriptions","organizations_url":"https://api.github.com/users/SUSE/orgs","repos_url":"https://api.github.com/users/SUSE/repos","events_url":"https://api.github.com/users/SUSE/events{/privacy}","received_events_url":"https://api.github.com/users/SUSE/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/SUSE/machinery","description":"A systems management toolkit for Linux","fork":false,"url":"https://api.github.com/repos/SUSE/machinery","forks_url":"https://api.github.com/repos/SUSE/machinery/forks","keys_url":"https://api.github.com/repos/SUSE/machinery/keys{/key_id}","collaborators_url":"https://api.github.com/repos/SUSE/machinery/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/SUSE/machinery/teams","hooks_url":"https://api.github.com/repos/SUSE/machinery/hooks","issue_events_url":"https://api.github.com/repos/SUSE/machinery/issues/events{/number}","events_url":"https://api.github.com/repos/SUSE/machinery/events","assignees_url":"https://api.github.com/repos/SUSE/machinery/assignees{/user}","branches_url":"https://api.github.com/repos/SUSE/machinery/branches{/branch}","tags_url":"https://api.github.com/repos/SUSE/machinery/tags","blobs_url":"https://api.github.com/repos/SUSE/machinery/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/SUSE/machinery/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/SUSE/machinery/git/refs{/sha}","trees_url":"https://api.github.com/repos/SUSE/machinery/git/trees{/sha}","statuses_url":"https://api.github.com/repos/SUSE/machinery/statuses/{sha}","languages_url":"https://api.github.com/repos/SUSE/machinery/languages","stargazers_url":"https://api.github.com/repos/SUSE/machinery/stargazers","contributors_url":"https://api.github.com/repos/SUSE/machinery/contributors","subscribers_url":"https://api.github.com/repos/SUSE/machinery/subscribers","subscription_url":"https://api.github.com/repos/SUSE/machinery/subscription","commits_url":"https://api.github.com/repos/SUSE/machinery/commits{/sha}","git_commits_url":"https://api.github.com/repos/SUSE/machinery/git/commits{/sha}","comments_url":"https://api.github.com/repos/SUSE/machinery/comments{/number}","issue_comment_url":"https://api.github.com/repos/SUSE/machinery/issues/comments{/number}","contents_url":"https://api.github.com/repos/SUSE/machinery/contents/{+path}","compare_url":"https://api.github.com/repos/SUSE/machinery/compare/{base}...{head}","merges_url":"https://api.github.com/repos/SUSE/machinery/merges","archive_url":"https://api.github.com/repos/SUSE/machinery/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/SUSE/machinery/downloads","issues_url":"https://api.github.com/repos/SUSE/machinery/issues{/number}","pulls_url":"https://api.github.com/repos/SUSE/machinery/pulls{/number}","milestones_url":"https://api.github.com/repos/SUSE/machinery/milestones{/number}","notifications_url":"https://api.github.com/repos/SUSE/machinery/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/SUSE/machinery/labels{/name}","releases_url":"https://api.github.com/repos/SUSE/machinery/releases{/id}","created_at":"2014-07-02T13:07:04Z","updated_at":"2015-09-11T06:28:41Z","pushed_at":"2015-09-24T10:50:20Z","git_url":"git://github.com/SUSE/machinery.git","ssh_url":"git@github.com:SUSE/machinery.git","clone_url":"https://github.com/SUSE/machinery.git","svn_url":"https://github.com/SUSE/machinery","homepage":"machinery-project.org","size":69531,"stargazers_count":56,"watchers_count":56,"language":"Ruby","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":true,"forks_count":11,"mirror_url":null,"open_issues_count":36,"forks":11,"open_issues":36,"watchers":56,"default_branch":"master"}},"base":{"label":"SUSE:master","ref":"master","sha":"5e55a019c41d0ce9c5d4807e05b3298148eee7ff","user":{"login":"SUSE","id":1067733,"avatar_url":"https://avatars.githubusercontent.com/u/1067733?v=3","gravatar_id":"","url":"https://api.github.com/users/SUSE","html_url":"https://github.com/SUSE","followers_url":"https://api.github.com/users/SUSE/followers","following_url":"https://api.github.com/users/SUSE/following{/other_user}","gists_url":"https://api.github.com/users/SUSE/gists{/gist_id}","starred_url":"https://api.github.com/users/SUSE/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/SUSE/subscriptions","organizations_url":"https://api.github.com/users/SUSE/orgs","repos_url":"https://api.github.com/users/SUSE/repos","events_url":"https://api.github.com/users/SUSE/events{/privacy}","received_events_url":"https://api.github.com/users/SUSE/received_events","type":"Organization","site_admin":false},"repo":{"id":21424418,"name":"machinery","full_name":"SUSE/machinery","owner":{"login":"SUSE","id":1067733,"avatar_url":"https://avatars.githubusercontent.com/u/1067733?v=3","gravatar_id":"","url":"https://api.github.com/users/SUSE","html_url":"https://github.com/SUSE","followers_url":"https://api.github.com/users/SUSE/followers","following_url":"https://api.github.com/users/SUSE/following{/other_user}","gists_url":"https://api.github.com/users/SUSE/gists{/gist_id}","starred_url":"https://api.github.com/users/SUSE/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/SUSE/subscriptions","organizations_url":"https://api.github.com/users/SUSE/orgs","repos_url":"https://api.github.com/users/SUSE/repos","events_url":"https://api.github.com/users/SUSE/events{/privacy}","received_events_url":"https://api.github.com/users/SUSE/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/SUSE/machinery","description":"A systems management toolkit for Linux","fork":false,"url":"https://api.github.com/repos/SUSE/machinery","forks_url":"https://api.github.com/repos/SUSE/machinery/forks","keys_url":"https://api.github.com/repos/SUSE/machinery/keys{/key_id}","collaborators_url":"https://api.github.com/repos/SUSE/machinery/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/SUSE/machinery/teams","hooks_url":"https://api.github.com/repos/SUSE/machinery/hooks","issue_events_url":"https://api.github.com/repos/SUSE/machinery/issues/events{/number}","events_url":"https://api.github.com/repos/SUSE/machinery/events","assignees_url":"https://api.github.com/repos/SUSE/machinery/assignees{/user}","branches_url":"https://api.github.com/repos/SUSE/machinery/branches{/branch}","tags_url":"https://api.github.com/repos/SUSE/machinery/tags","blobs_url":"https://api.github.com/repos/SUSE/machinery/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/SUSE/machinery/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/SUSE/machinery/git/refs{/sha}","trees_url":"https://api.github.com/repos/SUSE/machinery/git/trees{/sha}","statuses_url":"https://api.github.com/repos/SUSE/machinery/statuses/{sha}","languages_url":"https://api.github.com/repos/SUSE/machinery/languages","stargazers_url":"https://api.github.com/repos/SUSE/machinery/stargazers","contributors_url":"https://api.github.com/repos/SUSE/machinery/contributors","subscribers_url":"https://api.github.com/repos/SUSE/machinery/subscribers","subscription_url":"https://api.github.com/repos/SUSE/machinery/subscription","commits_url":"https://api.github.com/repos/SUSE/machinery/commits{/sha}","git_commits_url":"https://api.github.com/repos/SUSE/machinery/git/commits{/sha}","comments_url":"https://api.github.com/repos/SUSE/machinery/comments{/number}","issue_comment_url":"https://api.github.com/repos/SUSE/machinery/issues/comments{/number}","contents_url":"https://api.github.com/repos/SUSE/machinery/contents/{+path}","compare_url":"https://api.github.com/repos/SUSE/machinery/compare/{base}...{head}","merges_url":"https://api.github.com/repos/SUSE/machinery/merges","archive_url":"https://api.github.com/repos/SUSE/machinery/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/SUSE/machinery/downloads","issues_url":"https://api.github.com/repos/SUSE/machinery/issues{/number}","pulls_url":"https://api.github.com/repos/SUSE/machinery/pulls{/number}","milestones_url":"https://api.github.com/repos/SUSE/machinery/milestones{/number}","notifications_url":"https://api.github.com/repos/SUSE/machinery/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/SUSE/machinery/labels{/name}","releases_url":"https://api.github.com/repos/SUSE/machinery/releases{/id}","created_at":"2014-07-02T13:07:04Z","updated_at":"2015-09-11T06:28:41Z","pushed_at":"2015-09-24T10:50:20Z","git_url":"git://github.com/SUSE/machinery.git","ssh_url":"git@github.com:SUSE/machinery.git","clone_url":"https://github.com/SUSE/machinery.git","svn_url":"https://github.com/SUSE/machinery","homepage":"machinery-project.org","size":69531,"stargazers_count":56,"watchers_count":56,"language":"Ruby","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":true,"forks_count":11,"mirror_url":null,"open_issues_count":36,"forks":11,"open_issues":36,"watchers":56,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/SUSE/machinery/pulls/1401"},"html":{"href":"https://github.com/SUSE/machinery/pull/1401"},"issue":{"href":"https://api.github.com/repos/SUSE/machinery/issues/1401"},"comments":{"href":"https://api.github.com/repos/SUSE/machinery/issues/1401/comments"},"review_comments":{"href":"https://api.github.com/repos/SUSE/machinery/pulls/1401/comments"},"review_comment":{"href":"https://api.github.com/repos/SUSE/machinery/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/SUSE/machinery/pulls/1401/commits"},"statuses":{"href":"https://api.github.com/repos/SUSE/machinery/statuses/480e7d418a4706fb1f008a9edb92e41b13595f31"}}}}