Skip to content

Commit

Permalink
#45 more tests
Browse files Browse the repository at this point in the history
  • Loading branch information
frodoslaw committed Feb 12, 2016
1 parent 0c47280 commit 3d03896
Showing 1 changed file with 34 additions and 7 deletions.
41 changes: 34 additions & 7 deletions spec/testing/rspec_puppet/package.rb
Original file line number Diff line number Diff line change
Expand Up @@ -29,17 +29,44 @@ def package_files_for_jboss_product(options = DEFAULT_OPTIONS)
it { is_expected.to contain_jboss__internal__util__groupaccess("/usr/lib/#{product}-#{version}").with({
:user => 'jboss'
})}
it { is_expected.to contain_file("/etc/#{product}/domain.xml") }
it { is_expected.to contain_file("/etc/#{product}/host.xml") }
it { is_expected.to contain_file("/etc/#{product}/standalone.xml") }
it { is_expected.to contain_file("/etc/init.d/#{product}") }
it { is_expected.to contain_file("/etc/#{product}/domain.xml").with({
:ensure => 'link',
:alias => 'jboss::configuration-link::domain',
:target => "/usr/lib/#{product}-#{version}/domain/configuration/domain.xml"
})}
it { is_expected.to contain_file("/etc/#{product}/host.xml").with({
:ensure => 'link',
:alias => 'jboss::configuration-link::host',
:target => "/usr/lib/#{product}-#{version}/domain/configuration/host.xml"
})}
it { is_expected.to contain_file("/etc/#{product}/standalone.xml").with({
:ensure => 'link',
:alias => 'jboss::configuration-link::standalone',
:target => "/usr/lib/#{product}-#{version}/standalone/configuration/standalone-full.xml"
})}
it { is_expected.to contain_file("/etc/init.d/#{product}").with({
:ensure => 'link',
:alias => 'jboss::service-link'
}) }
end
end

def package_exec_for_jboss
it { is_expected.to contain_exec('jboss::unzip-downloaded') }
it { is_expected.to contain_exec('jboss::move-unzipped') }
it { is_expected.to contain_exec('jboss::test-extraction') }
it { is_expected.to contain_exec('jboss::unzip-downloaded').with({
:command => 'unzip -o -q /usr/src/download-wildfly-8.2.0.Final/wildfly-8.2.0.Final.zip -d /usr/lib/wildfly-8.2.0.Final',
:cwd => '/usr/src/download-wildfly-8.2.0.Final',
:creates => '/usr/lib/wildfly-8.2.0.Final'
}) }
it { is_expected.to contain_exec('jboss::move-unzipped').with({
:command => 'mv /usr/lib/wildfly-8.2.0.Final/*/* /usr/lib/wildfly-8.2.0.Final/',
:creates => '/usr/lib/wildfly-8.2.0.Final/bin'}).
that_requires('Exec[jboss::unzip-downloaded]')
}
it { is_expected.to contain_exec('jboss::test-extraction').with({
:command => "echo '/usr/lib/wildfly-8.2.0.Final/bin/init.d not found!' 1>&2 && exit 1",
:unless => 'test -d /usr/lib/wildfly-8.2.0.Final/bin/init.d'}).
that_requires('Exec[jboss::move-unzipped]')
}
it { is_expected.to contain_exec('jboss::package::check-for-java') }
end
end

0 comments on commit 3d03896

Please sign in to comment.