summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorColleen Murphy <colleen.murphy@suse.com>2017-05-02 16:31:20 +0200
committerColleen Murphy <colleen@gazlene.net>2017-06-10 20:03:53 +0200
commit593e930d71c10022ed0edd7d6d940455c4868112 (patch)
tree21cbe5b4216690179eb929c0add4158a8f9163e5
parent91480ef543afa5ff51847da8937cedd5c4d6fff0 (diff)
Fix beaker on xenial
Since the beaker jobs are being run on xenial, we need a special nodeset for it, otherwise beaker gives an error: beaker-hostgenerator was not able to use this value as input. Exiting with an Error. We also want to install puppet from the Ubuntu repos rather than from puppetlabs, since puppetlabs doesn't support puppet 3 for Xenial. For centos we can keep the install process the same. This patch includes additional fixes for issues that were probably present when the tests were first merged: - make sure the irc pip package is installed by the puppet class - use double quotes for the channels.yaml fixture so properly render the newline characters - add "access" and "global" sections to the channels.yaml fixture since accessbot will otherwise be unable to parse the file - remove spec assertions about the accessbot process, because if it was successful it should have exited during the puppet run, and in fact if it didn't exit the puppet run would have failed. - correct the group name the spec is asserting of the config file Additionally, out of band from this patch, the nick 'accessbot-test' is nowregistered on freenode. If it's not registered, it becomes stuck in the irc infinite loop without performing any actions. This does not mean it has any permissions to make any real access changes. Change-Id: Ifd2244ae9dd212b2475f9cd6adb994bc058a4769 Depends-On: I23d0a9c0f4b6ecbb3403447adb03e845d2695366
Notes
Notes (review): Code-Review+2: Clark Boylan <cboylan@sapwetik.org> Code-Review+2: Ian Wienand <iwienand@redhat.com> Workflow+1: Ian Wienand <iwienand@redhat.com> Verified+2: Jenkins Submitted-by: Jenkins Submitted-at: Wed, 14 Jun 2017 01:25:44 +0000 Reviewed-on: https://review.openstack.org/461810 Project: openstack-infra/puppet-accessbot Branch: refs/heads/master
-rw-r--r--manifests/init.pp8
-rwxr-xr-xspec/acceptance/basic_spec.rb11
-rw-r--r--spec/acceptance/fixtures/default.pp2
-rw-r--r--spec/acceptance/nodesets/nodepool-xenial.yml10
-rw-r--r--spec/spec_helper_acceptance.rb10
5 files changed, 28 insertions, 13 deletions
diff --git a/manifests/init.pp b/manifests/init.pp
index 9b70287..a220594 100644
--- a/manifests/init.pp
+++ b/manifests/init.pp
@@ -28,6 +28,11 @@ class accessbot(
28 } 28 }
29 } 29 }
30 30
31 package { 'irc':
32 ensure => installed,
33 provider => openstack_pip,
34 }
35
31 exec { 'run_accessbot' : 36 exec { 'run_accessbot' :
32 command => '/usr/local/bin/accessbot -c /etc/accessbot/accessbot.config -l /etc/accessbot/channels.yaml >> /var/log/accessbot/accessbot.log 2>&1', 37 command => '/usr/local/bin/accessbot -c /etc/accessbot/accessbot.config -l /etc/accessbot/channels.yaml >> /var/log/accessbot/accessbot.log 2>&1',
33 path => '/usr/local/bin:/usr/bin:/bin/', 38 path => '/usr/local/bin:/usr/bin:/bin/',
@@ -36,7 +41,8 @@ class accessbot(
36 subscribe => File['/etc/accessbot/channels.yaml'], 41 subscribe => File['/etc/accessbot/channels.yaml'],
37 require => [File['/etc/accessbot/channels.yaml'], 42 require => [File['/etc/accessbot/channels.yaml'],
38 File['/etc/accessbot/accessbot.config'], 43 File['/etc/accessbot/accessbot.config'],
39 File['/usr/local/bin/accessbot']], 44 File['/usr/local/bin/accessbot'],
45 Package['irc']],
40 } 46 }
41 47
42 file { '/etc/accessbot': 48 file { '/etc/accessbot':
diff --git a/spec/acceptance/basic_spec.rb b/spec/acceptance/basic_spec.rb
index 8b96041..27ea995 100755
--- a/spec/acceptance/basic_spec.rb
+++ b/spec/acceptance/basic_spec.rb
@@ -33,16 +33,7 @@ describe 'basic accessbot' do
33 it { should be_file } 33 it { should be_file }
34 it { should be_owned_by 'root' } 34 it { should be_owned_by 'root' }
35 it { should be_mode 440 } 35 it { should be_mode 440 }
36 it { should be_grouped_into 'accessbo' } 36 it { should be_grouped_into 'accessbot' }
37 end
38
39 end
40
41 context 'main proccess' do
42
43 describe process("accessbot") do
44 its(:user) { should eq "accessbot" }
45 its(:args) { should match /-c accessbot.config/ }
46 end 37 end
47 38
48 end 39 end
diff --git a/spec/acceptance/fixtures/default.pp b/spec/acceptance/fixtures/default.pp
index 79ce4db..f0745a4 100644
--- a/spec/acceptance/fixtures/default.pp
+++ b/spec/acceptance/fixtures/default.pp
@@ -1,6 +1,6 @@
1file { '/etc/channels.yaml': 1file { '/etc/channels.yaml':
2 ensure => file, 2 ensure => file,
3 content => 'channels:\n - name: openstack-rainbow-unicorn-pals', 3 content => "access:\n nobody: +v\nglobal:\n nobody:\n - nobody\nchannels:\n - name: openstack-rainbow-unicorn-pals",
4} 4}
5 5
6class { '::accessbot': 6class { '::accessbot':
diff --git a/spec/acceptance/nodesets/nodepool-xenial.yml b/spec/acceptance/nodesets/nodepool-xenial.yml
new file mode 100644
index 0000000..99dd318
--- /dev/null
+++ b/spec/acceptance/nodesets/nodepool-xenial.yml
@@ -0,0 +1,10 @@
1HOSTS:
2 ubuntu-16.04-amd64:
3 roles:
4 - master
5 platform: ubuntu-16.04-amd64
6 hypervisor: none
7 ip: 127.0.0.1
8CONFIG:
9 type: foss
10 set_env: false
diff --git a/spec/spec_helper_acceptance.rb b/spec/spec_helper_acceptance.rb
index 7a5efa1..de96291 100644
--- a/spec/spec_helper_acceptance.rb
+++ b/spec/spec_helper_acceptance.rb
@@ -2,7 +2,15 @@ require 'beaker-rspec'
2 2
3hosts.each do |host| 3hosts.each do |host|
4 4
5 install_puppet 5 # puppet 3 isn't available from apt.puppetlabs.com so install it from the Xenial repos
6 on host, "which apt-get && apt-get install puppet -y", { :acceptable_exit_codes => [0,1] }
7 # otherwise use the beaker helpers to install the yum.puppetlabs.com repo and puppet
8 r = on host, "which yum", { :acceptable_exit_codes => [0,1] }
9 if r.exit_code == 0
10 install_puppet
11 end
12 add_platform_foss_defaults(host, 'unix')
13
6 14
7 on host, "mkdir -p #{host['distmoduledir']}" 15 on host, "mkdir -p #{host['distmoduledir']}"
8end 16end