Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
41 commits
Select commit Hold shift + click to select a range
f2ca9c5
Enable acceptance tests
bastelfreak Aug 26, 2024
3953c23
Merge remote-tracking branch 'voxpupuli/master' into ci
marcusdots Oct 13, 2025
ebebc5e
Debug-Meldungen
marcusdots Oct 13, 2025
9479c61
Debug: Java-Versionen
marcusdots Oct 13, 2025
9ba42e4
Debug: WildFly-37
marcusdots Oct 13, 2025
2fd84e8
lint
marcusdots Oct 13, 2025
599ca1a
rubucop mag multiline comments nicht
marcusdots Oct 13, 2025
7ce8088
rubucop mag %x{} nicht
marcusdots Oct 13, 2025
790519a
undefined method `test_data= for #<RSpec::Core::Configuration:0x00007…
marcusdots Oct 13, 2025
58d598c
rubocop unreachable code
marcusdots Oct 13, 2025
fee0550
rubocop
marcusdots Oct 13, 2025
6d0ec9d
rubocop
marcusdots Oct 13, 2025
0f295f6
rubocop
marcusdots Oct 13, 2025
1c69d34
rubocop
marcusdots Oct 13, 2025
bb1b363
rubocop
marcusdots Oct 13, 2025
26bfad0
download url stimmt nicht
marcusdots Oct 13, 2025
a5f2bc1
java version?
marcusdots Oct 13, 2025
4f95ad3
java home
marcusdots Oct 13, 2025
b67cdad
java home
marcusdots Oct 13, 2025
6c59a61
java home
marcusdots Oct 13, 2025
6e977ae
java home
marcusdots Oct 13, 2025
375151e
java home - space
marcusdots Oct 13, 2025
2037959
java home
marcusdots Oct 13, 2025
08180ef
-execute_manifest +apply_manifest
marcusdots Oct 14, 2025
66d54d8
maven url
marcusdots Oct 14, 2025
9a641ef
Postgres.jar URL umgezogen
marcusdots Oct 14, 2025
0ae10a6
Alle WAR von central.maven.org nach repo1.maven.org umgezogen
marcusdots Oct 14, 2025
99367aa
fix: im case umgezogen
marcusdots Oct 14, 2025
f73313d
mein Testfall
marcusdots Oct 14, 2025
9b4a491
mein Testfall
marcusdots Oct 14, 2025
5e197fd
lint
marcusdots Oct 14, 2025
a879317
bifurication
marcusdots Oct 14, 2025
57285bd
rubocop
marcusdots Oct 14, 2025
32d5378
Cannot specify more than one of `catch_failures`, `catch_changes`, `e…
marcusdots Oct 14, 2025
50390ab
java package name
marcusdots Oct 14, 2025
61573a0
java package name
marcusdots Oct 14, 2025
36a49b9
typo
marcusdots Oct 14, 2025
f8993b6
conditional java home
marcusdots Oct 15, 2025
c08cf1a
JAVA_HOME
marcusdots Oct 15, 2025
ca9519f
x
marcusdots Oct 15, 2025
5a33e48
distinguish test cases
marcusdots Oct 15, 2025
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -22,4 +22,4 @@ permissions:
jobs:
puppet:
name: Puppet
uses: voxpupuli/gha-puppet/.github/workflows/basic.yml@v3
uses: voxpupuli/gha-puppet/.github/workflows/beaker.yml@v3
5 changes: 3 additions & 2 deletions .sync.yml
Original file line number Diff line number Diff line change
@@ -1,2 +1,3 @@
.github/workflows/ci.yml:
acceptance_tests: false
---
spec/spec_helper_acceptance.rb:
unmanaged: false
13 changes: 0 additions & 13 deletions acceptance.sh

This file was deleted.

84 changes: 84 additions & 0 deletions spec/acceptance/0_uptodate_wildfly_spec.rb
Original file line number Diff line number Diff line change
@@ -0,0 +1,84 @@
require 'spec_helper_acceptance'

pp = <<-EOP
Exec {
path => $facts['path'],
}

# yum install java-17-openjdk.x86_64

