{"action":"created","comment":{"url":"https://api.github.com/repos/puppetlabs/puppet/pulls/comments/53134226","id":53134226,"diff_hunk":"@@ -0,0 +1,114 @@\n+test_name \"PUP-5122: Puppet remediates local drift using code_id and content_uri\" do\n+  basedir = master.tmpdir(File.basename(__FILE__, '.*'))\n+  module_dir = \"#{basedir}/environments/production/modules\"\n+  modulepath = \"#{module_dir}\"\n+  agent_test_file_path = agent.tmpfile('foo_file')\n+\n+  master_opts = {\n+   'master' => {\n+      'static_catalogs' => true\n+    },\n+   'main' => {\n+      'environmentpath' => \"#{basedir}/environments\"\n+    }\n+  }\n+\n+  step \"Add versioned-code parameters to puppetserver.conf and ensure the server is running\" do\n+    puppetserver_config = \"#{master['puppetserver-confdir']}/puppetserver.conf\"\n+    versioned_code_settings = {\"code-id-command\" => \"#{basedir}/code_id.sh\", \"code-content-command\" => \"#{basedir}/code_content.sh\"}\n+\n+    modify_tk_config(master, puppetserver_config, versioned_code_settings)\n+    on(master, puppet_resource('service', 'puppetserver', 'ensure=running'))\n+  end\n+\n+  step \"Create a module and a file with content representing the first code_id version, and Setup code-id-command and code-content-command scripts\" do\n+    code_id_command = <<EOF\n+    #! /bin/sh\n+\n+    echo 'code_version_1'\n+EOF\n+\n+    code_content_command = <<EOF\n+    #! /bin/sh\n+\n+    if [ \\\\\\$2 == 'code_version_1' ] ; then\n+      echo 'code_version_1'\n+    else\n+      echo 'newer_code_version'\n+    fi\n+EOF\n+\n+    apply_manifest_on(master, <<MANIFEST, :catch_failures => true)\n+    File {\n+      ensure => directory,\n+      mode => \"0750\",\n+      owner => #{master.puppet['user']},\n+      group => #{master.puppet['group']},\n+    }\n+\n+    file {\n+      '#{basedir}':;\n+      '#{basedir}/environments':;\n+      '#{basedir}/environments/production':;\n+      '#{basedir}/environments/production/manifests':;\n+      '#{module_dir}':;\n+      '#{module_dir}/foo':;\n+      '#{module_dir}/foo/files':;\n+    }\n+\n+    file { \"site.pp\":\n+      ensure => file,\n+      path => \"#{basedir}/environments/production/manifests/site.pp\",\n+      content => \"node default { file { 'foo_file': ensure => file, path => '#{agent_test_file_path}', source => 'puppet:///modules/foo/foo.txt' } }\",\n+      mode => \"0640\",\n+    }\n+\n+    file { \"foo_file\":\n+      ensure => file,\n+      path => \"#{module_dir}/foo/files/foo.txt\",\n+      content => \"code_version_1\",\n+      mode => \"0640\",\n+    }\n+\n+    file { '#{basedir}/code_id.sh':\n+      ensure => file,\n+      content => \"#{code_id_command}\",\n+      mode => \"0700\",","path":"acceptance/tests/direct_puppet/cached_catalog_remediate_local_drift.rb","position":76,"original_position":76,"commit_id":"c5a2110cf6e3bf6c386bca43ff6640c368b5d217","original_commit_id":"c5a2110cf6e3bf6c386bca43ff6640c368b5d217","user":{"login":"joshcooper","id":737664,"avatar_url":"https://avatars.githubusercontent.com/u/737664?v=3","gravatar_id":"","url":"https://api.github.com/users/joshcooper","html_url":"https://github.com/joshcooper","followers_url":"https://api.github.com/users/joshcooper/followers","following_url":"https://api.github.com/users/joshcooper/following{/other_user}","gists_url":"https://api.github.com/users/joshcooper/gists{/gist_id}","starred_url":"https://api.github.com/users/joshcooper/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/joshcooper/subscriptions","organizations_url":"https://api.github.com/users/joshcooper/orgs","repos_url":"https://api.github.com/users/joshcooper/repos","events_url":"https://api.github.com/users/joshcooper/events{/privacy}","received_events_url":"https://api.github.com/users/joshcooper/received_events","type":"User","site_admin":false},"body":"This assumes the user that puppet is running as (via beaker) is the same as what `puppetserver` is running as. I'm not sure if that'll be an issue for PE and pe-puppet? May want to relax to 0755.","created_at":"2016-02-17T08:44:17Z","updated_at":"2016-02-17T08:44:17Z","html_url":"https://github.com/puppetlabs/puppet/pull/4666#discussion_r53134226","pull_request_url":"https://api.github.com/repos/puppetlabs/puppet/pulls/4666","_links":{"self":{"href":"https://api.github.com/repos/puppetlabs/puppet/pulls/comments/53134226"},"html":{"href":"https://github.com/puppetlabs/puppet/pull/4666#discussion_r53134226"},"pull_request":{"href":"https://api.github.com/repos/puppetlabs/puppet/pulls/4666"}}},"pull_request":{"url":"https://api.github.com/repos/puppetlabs/puppet/pulls/4666","id":59230287,"html_url":"https://github.com/puppetlabs/puppet/pull/4666","diff_url":"https://github.com/puppetlabs/puppet/pull/4666.diff","patch_url":"https://github.com/puppetlabs/puppet/pull/4666.patch","issue_url":"https://api.github.com/repos/puppetlabs/puppet/issues/4666","number":4666,"state":"open","locked":false,"title":"(PUP-5122) Add acceptance test for direct puppet running from cache","user":{"login":"whopper","id":507621,"avatar_url":"https://avatars.githubusercontent.com/u/507621?v=3","gravatar_id":"","url":"https://api.github.com/users/whopper","html_url":"https://github.com/whopper","followers_url":"https://api.github.com/users/whopper/followers","following_url":"https://api.github.com/users/whopper/following{/other_user}","gists_url":"https://api.github.com/users/whopper/gists{/gist_id}","starred_url":"https://api.github.com/users/whopper/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/whopper/subscriptions","organizations_url":"https://api.github.com/users/whopper/orgs","repos_url":"https://api.github.com/users/whopper/repos","events_url":"https://api.github.com/users/whopper/events{/privacy}","received_events_url":"https://api.github.com/users/whopper/received_events","type":"User","site_admin":false},"body":"This commit adds the skeleton of an acceptance test for the scenario\r\nwhere the server tells the agent to run from its cached catalog and\r\nremediates local drift to file content.\r\n\r\nOnce further work has been done on actually retrieving file content\r\nusing content_uri (PUP-5114), this test will be expanded.","created_at":"2016-02-12T21:00:24Z","updated_at":"2016-02-17T08:44:17Z","closed_at":null,"merged_at":null,"merge_commit_sha":"93d70f25e96b86f44ac98cf04a69fde76eeba233","assignee":null,"milestone":null,"commits_url":"https://api.github.com/repos/puppetlabs/puppet/pulls/4666/commits","review_comments_url":"https://api.github.com/repos/puppetlabs/puppet/pulls/4666/comments","review_comment_url":"https://api.github.com/repos/puppetlabs/puppet/pulls/comments{/number}","comments_url":"https://api.github.com/repos/puppetlabs/puppet/issues/4666/comments","statuses_url":"https://api.github.com/repos/puppetlabs/puppet/statuses/c5a2110cf6e3bf6c386bca43ff6640c368b5d217","head":{"label":"whopper:PUP-5122/acceptance/direct_puppet_cache","ref":"PUP-5122/acceptance/direct_puppet_cache","sha":"c5a2110cf6e3bf6c386bca43ff6640c368b5d217","user":{"login":"whopper","id":507621,"avatar_url":"https://avatars.githubusercontent.com/u/507621?v=3","gravatar_id":"","url":"https://api.github.com/users/whopper","html_url":"https://github.com/whopper","followers_url":"https://api.github.com/users/whopper/followers","following_url":"https://api.github.com/users/whopper/following{/other_user}","gists_url":"https://api.github.com/users/whopper/gists{/gist_id}","starred_url":"https://api.github.com/users/whopper/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/whopper/subscriptions","organizations_url":"https://api.github.com/users/whopper/orgs","repos_url":"https://api.github.com/users/whopper/repos","events_url":"https://api.github.com/users/whopper/events{/privacy}","received_events_url":"https://api.github.com/users/whopper/received_events","type":"User","site_admin":false},"repo":{"id":4678592,"name":"puppet","full_name":"whopper/puppet","owner":{"login":"whopper","id":507621,"avatar_url":"https://avatars.githubusercontent.com/u/507621?v=3","gravatar_id":"","url":"https://api.github.com/users/whopper","html_url":"https://github.com/whopper","followers_url":"https://api.github.com/users/whopper/followers","following_url":"https://api.github.com/users/whopper/following{/other_user}","gists_url":"https://api.github.com/users/whopper/gists{/gist_id}","starred_url":"https://api.github.com/users/whopper/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/whopper/subscriptions","organizations_url":"https://api.github.com/users/whopper/orgs","repos_url":"https://api.github.com/users/whopper/repos","events_url":"https://api.github.com/users/whopper/events{/privacy}","received_events_url":"https://api.github.com/users/whopper/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/whopper/puppet","description":"Server automation framework and application","fork":true,"url":"https://api.github.com/repos/whopper/puppet","forks_url":"https://api.github.com/repos/whopper/puppet/forks","keys_url":"https://api.github.com/repos/whopper/puppet/keys{/key_id}","collaborators_url":"https://api.github.com/repos/whopper/puppet/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/whopper/puppet/teams","hooks_url":"https://api.github.com/repos/whopper/puppet/hooks","issue_events_url":"https://api.github.com/repos/whopper/puppet/issues/events{/number}","events_url":"https://api.github.com/repos/whopper/puppet/events","assignees_url":"https://api.github.com/repos/whopper/puppet/assignees{/user}","branches_url":"https://api.github.com/repos/whopper/puppet/branches{/branch}","tags_url":"https://api.github.com/repos/whopper/puppet/tags","blobs_url":"https://api.github.com/repos/whopper/puppet/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/whopper/puppet/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/whopper/puppet/git/refs{/sha}","trees_url":"https://api.github.com/repos/whopper/puppet/git/trees{/sha}","statuses_url":"https://api.github.com/repos/whopper/puppet/statuses/{sha}","languages_url":"https://api.github.com/repos/whopper/puppet/languages","stargazers_url":"https://api.github.com/repos/whopper/puppet/stargazers","contributors_url":"https://api.github.com/repos/whopper/puppet/contributors","subscribers_url":"https://api.github.com/repos/whopper/puppet/subscribers","subscription_url":"https://api.github.com/repos/whopper/puppet/subscription","commits_url":"https://api.github.com/repos/whopper/puppet/commits{/sha}","git_commits_url":"https://api.github.com/repos/whopper/puppet/git/commits{/sha}","comments_url":"https://api.github.com/repos/whopper/puppet/comments{/number}","issue_comment_url":"https://api.github.com/repos/whopper/puppet/issues/comments{/number}","contents_url":"https://api.github.com/repos/whopper/puppet/contents/{+path}","compare_url":"https://api.github.com/repos/whopper/puppet/compare/{base}...{head}","merges_url":"https://api.github.com/repos/whopper/puppet/merges","archive_url":"https://api.github.com/repos/whopper/puppet/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/whopper/puppet/downloads","issues_url":"https://api.github.com/repos/whopper/puppet/issues{/number}","pulls_url":"https://api.github.com/repos/whopper/puppet/pulls{/number}","milestones_url":"https://api.github.com/repos/whopper/puppet/milestones{/number}","notifications_url":"https://api.github.com/repos/whopper/puppet/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/whopper/puppet/labels{/name}","releases_url":"https://api.github.com/repos/whopper/puppet/releases{/id}","deployments_url":"https://api.github.com/repos/whopper/puppet/deployments","created_at":"2012-06-15T18:31:29Z","updated_at":"2014-09-29T18:19:22Z","pushed_at":"2016-02-17T01:56:23Z","git_url":"git://github.com/whopper/puppet.git","ssh_url":"git@github.com:whopper/puppet.git","clone_url":"https://github.com/whopper/puppet.git","svn_url":"https://github.com/whopper/puppet","homepage":"http://www.puppetlabs.com/puppet/introduction/","size":52825,"stargazers_count":1,"watchers_count":1,"language":"Ruby","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":1,"default_branch":"master"}},"base":{"label":"puppetlabs:master","ref":"master","sha":"6692e4bb69fa38031c7c12496a811756da63eb5b","user":{"login":"puppetlabs","id":234268,"avatar_url":"https://avatars.githubusercontent.com/u/234268?v=3","gravatar_id":"","url":"https://api.github.com/users/puppetlabs","html_url":"https://github.com/puppetlabs","followers_url":"https://api.github.com/users/puppetlabs/followers","following_url":"https://api.github.com/users/puppetlabs/following{/other_user}","gists_url":"https://api.github.com/users/puppetlabs/gists{/gist_id}","starred_url":"https://api.github.com/users/puppetlabs/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/puppetlabs/subscriptions","organizations_url":"https://api.github.com/users/puppetlabs/orgs","repos_url":"https://api.github.com/users/puppetlabs/repos","events_url":"https://api.github.com/users/puppetlabs/events{/privacy}","received_events_url":"https://api.github.com/users/puppetlabs/received_events","type":"Organization","site_admin":false},"repo":{"id":910744,"name":"puppet","full_name":"puppetlabs/puppet","owner":{"login":"puppetlabs","id":234268,"avatar_url":"https://avatars.githubusercontent.com/u/234268?v=3","gravatar_id":"","url":"https://api.github.com/users/puppetlabs","html_url":"https://github.com/puppetlabs","followers_url":"https://api.github.com/users/puppetlabs/followers","following_url":"https://api.github.com/users/puppetlabs/following{/other_user}","gists_url":"https://api.github.com/users/puppetlabs/gists{/gist_id}","starred_url":"https://api.github.com/users/puppetlabs/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/puppetlabs/subscriptions","organizations_url":"https://api.github.com/users/puppetlabs/orgs","repos_url":"https://api.github.com/users/puppetlabs/repos","events_url":"https://api.github.com/users/puppetlabs/events{/privacy}","received_events_url":"https://api.github.com/users/puppetlabs/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/puppetlabs/puppet","description":"Server automation framework and application","fork":false,"url":"https://api.github.com/repos/puppetlabs/puppet","forks_url":"https://api.github.com/repos/puppetlabs/puppet/forks","keys_url":"https://api.github.com/repos/puppetlabs/puppet/keys{/key_id}","collaborators_url":"https://api.github.com/repos/puppetlabs/puppet/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/puppetlabs/puppet/teams","hooks_url":"https://api.github.com/repos/puppetlabs/puppet/hooks","issue_events_url":"https://api.github.com/repos/puppetlabs/puppet/issues/events{/number}","events_url":"https://api.github.com/repos/puppetlabs/puppet/events","assignees_url":"https://api.github.com/repos/puppetlabs/puppet/assignees{/user}","branches_url":"https://api.github.com/repos/puppetlabs/puppet/branches{/branch}","tags_url":"https://api.github.com/repos/puppetlabs/puppet/tags","blobs_url":"https://api.github.com/repos/puppetlabs/puppet/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/puppetlabs/puppet/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/puppetlabs/puppet/git/refs{/sha}","trees_url":"https://api.github.com/repos/puppetlabs/puppet/git/trees{/sha}","statuses_url":"https://api.github.com/repos/puppetlabs/puppet/statuses/{sha}","languages_url":"https://api.github.com/repos/puppetlabs/puppet/languages","stargazers_url":"https://api.github.com/repos/puppetlabs/puppet/stargazers","contributors_url":"https://api.github.com/repos/puppetlabs/puppet/contributors","subscribers_url":"https://api.github.com/repos/puppetlabs/puppet/subscribers","subscription_url":"https://api.github.com/repos/puppetlabs/puppet/subscription","commits_url":"https://api.github.com/repos/puppetlabs/puppet/commits{/sha}","git_commits_url":"https://api.github.com/repos/puppetlabs/puppet/git/commits{/sha}","comments_url":"https://api.github.com/repos/puppetlabs/puppet/comments{/number}","issue_comment_url":"https://api.github.com/repos/puppetlabs/puppet/issues/comments{/number}","contents_url":"https://api.github.com/repos/puppetlabs/puppet/contents/{+path}","compare_url":"https://api.github.com/repos/puppetlabs/puppet/compare/{base}...{head}","merges_url":"https://api.github.com/repos/puppetlabs/puppet/merges","archive_url":"https://api.github.com/repos/puppetlabs/puppet/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/puppetlabs/puppet/downloads","issues_url":"https://api.github.com/repos/puppetlabs/puppet/issues{/number}","pulls_url":"https://api.github.com/repos/puppetlabs/puppet/pulls{/number}","milestones_url":"https://api.github.com/repos/puppetlabs/puppet/milestones{/number}","notifications_url":"https://api.github.com/repos/puppetlabs/puppet/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/puppetlabs/puppet/labels{/name}","releases_url":"https://api.github.com/repos/puppetlabs/puppet/releases{/id}","deployments_url":"https://api.github.com/repos/puppetlabs/puppet/deployments","created_at":"2010-09-14T19:26:44Z","updated_at":"2016-02-16T14:24:33Z","pushed_at":"2016-02-17T07:35:48Z","git_url":"git://github.com/puppetlabs/puppet.git","ssh_url":"git@github.com:puppetlabs/puppet.git","clone_url":"https://github.com/puppetlabs/puppet.git","svn_url":"https://github.com/puppetlabs/puppet","homepage":"https://puppetlabs.com/puppet/what-is-puppet","size":78896,"stargazers_count":3815,"watchers_count":3815,"language":"Ruby","has_issues":false,"has_downloads":true,"has_wiki":false,"has_pages":false,"forks_count":1577,"mirror_url":null,"open_issues_count":30,"forks":1577,"open_issues":30,"watchers":3815,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/puppetlabs/puppet/pulls/4666"},"html":{"href":"https://github.com/puppetlabs/puppet/pull/4666"},"issue":{"href":"https://api.github.com/repos/puppetlabs/puppet/issues/4666"},"comments":{"href":"https://api.github.com/repos/puppetlabs/puppet/issues/4666/comments"},"review_comments":{"href":"https://api.github.com/repos/puppetlabs/puppet/pulls/4666/comments"},"review_comment":{"href":"https://api.github.com/repos/puppetlabs/puppet/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/puppetlabs/puppet/pulls/4666/commits"},"statuses":{"href":"https://api.github.com/repos/puppetlabs/puppet/statuses/c5a2110cf6e3bf6c386bca43ff6640c368b5d217"}}}}