{"action":"created","comment":{"url":"https://api.github.com/repos/puppetlabs/puppetlabs-corosync/pulls/comments/23411893","id":23411893,"diff_hunk":"@@ -1,17 +1,106 @@\n require 'spec_helper'\n \n-describe 'corosync', :type => :class do\n-  context \"on a Debian OS\" do\n+describe 'corosync' do\n+\n+  let :params do\n+    { :set_votequorum => false,\n+      :multicast_address => '239.1.1.2' }\n+  end\n+\n+  shared_examples_for 'corosync' do\n+    before do\n+      params.merge!(platform_params)\n+    end\n+\n+    it { is_expected.to compile }\n+\n+    context 'when set_quorum is true and quorum_members are set' do\n+      before :each do\n+        params.merge!(\n+          { :set_votequorum => true,\n+            :quorum_members => ['node1.test.org', 'node2.test.org'] }\n+        )\n+      end\n+\n+      it 'configures votequorum' do\n+        should contain_file('/etc/corosync/corosync.conf').with_content(\n+          /nodelist/\n+        )\n+        should contain_file('/etc/corosync/corosync.conf').with_content(\n+          /ring0_addr\\: node1\\.test\\.org/\n+        )\n+        should contain_file('/etc/corosync/corosync.conf').with_content(\n+          /ring0_addr\\: node2\\.test\\.org/\n+        )\n+      end\n+    end\n+\n+    context 'when set_quorum is true and unicast is used' do\n+      before :each do\n+        params.merge!(\n+          { :set_votequorum => true,\n+            :quorum_members => ['node1.test.org', 'node2.test.org'],\n+            :multicast_address => 'UNSET',\n+            :unicast_addresses => ['192.168.1.1', '192.168.1.2'], }\n+        )\n+      end\n+\n+      it 'configures votequorum' do\n+        should contain_file('/etc/corosync/corosync.conf').with_content(\n+          /nodelist/\n+        )\n+        should contain_file('/etc/corosync/corosync.conf').with_content(\n+          /ring0_addr\\: node1\\.test\\.org/\n+        )\n+        should contain_file('/etc/corosync/corosync.conf').with_content(\n+          /ring0_addr\\: node2\\.test\\.org/\n+        )\n+      end\n+    end\n+\n+    context 'when set_quorum is true and quorum_members are not set' do\n+      before :each do\n+        params.merge!(\n+          { :set_votequorum => true }\n+        )\n+      end\n+\n+      it 'raises error' do\n+        expect {\n+          is_expected.to compile\n+        }.to raise_error(\n+            Puppet::Error,\n+            /set_votequorum is true, but no quorum_members have been passed./\n+        )\n+      end\n+    end\n+  end\n+\n+  context 'on Debian platforms' do\n     let :facts do\n-      {\n+      { :osfamily       => 'Debian',\n         :processorcount => '3',\n-        :ipaddress      => '127.0.0.1',\n-        :osfamily       => 'Debian'\n-      }\n+        :ipaddress      => '127.0.0.1' }\n     end\n-    let :params do\n-      { :multicast_address => '239.1.1.2' }\n+\n+    let :platform_params do\n+      { }","path":"spec/classes/corosync_spec.rb","position":95,"original_position":95,"commit_id":"52b9fcd06fa9c56a0fcf563eab231ca0ba9e59ed","original_commit_id":"52b9fcd06fa9c56a0fcf563eab231ca0ba9e59ed","user":{"login":"cmurphy","id":1220710,"avatar_url":"https://avatars.githubusercontent.com/u/1220710?v=3","gravatar_id":"","url":"https://api.github.com/users/cmurphy","html_url":"https://github.com/cmurphy","followers_url":"https://api.github.com/users/cmurphy/followers","following_url":"https://api.github.com/users/cmurphy/following{/other_user}","gists_url":"https://api.github.com/users/cmurphy/gists{/gist_id}","starred_url":"https://api.github.com/users/cmurphy/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/cmurphy/subscriptions","organizations_url":"https://api.github.com/users/cmurphy/orgs","repos_url":"https://api.github.com/users/cmurphy/repos","events_url":"https://api.github.com/users/cmurphy/events{/privacy}","received_events_url":"https://api.github.com/users/cmurphy/received_events","type":"User","site_admin":false},"body":"I don't think we need platform_params if it is always empty.","created_at":"2015-01-22T21:34:47Z","updated_at":"2015-01-22T21:34:47Z","html_url":"https://github.com/puppetlabs/puppetlabs-corosync/pull/106#discussion_r23411893","pull_request_url":"https://api.github.com/repos/puppetlabs/puppetlabs-corosync/pulls/106","_links":{"self":{"href":"https://api.github.com/repos/puppetlabs/puppetlabs-corosync/pulls/comments/23411893"},"html":{"href":"https://github.com/puppetlabs/puppetlabs-corosync/pull/106#discussion_r23411893"},"pull_request":{"href":"https://api.github.com/repos/puppetlabs/puppetlabs-corosync/pulls/106"}}},"pull_request":{"url":"https://api.github.com/repos/puppetlabs/puppetlabs-corosync/pulls/106","id":27675747,"html_url":"https://github.com/puppetlabs/puppetlabs-corosync/pull/106","diff_url":"https://github.com/puppetlabs/puppetlabs-corosync/pull/106.diff","patch_url":"https://github.com/puppetlabs/puppetlabs-corosync/pull/106.patch","issue_url":"https://api.github.com/repos/puppetlabs/puppetlabs-corosync/issues/106","number":106,"state":"open","locked":false,"title":"Add votequorum setting to corosync.conf","user":{"login":"paramite","id":1071028,"avatar_url":"https://avatars.githubusercontent.com/u/1071028?v=3","gravatar_id":"","url":"https://api.github.com/users/paramite","html_url":"https://github.com/paramite","followers_url":"https://api.github.com/users/paramite/followers","following_url":"https://api.github.com/users/paramite/following{/other_user}","gists_url":"https://api.github.com/users/paramite/gists{/gist_id}","starred_url":"https://api.github.com/users/paramite/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/paramite/subscriptions","organizations_url":"https://api.github.com/users/paramite/orgs","repos_url":"https://api.github.com/users/paramite/repos","events_url":"https://api.github.com/users/paramite/events{/privacy}","received_events_url":"https://api.github.com/users/paramite/received_events","type":"User","site_admin":false},"body":"This is required to run Corosync 2.0 with Pacemaker >= 1.1.8 via pcs.\r\nSee: http://clusterlabs.org/doc/en-US/Pacemaker/1.1-pcs/html/Clusters_from_Scratch/ch03.html","created_at":"2015-01-20T13:02:24Z","updated_at":"2015-01-22T21:34:47Z","closed_at":null,"merged_at":null,"merge_commit_sha":"7a17f5393751375ee51a7ccbb2d5452a27594904","assignee":null,"milestone":null,"commits_url":"https://api.github.com/repos/puppetlabs/puppetlabs-corosync/pulls/106/commits","review_comments_url":"https://api.github.com/repos/puppetlabs/puppetlabs-corosync/pulls/106/comments","review_comment_url":"https://api.github.com/repos/puppetlabs/puppetlabs-corosync/pulls/comments/{number}","comments_url":"https://api.github.com/repos/puppetlabs/puppetlabs-corosync/issues/106/comments","statuses_url":"https://api.github.com/repos/puppetlabs/puppetlabs-corosync/statuses/52b9fcd06fa9c56a0fcf563eab231ca0ba9e59ed","head":{"label":"paramite:votequorum","ref":"votequorum","sha":"52b9fcd06fa9c56a0fcf563eab231ca0ba9e59ed","user":{"login":"paramite","id":1071028,"avatar_url":"https://avatars.githubusercontent.com/u/1071028?v=3","gravatar_id":"","url":"https://api.github.com/users/paramite","html_url":"https://github.com/paramite","followers_url":"https://api.github.com/users/paramite/followers","following_url":"https://api.github.com/users/paramite/following{/other_user}","gists_url":"https://api.github.com/users/paramite/gists{/gist_id}","starred_url":"https://api.github.com/users/paramite/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/paramite/subscriptions","organizations_url":"https://api.github.com/users/paramite/orgs","repos_url":"https://api.github.com/users/paramite/repos","events_url":"https://api.github.com/users/paramite/events{/privacy}","received_events_url":"https://api.github.com/users/paramite/received_events","type":"User","site_admin":false},"repo":{"id":29475080,"name":"puppetlabs-corosync","full_name":"paramite/puppetlabs-corosync","owner":{"login":"paramite","id":1071028,"avatar_url":"https://avatars.githubusercontent.com/u/1071028?v=3","gravatar_id":"","url":"https://api.github.com/users/paramite","html_url":"https://github.com/paramite","followers_url":"https://api.github.com/users/paramite/followers","following_url":"https://api.github.com/users/paramite/following{/other_user}","gists_url":"https://api.github.com/users/paramite/gists{/gist_id}","starred_url":"https://api.github.com/users/paramite/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/paramite/subscriptions","organizations_url":"https://api.github.com/users/paramite/orgs","repos_url":"https://api.github.com/users/paramite/repos","events_url":"https://api.github.com/users/paramite/events{/privacy}","received_events_url":"https://api.github.com/users/paramite/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/paramite/puppetlabs-corosync","description":"Sets up and manages Corosync.","fork":true,"url":"https://api.github.com/repos/paramite/puppetlabs-corosync","forks_url":"https://api.github.com/repos/paramite/puppetlabs-corosync/forks","keys_url":"https://api.github.com/repos/paramite/puppetlabs-corosync/keys{/key_id}","collaborators_url":"https://api.github.com/repos/paramite/puppetlabs-corosync/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/paramite/puppetlabs-corosync/teams","hooks_url":"https://api.github.com/repos/paramite/puppetlabs-corosync/hooks","issue_events_url":"https://api.github.com/repos/paramite/puppetlabs-corosync/issues/events{/number}","events_url":"https://api.github.com/repos/paramite/puppetlabs-corosync/events","assignees_url":"https://api.github.com/repos/paramite/puppetlabs-corosync/assignees{/user}","branches_url":"https://api.github.com/repos/paramite/puppetlabs-corosync/branches{/branch}","tags_url":"https://api.github.com/repos/paramite/puppetlabs-corosync/tags","blobs_url":"https://api.github.com/repos/paramite/puppetlabs-corosync/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/paramite/puppetlabs-corosync/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/paramite/puppetlabs-corosync/git/refs{/sha}","trees_url":"https://api.github.com/repos/paramite/puppetlabs-corosync/git/trees{/sha}","statuses_url":"https://api.github.com/repos/paramite/puppetlabs-corosync/statuses/{sha}","languages_url":"https://api.github.com/repos/paramite/puppetlabs-corosync/languages","stargazers_url":"https://api.github.com/repos/paramite/puppetlabs-corosync/stargazers","contributors_url":"https://api.github.com/repos/paramite/puppetlabs-corosync/contributors","subscribers_url":"https://api.github.com/repos/paramite/puppetlabs-corosync/subscribers","subscription_url":"https://api.github.com/repos/paramite/puppetlabs-corosync/subscription","commits_url":"https://api.github.com/repos/paramite/puppetlabs-corosync/commits{/sha}","git_commits_url":"https://api.github.com/repos/paramite/puppetlabs-corosync/git/commits{/sha}","comments_url":"https://api.github.com/repos/paramite/puppetlabs-corosync/comments{/number}","issue_comment_url":"https://api.github.com/repos/paramite/puppetlabs-corosync/issues/comments/{number}","contents_url":"https://api.github.com/repos/paramite/puppetlabs-corosync/contents/{+path}","compare_url":"https://api.github.com/repos/paramite/puppetlabs-corosync/compare/{base}...{head}","merges_url":"https://api.github.com/repos/paramite/puppetlabs-corosync/merges","archive_url":"https://api.github.com/repos/paramite/puppetlabs-corosync/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/paramite/puppetlabs-corosync/downloads","issues_url":"https://api.github.com/repos/paramite/puppetlabs-corosync/issues{/number}","pulls_url":"https://api.github.com/repos/paramite/puppetlabs-corosync/pulls{/number}","milestones_url":"https://api.github.com/repos/paramite/puppetlabs-corosync/milestones{/number}","notifications_url":"https://api.github.com/repos/paramite/puppetlabs-corosync/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/paramite/puppetlabs-corosync/labels{/name}","releases_url":"https://api.github.com/repos/paramite/puppetlabs-corosync/releases{/id}","created_at":"2015-01-19T14:39:46Z","updated_at":"2015-01-19T14:39:46Z","pushed_at":"2015-01-20T14:52:35Z","git_url":"git://github.com/paramite/puppetlabs-corosync.git","ssh_url":"git@github.com:paramite/puppetlabs-corosync.git","clone_url":"https://github.com/paramite/puppetlabs-corosync.git","svn_url":"https://github.com/paramite/puppetlabs-corosync","homepage":"http://forge.puppetlabs.com/puppetlabs/corosync","size":312,"stargazers_count":0,"watchers_count":0,"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":0,"default_branch":"master"}},"base":{"label":"puppetlabs:master","ref":"master","sha":"fd334549dc87fd445628897eb2541c9626a11c88","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":3723449,"name":"puppetlabs-corosync","full_name":"puppetlabs/puppetlabs-corosync","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/puppetlabs-corosync","description":"Sets up and manages Corosync.","fork":false,"url":"https://api.github.com/repos/puppetlabs/puppetlabs-corosync","forks_url":"https://api.github.com/repos/puppetlabs/puppetlabs-corosync/forks","keys_url":"https://api.github.com/repos/puppetlabs/puppetlabs-corosync/keys{/key_id}","collaborators_url":"https://api.github.com/repos/puppetlabs/puppetlabs-corosync/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/puppetlabs/puppetlabs-corosync/teams","hooks_url":"https://api.github.com/repos/puppetlabs/puppetlabs-corosync/hooks","issue_events_url":"https://api.github.com/repos/puppetlabs/puppetlabs-corosync/issues/events{/number}","events_url":"https://api.github.com/repos/puppetlabs/puppetlabs-corosync/events","assignees_url":"https://api.github.com/repos/puppetlabs/puppetlabs-corosync/assignees{/user}","branches_url":"https://api.github.com/repos/puppetlabs/puppetlabs-corosync/branches{/branch}","tags_url":"https://api.github.com/repos/puppetlabs/puppetlabs-corosync/tags","blobs_url":"https://api.github.com/repos/puppetlabs/puppetlabs-corosync/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/puppetlabs/puppetlabs-corosync/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/puppetlabs/puppetlabs-corosync/git/refs{/sha}","trees_url":"https://api.github.com/repos/puppetlabs/puppetlabs-corosync/git/trees{/sha}","statuses_url":"https://api.github.com/repos/puppetlabs/puppetlabs-corosync/statuses/{sha}","languages_url":"https://api.github.com/repos/puppetlabs/puppetlabs-corosync/languages","stargazers_url":"https://api.github.com/repos/puppetlabs/puppetlabs-corosync/stargazers","contributors_url":"https://api.github.com/repos/puppetlabs/puppetlabs-corosync/contributors","subscribers_url":"https://api.github.com/repos/puppetlabs/puppetlabs-corosync/subscribers","subscription_url":"https://api.github.com/repos/puppetlabs/puppetlabs-corosync/subscription","commits_url":"https://api.github.com/repos/puppetlabs/puppetlabs-corosync/commits{/sha}","git_commits_url":"https://api.github.com/repos/puppetlabs/puppetlabs-corosync/git/commits{/sha}","comments_url":"https://api.github.com/repos/puppetlabs/puppetlabs-corosync/comments{/number}","issue_comment_url":"https://api.github.com/repos/puppetlabs/puppetlabs-corosync/issues/comments/{number}","contents_url":"https://api.github.com/repos/puppetlabs/puppetlabs-corosync/contents/{+path}","compare_url":"https://api.github.com/repos/puppetlabs/puppetlabs-corosync/compare/{base}...{head}","merges_url":"https://api.github.com/repos/puppetlabs/puppetlabs-corosync/merges","archive_url":"https://api.github.com/repos/puppetlabs/puppetlabs-corosync/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/puppetlabs/puppetlabs-corosync/downloads","issues_url":"https://api.github.com/repos/puppetlabs/puppetlabs-corosync/issues{/number}","pulls_url":"https://api.github.com/repos/puppetlabs/puppetlabs-corosync/pulls{/number}","milestones_url":"https://api.github.com/repos/puppetlabs/puppetlabs-corosync/milestones{/number}","notifications_url":"https://api.github.com/repos/puppetlabs/puppetlabs-corosync/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/puppetlabs/puppetlabs-corosync/labels{/name}","releases_url":"https://api.github.com/repos/puppetlabs/puppetlabs-corosync/releases{/id}","created_at":"2012-03-14T23:30:40Z","updated_at":"2015-01-20T22:30:54Z","pushed_at":"2015-01-20T22:30:54Z","git_url":"git://github.com/puppetlabs/puppetlabs-corosync.git","ssh_url":"git@github.com:puppetlabs/puppetlabs-corosync.git","clone_url":"https://github.com/puppetlabs/puppetlabs-corosync.git","svn_url":"https://github.com/puppetlabs/puppetlabs-corosync","homepage":"http://forge.puppetlabs.com/puppetlabs/corosync","size":940,"stargazers_count":29,"watchers_count":29,"language":"Ruby","has_issues":false,"has_downloads":true,"has_wiki":false,"has_pages":false,"forks_count":82,"mirror_url":null,"open_issues_count":26,"forks":82,"open_issues":26,"watchers":29,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/puppetlabs/puppetlabs-corosync/pulls/106"},"html":{"href":"https://github.com/puppetlabs/puppetlabs-corosync/pull/106"},"issue":{"href":"https://api.github.com/repos/puppetlabs/puppetlabs-corosync/issues/106"},"comments":{"href":"https://api.github.com/repos/puppetlabs/puppetlabs-corosync/issues/106/comments"},"review_comments":{"href":"https://api.github.com/repos/puppetlabs/puppetlabs-corosync/pulls/106/comments"},"review_comment":{"href":"https://api.github.com/repos/puppetlabs/puppetlabs-corosync/pulls/comments/{number}"},"commits":{"href":"https://api.github.com/repos/puppetlabs/puppetlabs-corosync/pulls/106/commits"},"statuses":{"href":"https://api.github.com/repos/puppetlabs/puppetlabs-corosync/statuses/52b9fcd06fa9c56a0fcf563eab231ca0ba9e59ed"}}}}