$_install_source = 'https://github.com/wildfly/wildfly/releases/download/37.0.1.Final/wildfly-37.0.1.Final.tar.gz'
$_install_source_gitlab_issue_355 = 'https://github.com/wildfly/wildfly/releases/download/32.0.1.Final/wildfly-32.0.1.Final.tar.gz'
$_properties = {
'jboss.bind.address' => 'localhost',
# 'jboss.bind.address.management' => $mgmt_bind,
'jboss.management.http.port' => '1081',
'jboss.management.https.port' => '10444',
'jboss.http.port' => '1080',
'jboss.https.port' => '10443',
'jboss.ajp.port' => '1234'
}
$_service_name = 'very-buggy-server'
$_uid = '1000'
$_user = 'wildfly'
$link_name = '/home/wildfly/'

if $facts['os']['family'] == 'Debian' {
$javapkg = 'openjdk-17-jdk'
$javahome = '/usr/lib/jvm/java-17-openjdk-amd64/'
} else {
$javapkg = 'java-17-openjdk.x86_64'
$javahome = '/usr/lib/jvm/java-17-openjdk-17.0.16.0.8-2.el9.x86_64/'
}

package { $javapkg:
ensure => present,
}
->
group { $_user:
ensure => present,
gid => Integer($_uid),
}
->
user { $_user:
uid => $_uid,
gid => $_uid,
}
#~>
#exec {'chown -R wildfly: /opt/wildfly-32.0.1/':
# returns => [0,1],
#}
->
class{'wildfly':
config => 'standalone.xml',
console_log => "/var/log/wildfly/console.log",
dirname => "/opt/wildfly-32.0.1",
distribution => "wildfly",
gid => Integer($_uid),
group => $_user,
install_cache_dir => '/tmp/wildfly/',
install_source => $_install_source_gitlab_issue_355,
java_home => $javahome,
java_opts => undef,
java_maxmetaspace_size => '2048m',
java_xms => '128M',
java_xmx => '512M',
manage_user => false,
properties => $_properties,
service_name => $_service_name,
service_manage => true,
uid => Integer($_uid),
user => $_user,
user_home => $link_name,
version => '32.0.1',
}
EOP

describe 'up to date wildfly without any frills' do
context 'it installs at least once' do
it 'applies the manfest without error, idempotently' do

Check failure on line 79 in spec/acceptance/0_uptodate_wildfly_spec.rb

View workflow job for this annotation

GitHub Actions / Puppet / OpenVox 8 - OracleLinux 9

