summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorZuul <zuul@review.openstack.org>2018-08-01 23:16:08 +0000
committerGerrit Code Review <review@openstack.org>2018-08-01 23:16:08 +0000
commitfe55026ce8ddad4919f90e0d97021a57d1a1fef4 (patch)
treebbd18721bafab4b343e606edb8422b197d18e7f5
parentf639f9fe4ad78971b1e23bdb546f3904556be604 (diff)
parent3a042122ec2cfdbec9376ad9a3ef7603a5df4d33 (diff)
Merge "Add beaker tests"
-rwxr-xr-xspec/acceptance/basic_spec.rb31
-rw-r--r--spec/acceptance/fixtures/default.pp52
2 files changed, 83 insertions, 0 deletions
diff --git a/spec/acceptance/basic_spec.rb b/spec/acceptance/basic_spec.rb
new file mode 100755
index 0000000..cd151b1
--- /dev/null
+++ b/spec/acceptance/basic_spec.rb
@@ -0,0 +1,31 @@
1require 'puppet-openstack_infra_spec_helper/spec_helper_acceptance'
2
3describe 'reviewday', if: os[:family] == 'ubuntu' do
4
5 def pp_path
6 base_path = File.dirname(__FILE__)
7 File.join(base_path, 'fixtures')
8 end
9
10 def puppet_manifest
11 manifest_path = File.join(pp_path, 'default.pp')
12 File.read(manifest_path)
13 end
14
15 it 'should work with no errors' do
16 apply_manifest(puppet_manifest, catch_failures: true)
17 end
18
19 it 'should be idempotent' do
20 apply_manifest(puppet_manifest, catch_changes: true)
21 end
22
23 describe command('su - reviewday -c "cd /var/lib/reviewday/reviewday/ && PYTHONPATH=/var/lib/reviewday/reviewday flock -n /var/lib/reviewday/update.lock python bin/reviewday -o /srv/static/reviewday"') do
24 its(:exit_status) { should eq 0 }
25 end
26
27 describe command('curl http://localhost/reviews/') do
28 its(:stdout) { should contain('OpenStack branch reviews') }
29 end
30
31end
diff --git a/spec/acceptance/fixtures/default.pp b/spec/acceptance/fixtures/default.pp
new file mode 100644
index 0000000..8abd87f
--- /dev/null
+++ b/spec/acceptance/fixtures/default.pp
@@ -0,0 +1,52 @@
1include pip
2
3include reviewday
4
5include httpd
6
7file { '/srv/static':
8 ensure => directory,
9}
10
11file { '/srv/static/status':
12 ensure => directory,
13 require => File['/srv/static'],
14}
15
16$status_vhost = 'NameVirtualHost *:80
17<VirtualHost *:80>
18 ServerName localhost
19 DocumentRoot /srv/static/status
20 Alias /reviews /srv/static/reviewday
21 <Directory /srv/static/reviewday>
22 AllowOverride None
23 Order allow,deny
24 allow from all
25 <IfVersion >= 2.4>
26 Require all granted
27 </IfVersion>
28 </Directory>
29 ErrorLog /var/log/apache2/status.openstack.org_error.log
30 LogLevel warn
31 CustomLog /var/log/apache2/status.openstack.org_access.log combined
32 ServerSignature Off
33</VirtualHost>'
34::httpd::vhost { 'status.openstack.org':
35 port => 80,
36 priority => '50',
37 docroot => '/srv/static/status',
38 content => $status_vhost,
39 require => File['/srv/static/status'],
40}
41
42reviewday::site { 'reviewday':
43 git_url => 'git://git.openstack.org/openstack-infra/reviewday',
44 serveradmin => 'webmaster@openstack.org',
45 httproot => '/srv/static/reviewday',
46 gerrit_url => 'review.openstack.org',
47 gerrit_port => '29418',
48 gerrit_user => 'reviewday',
49 reviewday_gerrit_ssh_key => '',
50 reviewday_rsa_pubkey_contents => '',
51 reviewday_rsa_key_contents => '',
52}