Mercurial > repos > other > Puppet
annotate modules/apache/spec/unit/apache_version_spec.rb @ 260:5f63afb70415
Fix naming of files for new VPS overrides
$hostname is just the short host name, not the FQDN
author | IBBoard <dev@ibboard.co.uk> |
---|---|
date | Sun, 29 Dec 2019 10:57:18 -0500 |
parents | 675c1cc61eaf |
children | d9352a684e62 |
rev | line source |
---|---|
257
675c1cc61eaf
Update Apache module to get CentOS 8 support
IBBoard <dev@ibboard.co.uk>
parents:
diff
changeset
|
1 require 'spec_helper' |
675c1cc61eaf
Update Apache module to get CentOS 8 support
IBBoard <dev@ibboard.co.uk>
parents:
diff
changeset
|
2 |
675c1cc61eaf
Update Apache module to get CentOS 8 support
IBBoard <dev@ibboard.co.uk>
parents:
diff
changeset
|
3 describe Facter::Util::Fact do |
675c1cc61eaf
Update Apache module to get CentOS 8 support
IBBoard <dev@ibboard.co.uk>
parents:
diff
changeset
|
4 before do |
675c1cc61eaf
Update Apache module to get CentOS 8 support
IBBoard <dev@ibboard.co.uk>
parents:
diff
changeset
|
5 Facter.clear |
675c1cc61eaf
Update Apache module to get CentOS 8 support
IBBoard <dev@ibboard.co.uk>
parents:
diff
changeset
|
6 end |
675c1cc61eaf
Update Apache module to get CentOS 8 support
IBBoard <dev@ibboard.co.uk>
parents:
diff
changeset
|
7 |
675c1cc61eaf
Update Apache module to get CentOS 8 support
IBBoard <dev@ibboard.co.uk>
parents:
diff
changeset
|
8 describe 'apache_version' do |
675c1cc61eaf
Update Apache module to get CentOS 8 support
IBBoard <dev@ibboard.co.uk>
parents:
diff
changeset
|
9 context 'with value' do |
675c1cc61eaf
Update Apache module to get CentOS 8 support
IBBoard <dev@ibboard.co.uk>
parents:
diff
changeset
|
10 before :each do |
675c1cc61eaf
Update Apache module to get CentOS 8 support
IBBoard <dev@ibboard.co.uk>
parents:
diff
changeset
|
11 expect(Facter::Util::Resolution).to receive(:which).with('apachectl') { true } |
675c1cc61eaf
Update Apache module to get CentOS 8 support
IBBoard <dev@ibboard.co.uk>
parents:
diff
changeset
|
12 expect(Facter::Util::Resolution).to receive(:exec).with('apachectl -v 2>&1') {'Server version: Apache/2.4.16 (Unix) |
675c1cc61eaf
Update Apache module to get CentOS 8 support
IBBoard <dev@ibboard.co.uk>
parents:
diff
changeset
|
13 Server built: Jul 31 2015 15:53:26'} |
675c1cc61eaf
Update Apache module to get CentOS 8 support
IBBoard <dev@ibboard.co.uk>
parents:
diff
changeset
|
14 end |
675c1cc61eaf
Update Apache module to get CentOS 8 support
IBBoard <dev@ibboard.co.uk>
parents:
diff
changeset
|
15 it do |
675c1cc61eaf
Update Apache module to get CentOS 8 support
IBBoard <dev@ibboard.co.uk>
parents:
diff
changeset
|
16 expect(Facter.fact(:apache_version).value).to eq('2.4.16') |
675c1cc61eaf
Update Apache module to get CentOS 8 support
IBBoard <dev@ibboard.co.uk>
parents:
diff
changeset
|
17 end |
675c1cc61eaf
Update Apache module to get CentOS 8 support
IBBoard <dev@ibboard.co.uk>
parents:
diff
changeset
|
18 end |
675c1cc61eaf
Update Apache module to get CentOS 8 support
IBBoard <dev@ibboard.co.uk>
parents:
diff
changeset
|
19 end |
675c1cc61eaf
Update Apache module to get CentOS 8 support
IBBoard <dev@ibboard.co.uk>
parents:
diff
changeset
|
20 |
675c1cc61eaf
Update Apache module to get CentOS 8 support
IBBoard <dev@ibboard.co.uk>
parents:
diff
changeset
|
21 describe 'apache_version with empty OS' do |
675c1cc61eaf
Update Apache module to get CentOS 8 support
IBBoard <dev@ibboard.co.uk>
parents:
diff
changeset
|
22 context 'with value' do |
675c1cc61eaf
Update Apache module to get CentOS 8 support
IBBoard <dev@ibboard.co.uk>
parents:
diff
changeset
|
23 before :each do |
675c1cc61eaf
Update Apache module to get CentOS 8 support
IBBoard <dev@ibboard.co.uk>
parents:
diff
changeset
|
24 expect(Facter::Util::Resolution).to receive(:which).with('apachectl') { true } |
675c1cc61eaf
Update Apache module to get CentOS 8 support
IBBoard <dev@ibboard.co.uk>
parents:
diff
changeset
|
25 expect(Facter::Util::Resolution).to receive(:exec).with('apachectl -v 2>&1') {'Server version: Apache/2.4.6 () |
675c1cc61eaf
Update Apache module to get CentOS 8 support
IBBoard <dev@ibboard.co.uk>
parents:
diff
changeset
|
26 Server built: Nov 21 2015 05:34:59' } |
675c1cc61eaf
Update Apache module to get CentOS 8 support
IBBoard <dev@ibboard.co.uk>
parents:
diff
changeset
|
27 end |
675c1cc61eaf
Update Apache module to get CentOS 8 support
IBBoard <dev@ibboard.co.uk>
parents:
diff
changeset
|
28 it do |
675c1cc61eaf
Update Apache module to get CentOS 8 support
IBBoard <dev@ibboard.co.uk>
parents:
diff
changeset
|
29 expect(Facter.fact(:apache_version).value).to eq('2.4.6') |
675c1cc61eaf
Update Apache module to get CentOS 8 support
IBBoard <dev@ibboard.co.uk>
parents:
diff
changeset
|
30 end |
675c1cc61eaf
Update Apache module to get CentOS 8 support
IBBoard <dev@ibboard.co.uk>
parents:
diff
changeset
|
31 end |
675c1cc61eaf
Update Apache module to get CentOS 8 support
IBBoard <dev@ibboard.co.uk>
parents:
diff
changeset
|
32 end |
675c1cc61eaf
Update Apache module to get CentOS 8 support
IBBoard <dev@ibboard.co.uk>
parents:
diff
changeset
|
33 end |