up to date wildfly without any frills it installs at least once applies the manfest without error, idempotently Failure/Error: apply_manifest(pp, catch_changes: true, acceptable_exit_codes: [0]) Beaker::Host::CommandFailure: Host 'oracle9-64-openvox8.example.com' exited with 2 running: puppet apply --verbose --detailed-exitcodes /tmp/apply_manifest_122258066.nYqnwb.pp Last 10 lines of output were: Warning: This function is deprecated, please use stdlib::ensure_packages instead. at ["/etc/puppetlabs/code/environments/production/modules/wildfly/manifests/prepare.pp", 39]:["/etc/puppetlabs/code/environments/production/modules/wildfly/manifests/init.pp", 133] (location: /etc/puppetlabs/code/environments/production/modules/stdlib/lib/puppet/functions/deprecation.rb:35:in `deprecation') �[mNotice: Compiled catalog for oracle9-64-openvox8.example.com in environment production in 0.11 seconds Info: Using environment 'production' Info: Applying configuration version '1760530980' Warning: Private key for 'oracle9-64-openvox8.example.com' does not exist Warning: Client certificate for 'oracle9-64-openvox8.example.com' does not exist �[mNotice: /Stage[main]/Wildfly::Service/Service[wildfly]/ensure: ensure changed 'stopped' to 'running' Info: /Stage[main]/Wildfly::Service/Service[wildfly]: Unscheduling refresh on Service[wildfly] �[mNotice: Applied catalog in 17.49 seconds

Check failure on line 79 in spec/acceptance/0_uptodate_wildfly_spec.rb

View workflow job for this annotation

GitHub Actions / Puppet / OpenVox 8 - OracleLinux 8

up to date wildfly without any frills it installs at least once applies the manfest without error, idempotently Failure/Error: apply_manifest(pp, catch_changes: true, acceptable_exit_codes: [0]) Beaker::Host::CommandFailure: Host 'oracle8-64-openvox8.example.com' exited with 2 running: puppet apply --verbose --detailed-exitcodes /tmp/apply_manifest_122307851.MbuYJF.pp Last 10 lines of output were: Warning: This function is deprecated, please use stdlib::ensure_packages instead. at ["/etc/puppetlabs/code/environments/production/modules/wildfly/manifests/prepare.pp", 39]:["/etc/puppetlabs/code/environments/production/modules/wildfly/manifests/init.pp", 133] (location: /etc/puppetlabs/code/environments/production/modules/stdlib/lib/puppet/functions/deprecation.rb:35:in `deprecation') �[mNotice: Compiled catalog for oracle8-64-openvox8.example.com in environment production in 0.10 seconds Info: Using environment 'production' Info: Applying configuration version '1760530989' Warning: Private key for 'oracle8-64-openvox8.example.com' does not exist Warning: Client certificate for 'oracle8-64-openvox8.example.com' does not exist �[mNotice: /Stage[main]/Wildfly::Service/Service[wildfly]/ensure: ensure changed 'stopped' to 'running' Info: /Stage[main]/Wildfly::Service/Service[wildfly]: Unscheduling refresh on Service[wildfly] �[mNotice: Applied catalog in 17.92 seconds
apply_manifest(pp, catch_failures: true, acceptable_exit_codes: [0, 2])
apply_manifest(pp, catch_changes: true, acceptable_exit_codes: [0])
end
end
end
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,9 @@ class { 'wildfly':
}

wildfly::config::module { 'org.postgresql':
source => 'http://central.maven.org/maven2/org/postgresql/postgresql/9.3-1103-jdbc4/postgresql-9.3-1103-jdbc4.jar',
# TODO
# Error: /Stage[main]/Main/Wildfly::Deployment[hawtio.war]/File[/opt/hawtio-web-1.4.66.war]: Could not evaluate: Could not retrieve file metadata for http://central.maven.org/maven2/io/hawt/hawtio-web/1.4.66/hawtio-web-1.4.66.war: Request to http://central.maven.org/maven2/io/hawt/hawtio-web/1.4.66/hawtio-web-1.4.66.war failed after 0.02 seconds: Failed to open TCP connection to central.maven.org:80 (getaddrinfo: Name or service not known)
source => '#{test_data['postgres_jar_source']}',
dependencies => ['javax.api', 'javax.transaction.api']
}
->
Expand Down Expand Up @@ -56,8 +58,10 @@ class { 'wildfly':
}
EOS

execute_manifest(pp, :catch_failures => true, :acceptable_exit_codes => [0, 2])
expect(execute_manifest(pp, :catch_failures => true).exit_code).to be_zero
puts "Debug: Applying this Manifest from #{__FILE__}"
puts pp
apply_manifest(pp, :catch_failures => true, :acceptable_exit_codes => [0, 2])
expect(apply_manifest(pp, :catch_failures => true).exit_code).to be_zero
shell('sleep 25')
end

Expand Down
79 changes: 79 additions & 0 deletions spec/acceptance/1_standalone_wildfly_spec.rb
Original file line number Diff line number Diff line change
@@ -0,0 +1,79 @@
require 'spec_helper_acceptance'

pp = <<-EOP
Exec {
path => $facts['path'],
}

$_properties = {
'jboss.bind.address' => 'localhost',
'jboss.management.http.port' => '1081',
'jboss.management.https.port' => '10444',
'jboss.http.port' => '1080',
'jboss.https.port' => '10443',
'jboss.ajp.port' => '1234'
}
$_service_name = 'very-buggy-server'
$_uid = '1000'
$_user = 'wildfly'
$link_name = '/home/wildfly/'

if $facts['os']['family'] == 'Debian' {
$javapkg = 'openjdk-17-jdk'
$javahome = '/usr/lib/jvm/java-17-openjdk-amd64/'
} else {
$javapkg = 'java-17-openjdk.x86_64'
$javahome = '/usr/lib/jvm/java-17-openjdk-17.0.16.0.8-2.el9.x86_64/'
}

package { $javapkg:
ensure => present,
}
->
group { $_user:
ensure => present,
gid => Integer($_uid),
}
->
user { $_user:
uid => $_uid,
gid => $_uid,
}
#~>
#exec {'chown -R wildfly: /opt/wildfly-32.0.1/':
# returns => [0,1],
#}
->
class{'wildfly':
config => 'standalone.xml',
console_log => "/var/log/wildfly/console.log",
dirname => "/opt/wildfly-32.0.1",
distribution => "wildfly",
gid => Integer($_uid),
group => $_user,
install_cache_dir => '/tmp/wildfly/',
install_source => '#{test_data['install_source']}',
java_home => '#{test_data['java_home']}',
java_opts => undef,
java_maxmetaspace_size => '2048m',
java_xms => '128M',
java_xmx => '512M',
manage_user => false,
properties => $_properties,
service_name => '#{test_data['service_name']}',
service_manage => true,
uid => Integer($_uid),
user => $_user,
user_home => $link_name,
version => '32.0.1',
}
EOP

describe 'install wildfly and its dependencies and start service' do
context 'it deduces environment form test_data.rb' do
it 'applies the manfest without error, idempotently' do

Check failure on line 74 in spec/acceptance/1_standalone_wildfly_spec.rb

View workflow job for this annotation

GitHub Actions / Puppet / OpenVox 8 - OracleLinux 9

install wildfly and its dependencies and start service it deduces environment form test_data.rb applies the manfest without error, idempotently Failure/Error: apply_manifest(pp, catch_changes: true, acceptable_exit_codes: [0]) Beaker::Host::CommandFailure: Host 'oracle9-64-openvox8.example.com' exited with 2 running: puppet apply --verbose --detailed-exitcodes /tmp/apply_manifest_122321090.eyTEiJ.pp Last 10 lines of output were: Warning: This function is deprecated, please use stdlib::ensure_packages instead. at ["/etc/puppetlabs/code/environments/production/modules/wildfly/manifests/prepare.pp", 39]:["/etc/puppetlabs/code/environments/production/modules/wildfly/manifests/init.pp", 133] (location: /etc/puppetlabs/code/environments/production/modules/stdlib/lib/puppet/functions/deprecation.rb:35:in `deprecation') �[mNotice: Compiled catalog for oracle9-64-openvox8.example.com in environment production in 0.12 seconds Info: Using environment 'production' Info: Applying configuration version '1760531003' Warning: Private key for 'oracle9-64-openvox8.example.com' does not exist Warning: Client certificate for 'oracle9-64-openvox8.example.com' does not exist �[mNotice: /Stage[main]/Wildfly::Service/Service[wildfly]/ensure: ensure changed 'stopped' to 'running' Info: /Stage[main]/Wildfly::Service/Service[wildfly]: Unscheduling refresh on Service[wildfly] �[mNotice: Applied catalog in 17.62 seconds

Check failure on line 74 in spec/acceptance/1_standalone_wildfly_spec.rb

View workflow job for this annotation

GitHub Actions / Puppet / OpenVox 8 - OracleLinux 8

install wildfly and its dependencies and start service it deduces environment form test_data.rb applies the manfest without error, idempotently Failure/Error: apply_manifest(pp, catch_changes: true, acceptable_exit_codes: [0]) Beaker::Host::CommandFailure: Host 'oracle8-64-openvox8.example.com' exited with 2 running: puppet apply --verbose --detailed-exitcodes /tmp/apply_manifest_122330632.zPQm8Y.pp Last 10 lines of output were: Warning: This function is deprecated, please use stdlib::ensure_packages instead. at ["/etc/puppetlabs/code/environments/production/modules/wildfly/manifests/prepare.pp", 39]:["/etc/puppetlabs/code/environments/production/modules/wildfly/manifests/init.pp", 133] (location: /etc/puppetlabs/code/environments/production/modules/stdlib/lib/puppet/functions/deprecation.rb:35:in `deprecation') �[mNotice: Compiled catalog for oracle8-64-openvox8.example.com in environment production in 0.10 seconds Info: Using environment 'production' Info: Applying configuration version '1760531012' Warning: Private key for 'oracle8-64-openvox8.example.com' does not exist Warning: Client certificate for 'oracle8-64-openvox8.example.com' does not exist �[mNotice: /Stage[main]/Wildfly::Service/Service[wildfly]/ensure: ensure changed 'stopped' to 'running' Info: /Stage[main]/Wildfly::Service/Service[wildfly]: Unscheduling refresh on Service[wildfly] �[mNotice: Applied catalog in 17.89 seconds

Check failure on line 74 in spec/acceptance/1_standalone_wildfly_spec.rb

View workflow job for this annotation

GitHub Actions / Puppet / OpenVox 8 - Ubuntu 22.04

install wildfly and its dependencies and start service it deduces environment form test_data.rb applies the manfest without error, idempotently Failure/Error: apply_manifest(pp, catch_changes: true, acceptable_exit_codes: [0]) Beaker::Host::CommandFailure: Host 'ubuntu2204-64-openvox8.example.com' exited with 2 running: puppet apply --verbose --detailed-exitcodes /tmp/apply_manifest_122301494.Lgi6X9.pp Last 10 lines of output were: Warning: This function is deprecated, please use stdlib::ensure_packages instead. at ["/etc/puppetlabs/code/environments/production/modules/wildfly/manifests/prepare.pp", 39]:["/etc/puppetlabs/code/environments/production/modules/wildfly/manifests/init.pp", 133] (location: /etc/puppetlabs/code/environments/production/modules/stdlib/lib/puppet/functions/deprecation.rb:35:in `deprecation') �[mNotice: Compiled catalog for ubuntu2204-64-openvox8.example.com in environment production in 0.10 seconds Info: Using environment 'production' Info: Applying configuration version '1760530983' Warning: Private key for 'ubuntu2204-64-openvox8.example.com' does not exist Warning: Client certificate for 'ubuntu2204-64-openvox8.example.com' does not exist �[mNotice: /Stage[main]/Wildfly::Service/Service[wildfly]/ensure: ensure changed 'stopped' to 'running' Info: /Stage[main]/Wildfly::Service/Service[wildfly]: Unscheduling refresh on Service[wildfly] �[mNotice: Applied catalog in 17.92 seconds

Check failure on line 74 in spec/acceptance/1_standalone_wildfly_spec.rb

View workflow job for this annotation

GitHub Actions / Puppet / OpenVox 8 - Debian 12

install wildfly and its dependencies and start service it deduces environment form test_data.rb applies the manfest without error, idempotently Failure/Error: apply_manifest(pp, catch_changes: true, acceptable_exit_codes: [0]) Beaker::Host::CommandFailure: Host 'debian12-64-openvox8.example.com' exited with 2 running: puppet apply --verbose --detailed-exitcodes /tmp/apply_manifest_122254208.ZYznz5.pp Last 10 lines of output were: Warning: This function is deprecated, please use stdlib::ensure_packages instead. at ["/etc/puppetlabs/code/environments/production/modules/wildfly/manifests/prepare.pp", 39]:["/etc/puppetlabs/code/environments/production/modules/wildfly/manifests/init.pp", 133] (location: /etc/puppetlabs/code/environments/production/modules/stdlib/lib/puppet/functions/deprecation.rb:35:in `deprecation') �[mNotice: Compiled catalog for debian12-64-openvox8.example.com in environment production in 0.10 seconds Info: Using environment 'production' Info: Applying configuration version '1760530975' Warning: Private key for 'debian12-64-openvox8.example.com' does not exist Warning: Client certificate for 'debian12-64-openvox8.example.com' does not exist �[mNotice: /Stage[main]/Wildfly::Service/Service[wildfly]/ensure: ensure changed 'stopped' to 'running' Info: /Stage[main]/Wildfly::Service/Service[wildfly]: Unscheduling refresh on Service[wildfly] �[mNotice: Applied catalog in 18.09 seconds

Check failure on line 74 in spec/acceptance/1_standalone_wildfly_spec.rb

View workflow job for this annotation

GitHub Actions / Puppet / OpenVox 8 - CentOS 9

install wildfly and its dependencies and start service it deduces environment form test_data.rb applies the manfest without error, idempotently Failure/Error: apply_manifest(pp, catch_changes: true, acceptable_exit_codes: [0]) Beaker::Host::CommandFailure: Host 'centos9-64-openvox8.example.com' exited with 2 running: puppet apply --verbose --detailed-exitcodes /tmp/apply_manifest_122253770.GHTrKG.pp Last 10 lines of output were: Warning: This function is deprecated, please use stdlib::ensure_packages instead. at ["/etc/puppetlabs/code/environments/production/modules/wildfly/manifests/prepare.pp", 39]:["/etc/puppetlabs/code/environments/production/modules/wildfly/manifests/init.pp", 133] (location: /etc/puppetlabs/code/environments/production/modules/stdlib/lib/puppet/functions/deprecation.rb:35:in `deprecation') �[mNotice: Compiled catalog for centos9-64-openvox8.example.com in environment production in 0.11 seconds Info: Using environment 'production' Info: Applying configuration version '1760530975' Warning: Private key for 'centos9-64-openvox8.example.com' does not exist Warning: Client certificate for 'centos9-64-openvox8.example.com' does not exist �[mNotice: /Stage[main]/Wildfly::Service/Service[wildfly]/ensure: ensure changed 'stopped' to 'running' Info: /Stage[main]/Wildfly::Service/Service[wildfly]: Unscheduling refresh on Service[wildfly] �[mNotice: Applied catalog in 17.91 seconds

Check failure on line 74 in spec/acceptance/1_standalone_wildfly_spec.rb

View workflow job for this annotation

GitHub Actions / Puppet / OpenVox 8 - Debian 11

install wildfly and its dependencies and start service it deduces environment form test_data.rb applies the manfest without error, idempotently Failure/Error: apply_manifest(pp, catch_changes: true, acceptable_exit_codes: [0]) Beaker::Host::CommandFailure: Host 'debian11-64-openvox8.example.com' exited with 2 running: puppet apply --verbose --detailed-exitcodes /tmp/apply_manifest_122305678.bBr6v1.pp Last 10 lines of output were: Warning: This function is deprecated, please use stdlib::ensure_packages instead. at ["/etc/puppetlabs/code/environments/production/modules/wildfly/manifests/prepare.pp", 39]:["/etc/puppetlabs/code/environments/production/modules/wildfly/manifests/init.pp", 133] (location: /etc/puppetlabs/code/environments/production/modules/stdlib/lib/puppet/functions/deprecation.rb:35:in `deprecation') �[mNotice: Compiled catalog for debian11-64-openvox8.example.com in environment production in 0.10 seconds Info: Using environment 'production' Info: Applying configuration version '1760530987' Warning: Private key for 'debian11-64-openvox8.example.com' does not exist Warning: Client certificate for 'debian11-64-openvox8.example.com' does not exist �[mNotice: /Stage[main]/Wildfly::Service/Service[wildfly]/ensure: ensure changed 'stopped' to 'running' Info: /Stage[main]/Wildfly::Service/Service[wildfly]: Unscheduling refresh on Service[wildfly] �[mNotice: Applied catalog in 18.13 seconds
apply_manifest(pp, catch_failures: true, acceptable_exit_codes: [0, 2])
apply_manifest(pp, catch_changes: true, acceptable_exit_codes: [0])
end
end
end
Original file line number Diff line number Diff line change
Expand Up @@ -14,16 +14,16 @@ class { 'wildfly':
}

wildfly::deployment { 'hawtio.war':
source => 'http://central.maven.org/maven2/io/hawt/hawtio-web/1.4.66/hawtio-web-1.4.66.war'
source => '#{test_data['sample_war_simple']}'
}

wildfly::deployment { 'sample.war':
source => 'http://central.maven.org/maven2/org/codehaus/cargo/simple-war/1.6.2/simple-war-1.6.2.war'
source => '#{test_data['sample_war_simple']}'
}
EOS

execute_manifest(pp, :catch_failures => true, :acceptable_exit_codes => [0, 2])
expect(execute_manifest(pp, :catch_failures => true).exit_code).to be_zero
apply_manifest(pp, :catch_failures => true, :acceptable_exit_codes => [0, 2])
expect(apply_manifest(pp, :catch_failures => true).exit_code).to be_zero
shell('sleep 25')
end

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ class { 'wildfly':
}

wildfly::config::module { 'org.postgresql':
source => 'http://central.maven.org/maven2/org/postgresql/postgresql/9.3-1103-jdbc4/postgresql-9.3-1103-jdbc4.jar',
source => '#{test_data['postgres_jar_source']}',
dependencies => ['javax.api', 'javax.transaction.api'],
}
->
Expand All @@ -37,8 +37,8 @@ class { 'wildfly':

EOS

execute_manifest(pp, :catch_failures => true, :acceptable_exit_codes => [0, 2])
expect(execute_manifest(pp, :catch_failures => true).exit_code).to be_zero
apply_manifest(pp, :catch_failures => true, :acceptable_exit_codes => [0, 2])
expect(apply_manifest(pp, :catch_failures => true).exit_code).to be_zero
shell('sleep 25')
end

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -24,14 +24,14 @@ class { 'wildfly':
}

wildfly::deployment { 'hawtio.war':
source => 'http://central.maven.org/maven2/io/hawt/hawtio-web/1.4.66/hawtio-web-1.4.66.war',
source => '#{test_data['sample_war_hawtio']}',
server_group => 'main-server-group',
}

EOS

execute_manifest(pp, :catch_failures => true, :acceptable_exit_codes => [0, 2])
expect(execute_manifest(pp, :catch_failures => true).exit_code).to be_zero
apply_manifest(pp, :catch_failures => true, :acceptable_exit_codes => [0, 2])
expect(apply_manifest(pp, :catch_failures => true).exit_code).to be_zero
shell('sleep 25')
end

Expand All @@ -57,12 +57,13 @@ class { 'wildfly':
end
end

it 'ExampleDS does not exists in full profile' do
shell("#{jboss_cli} '/profile=full-ha/subsystem=datasources/data-source=ExampleDS:read-resource'",
:acceptable_exit_codes => 1) do |r|
expect(r.stdout).to include 'not found'
end
end
# Dont repeat examples within a group
# it 'ExampleDS does not exists in full profile' do
# shell("#{jboss_cli} '/profile=full-ha/subsystem=datasources/data-source=ExampleDS:read-resource'",
# :acceptable_exit_codes => 1) do |r|
# expect(r.stdout).to include 'not found'
# end
# end

it 'is a Domain Controller' do
shell("#{jboss_cli} 'ls'",
Expand Down
6 changes: 3 additions & 3 deletions spec/acceptance/5_domain_spec_custom_server_group.rb
Original file line number Diff line number Diff line change
Expand Up @@ -20,14 +20,14 @@ class { 'wildfly':
}

wildfly::deployment { 'hawtio.war':
source => 'http://central.maven.org/maven2/io/hawt/hawtio-web/1.4.66/hawtio-web-1.4.66.war',
source => '#{test_data['sample_war_hawtio']}',
server_group => 'app-server-group',
}

EOS

execute_manifest(pp, :catch_failures => true, :acceptable_exit_codes => [0, 2])
expect(execute_manifest(pp, :catch_failures => true).exit_code).to be_zero
apply_manifest(pp, :catch_failures => true, :acceptable_exit_codes => [0, 2])
expect(apply_manifest(pp, :catch_failures => true).exit_code).to be_zero
shell('sleep 25')
end

Expand Down
75 changes: 47 additions & 28 deletions spec/support/acceptance/test_data.rb
Original file line number Diff line number Diff line change
@@ -1,32 +1,51 @@
def test_data
RSpec.configuration.test_data
end
# profile = ENV['TEST_profile'] || 'wildfly:9.0.2' # letzte funktionierend bekannte Version
profile = ENV['TEST_profile'] || 'wildfly:37.0.1'

profile = ENV['TEST_profile'] || 'wildfly:9.0.2'

data = {}

case profile
when /(wildfly):(\d{1,}\.\d{1,}\.\d{1,})/
data['distribution'] = Regexp.last_match(1)
data['version'] = Regexp.last_match(2)
pkg_path = "wildfly/#{data['version']}.Final/wildfly-#{data['version']}.Final.tar.gz"
data['install_source'] = (data['version'].to_f < 25.0 ? "http://download.jboss.org/#{pkg_path}" : "https://github.com/wildfly/#{pkg_path}")
data['service_name'] = 'wildfly'

when /(jboss-eap):(\d{1,}\.\d{1,})/
data['distribution'] = Regexp.last_match(1)
data['version'] = Regexp.last_match(2)
data['install_source'] = "http://10.0.2.2:9090/jboss-eap-#{data['version']}.tar.gz"
data['service_name'] = (data['version'].to_f < 7.0 ? 'jboss-as' : 'jboss-eap')

when 'custom'
data['distribution'] = ENV.fetch('TEST_distribution', 'wildfly')
data['version'] = ENV.fetch('TEST_version', '9.0.2')
data['install_source'] = ENV.fetch('TEST_install_source', "http://download.jboss.org/wildfly/#{data['version']}.Final/wildfly-#{data['version']}.Final.tar.gz")
data['service_name'] = ENV.fetch('TEST_service_name', 'wildfly')
end
puts "Marcus war hier"
puts "Debug: Profile"
puts profile.inspect

data = {}

case profile
when /(wildfly):(\d{1,}\.\d{1,}\.\d{1,})/
data['distribution'] = Regexp.last_match(1)
data['version'] = Regexp.last_match(2)
data['install_source'] = if data['version'].to_f < 25.0
puts "weniger als 25"
"http://download.jboss.org/wildfly/#{data['version']}.Final/wildfly-#{data['version']}.Final.tar.gz"
else
puts "neuer als 25"
"https://github.com/wildfly/wildfly/releases/download/#{data['version']}.Final/wildfly-#{data['version']}.Final.tar.gz"
end
data['service_name'] = 'wildfly'

when /(jboss-eap):(\d{1,}\.\d{1,})/
data['distribution'] = Regexp.last_match(1)
data['version'] = Regexp.last_match(2)
data['install_source'] = "http://10.0.2.2:9090/jboss-eap-#{data['version']}.tar.gz"
data['service_name'] = (data['version'].to_f < 7.0 ? 'jboss-as' : 'jboss-eap')

data['java_home'] = '/opt/jdk8u192-b12/'
when 'custom'
data['distribution'] = ENV.fetch('TEST_distribution', 'wildfly')
data['version'] = ENV.fetch('TEST_version', '9.0.2')
data['install_source'] = ENV.fetch('TEST_install_source', "http://download.jboss.org/wildfly/#{data['version']}.Final/wildfly-#{data['version']}.Final.tar.gz")
data['service_name'] = ENV.fetch('TEST_service_name', 'wildfly')
end

RSpec.configuration.test_data = data
data['java_home'] = `readlink /etc/alternatives/java`.gsub(%r{bin/java$}, '').strip
data['postgres_jar_source'] = "https://repo1.maven.org/maven2/org/postgresql/postgresql/9.3-1103-jdbc41/postgresql-9.3-1103-jdbc41.jar"
data['sample_war_simple'] = "https://repo1.maven.org/maven2/org/codehaus/cargo/simple-war/1.6.2/simple-war-1.6.2.war"
data['sample_war_hawtio'] = "https://repo1.maven.org/maven2/io/hawt/hawtio-web/1.4.66/hawtio-web-1.4.66.war"
data['beaker_autoconfigure'] = "true"

puts "Debug: Test-Data"
puts data.inspect

puts "Debug: Java-Verison mit ganzem Pfad"
puts `#{data['java_home']}/bin/java --version`

# RSpec.configuration.test_data = data # das ist kaputt undefined method `test_data= for #<RSpec::Core::Configuration:0x00007fe97ad8f020
data
end
Loading
Loading