-
Notifications
You must be signed in to change notification settings - Fork 8
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #60 from coi-gov-pl/feature/enh-45-add-puppet-rspe…
…c-tests Feature for #45: Rspec cover tests for puppet-jboss resources. Rspec cover tests for puppet-jboss resources refers to #45.
- Loading branch information
Showing
15 changed files
with
392 additions
and
365 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,45 @@ | ||
require 'spec_helper_puppet' | ||
|
||
describe 'jboss::internal::augeas', :type => :class do | ||
|
||
shared_examples 'completly working define' do | ||
it { is_expected.to contain_class 'jboss::internal::lenses' } | ||
it { is_expected.to contain_class 'jboss::internal::augeas' } | ||
it { is_expected.to contain_file("/usr/lib/wildfly-8.2.0.Final/lenses/jbxml.aug") } | ||
end | ||
|
||
context 'On RedHat os family' do | ||
extend Testing::JBoss::SharedExamples | ||
let(:title) { 'test-augeas' } | ||
let(:facts) do | ||
{ | ||
:operatingsystem => 'OracleLinux', | ||
:osfamily => 'RedHat', | ||
:ipaddress => '192.168.0.1', | ||
:concat_basedir => '/root/concat', | ||
:puppetversion => Puppet.version | ||
} | ||
end | ||
it_behaves_like 'completly working define' | ||
it_behaves_like_full_working_jboss_installation | ||
|
||
end | ||
|
||
context 'On Debian os family' do | ||
extend Testing::JBoss::SharedExamples | ||
let(:title) { 'test-augeas' } | ||
let(:facts) do | ||
{ | ||
:operatingsystem => 'Ubuntu', | ||
:osfamily => 'Debian', | ||
:ipaddress => '192.168.0.1', | ||
:concat_basedir => '/root/concat', | ||
:lsbdistcodename => 'trusty', | ||
:puppetversion => Puppet.version | ||
} | ||
end | ||
it_behaves_like 'completly working define' | ||
it_behaves_like_full_working_jboss_installation | ||
|
||
end | ||
end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,81 @@ | ||
require 'spec_helper_puppet' | ||
|
||
describe 'jboss::internal::configuration', :type => :class do | ||
shared_examples 'completly working define' do | ||
it { is_expected.to contain_class 'jboss::internal::configuration' } | ||
it { is_expected.to contain_class 'jboss::internal::configure::interfaces' } | ||
it { is_expected.to contain_class 'jboss::internal::quirks::etc_initd_functions' } | ||
it { is_expected.to contain_file('/etc/profile.d/jboss.sh').with({ | ||
:ensure => 'file', | ||
:mode => '0644' | ||
}) } | ||
|
||
it { is_expected.to contain_file('/var/log/wildfly/console.log').with({ | ||
:ensure => 'file', | ||
:alias => 'jboss::logfile', | ||
:owner => 'root', | ||
:group => 'jboss', | ||
:mode => '0660' | ||
}) } | ||
|
||
it { is_expected.to contain_file('/etc/jboss-as').with({ | ||
:ensure => 'directory', | ||
:mode => '2770', | ||
:owner => 'jboss', | ||
:group => 'jboss' | ||
}) } | ||
|
||
it { is_expected.to contain_file('/etc/jboss-as/jboss-as.conf'). | ||
with_ensure('link'). | ||
that_comes_before('Anchor[jboss::configuration::end]') } | ||
|
||
it { is_expected.to contain_file('/etc/default').with_ensure('directory') } | ||
|
||
it { is_expected.to contain_file('/etc/default/wildfly.conf'). | ||
with_ensure('link'). | ||
that_comes_before('Anchor[jboss::configuration::end]') } | ||
|
||
it { is_expected.to contain_concat('/etc/wildfly/wildfly.conf').with({ | ||
:alias => 'jboss::jboss-as.conf', | ||
:mode => '0644' | ||
}) } | ||
it { is_expected.to contain_concat__fragment('jboss::jboss-as.conf::defaults').with({ | ||
:order => '000' | ||
}) } | ||
end | ||
|
||
context 'On RedHat os family' do | ||
extend Testing::JBoss::SharedExamples | ||
let(:title) { 'test-configuration' } | ||
let(:facts) do | ||
{ | ||
:operatingsystem => 'OracleLinux', | ||
:osfamily => 'RedHat', | ||
:ipaddress => '192.168.0.1', | ||
:concat_basedir => '/root/concat', | ||
:puppetversion => Puppet.version | ||
} | ||
end | ||
it_behaves_like 'completly working define' | ||
it_behaves_like_full_working_jboss_installation | ||
it { is_expected.to contain_file('/etc/sysconfig/wildfly.conf') } | ||
end | ||
|
||
context 'On Debian os family' do | ||
extend Testing::JBoss::SharedExamples | ||
let(:title) { 'test-configuration' } | ||
let(:facts) do | ||
{ | ||
:operatingsystem => 'Ubuntu', | ||
:osfamily => 'Debian', | ||
:ipaddress => '192.168.0.1', | ||
:concat_basedir => '/root/concat', | ||
:lsbdistcodename => 'trusty', | ||
:puppetversion => Puppet.version | ||
} | ||
end | ||
it_behaves_like 'completly working define' | ||
it_behaves_like_full_working_jboss_installation | ||
it { is_expected.to contain_file('/etc/default/wildfly') } | ||
end | ||
end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,51 @@ | ||
require 'spec_helper_puppet' | ||
|
||
describe 'jboss::internal::lenses', :type => :class do | ||
shared_examples 'completly working define' do | ||
it { is_expected.to contain_class 'jboss::internal::lenses' } | ||
it { is_expected.to contain_class 'jboss' } | ||
it { is_expected.to contain_file('/usr/lib/wildfly-8.2.0.Final/lenses/jbxml.aug').with({ | ||
:ensure => 'file', | ||
:source => 'puppet:///modules/jboss/jbxml.aug', | ||
}) } | ||
it { is_expected.to contain_file('/usr/lib/wildfly-8.2.0.Final/lenses/jbxml.aug').that_requires( | ||
'File[/usr/lib/wildfly-8.2.0.Final/lenses/]' | ||
)} | ||
it { is_expected.to contain_file('/usr/lib/wildfly-8.2.0.Final/lenses').with({ | ||
:ensure => 'directory', | ||
:owner => 'jboss', | ||
}) } | ||
it { is_expected.to contain_file('/usr/lib/wildfly-8.2.0.Final/lenses').that_requires( | ||
'Anchor[jboss::configuration::begin]' | ||
)} | ||
end | ||
|
||
context 'On RedHat os family' do | ||
let(:title) { 'test-lenses' } | ||
let(:facts) do | ||
{ | ||
:operatingsystem => 'OracleLinux', | ||
:osfamily => 'RedHat', | ||
:ipaddress => '192.168.0.1', | ||
:concat_basedir => '/root/concat', | ||
:puppetversion => Puppet.version | ||
} | ||
end | ||
it_behaves_like 'completly working define' | ||
end | ||
|
||
context 'On Debian os family' do | ||
let(:title) { 'test-lenses' } | ||
let(:facts) do | ||
{ | ||
:operatingsystem => 'Ubuntu', | ||
:osfamily => 'Debian', | ||
:ipaddress => '192.168.0.1', | ||
:concat_basedir => '/root/concat', | ||
:lsbdistcodename => 'trusty', | ||
:puppetversion => Puppet.version | ||
} | ||
end | ||
it_behaves_like 'completly working define' | ||
end | ||
end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.