From f2ca9c54b5140cc8a136f8fb576356702ffb9c0c Mon Sep 17 00:00:00 2001 From: Tim Meusel Date: Mon, 26 Aug 2024 11:23:14 +0200 Subject: [PATCH 01/40] Enable acceptance tests --- .github/workflows/ci.yml | 2 +- .sync.yml | 5 ++- acceptance.sh | 13 ------ test.sh | 92 ---------------------------------------- 4 files changed, 4 insertions(+), 108 deletions(-) delete mode 100755 acceptance.sh delete mode 100755 test.sh diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 6f5ac00f..44674150 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -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 diff --git a/.sync.yml b/.sync.yml index 3c2702e5..5d21319c 100644 --- a/.sync.yml +++ b/.sync.yml @@ -1,2 +1,3 @@ -.github/workflows/ci.yml: - acceptance_tests: false +--- +spec/spec_helper_acceptance.rb: + unmanaged: false diff --git a/acceptance.sh b/acceptance.sh deleted file mode 100755 index 0a7627e7..00000000 --- a/acceptance.sh +++ /dev/null @@ -1,13 +0,0 @@ -#!/bin/bash - -PROFILES=( wildfly:8.0.0 wildfly:8.2.1 wildfly:9.0.2 wildfly:10.1.0 ) -BOXES=( default centos-72-x64 debian-78-x64 debian-82-x64 ubuntu-1404-x64 ubuntu-1604-x64 ) -for TEST_profile in "${PROFILES[@]}" -do - for BOX in "${BOXES[@]}" - do - PUPPET_INSTALL_TYPE="agent" TEST_profile="${TEST_profile}" BEAKER_set="${BOX}" bundle exec rake beaker - done -done - -BEAKER_TESTMODE=agent BEAKER_set=centos7m_centos7a PUPPET_INSTALL_TYPE=agent bundle exec rake beaker diff --git a/test.sh b/test.sh deleted file mode 100755 index 8b30449d..00000000 --- a/test.sh +++ /dev/null @@ -1,92 +0,0 @@ -#!/bin/bash - -source ~/.profile -source ~/.rvm/scripts/rvm - -rvm --version - -# rvm install ruby-1.8.7 -# rvm use ruby-1.8.7 -# rvm install ruby-1.9.3 -# rvm use ruby-1.9.3 -#rvm install ruby-2.0.0 -#rvm use ruby-2.0.0 - -rvm install ruby-2.3.1 -rvm use ruby-2.3.1 - -brew install libxml2 - -set -e - -ruby -v -echo "gem version" -gem --version -gem install bundler --no-rdoc --no-ri --version 1.10.6 -bundle install --without development -bundle config build.nokogiri "--use-system-libraries --with-xml2-include=/usr/local/opt/libxml2/include/libxml2" -bundle --version -gem update --system 2.1.11 - -bundle exec rake syntax -bundle exec rake lint -bundle exec rake spec -#bundle exec rake ci:setup:rspec spec -BEAKER_debug=true BEAKER_destroy=onpass bundle exec rspec spec/acceptance -BEAKER_set=centos-70-x64 bundle exec rspec spec/acceptance -BEAKER_set=debian-78-x64 bundle exec rspec spec/acceptance -bundle exec rubocop -#bundle exec rake spec - -#ruby syntax check -rubocop - - -# Release the Puppet module, doing a clean, build, tag, push, bump_commit -rake module:clean -rake build - -rake module:push -rake module:tag -rake module:bump_commit # Bump version and git commit - - -## Windows - -start cmd in admin mode - -use only 32-bits, its more stable, http://rubyinstaller.org/downloads/ - -Ruby 2.0.0-p598 to C:\Ruby\200 -Ruby Development kit to C:\Ruby\2_devkit, so you can optionally build your gems - -set PATH=%PATH%;C:\Ruby\200\bin -C:\Ruby\2_devkit\devkitvars.bat -ruby -v - -### Gem - -#### one time rubygems ssl error -https://github.com/rubygems/rubygems/releases/tag/v2.0.15 -gem install --local C:\temp\rubygems-update-2.0.15.gem -update_rubygems --no-ri --no-rdoc -gem uninstall rubygems-update -x - -gem update --system 2.1.11 -gem list --local -gem uninstall bundler -gem install bundler --version 1.7.15 -gem install json - -### Bundle - -bundle install --verbose --without development - -bundle exec rake syntax -bundle exec rake lint -bundle exec rake spec -bundle exec rubocop - -bundle exec rspec spec/acceptance -BEAKER_set=centos-70-x64 bundle exec rspec spec/acceptance -BEAKER_destroy=onpass BEAKER_set=debian-78-x64 bundle exec rspec spec/acceptance From ebebc5e2bffde13855d0230579fb1cd8af90f065 Mon Sep 17 00:00:00 2001 From: Marcus Poller Date: Mon, 13 Oct 2025 11:13:34 +0200 Subject: [PATCH 02/40] Debug-Meldungen --- spec/support/acceptance/test_data.rb | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/spec/support/acceptance/test_data.rb b/spec/support/acceptance/test_data.rb index ab902bda..676516ca 100644 --- a/spec/support/acceptance/test_data.rb +++ b/spec/support/acceptance/test_data.rb @@ -4,6 +4,10 @@ def test_data profile = ENV['TEST_profile'] || 'wildfly:9.0.2' +puts "Marcus war hier" +puts "Debug: Profile" +puts profile.inspect + data = {} case profile @@ -30,3 +34,6 @@ def test_data data['java_home'] = '/opt/jdk8u192-b12/' RSpec.configuration.test_data = data + +puts "Debug: Test-Data" +puts data.inspect From 9479c61abb30122fbe4775432612dc3267d540d8 Mon Sep 17 00:00:00 2001 From: Marcus Poller Date: Mon, 13 Oct 2025 11:17:42 +0200 Subject: [PATCH 03/40] Debug: Java-Versionen --- spec/support/acceptance/test_data.rb | 3 +++ 1 file changed, 3 insertions(+) diff --git a/spec/support/acceptance/test_data.rb b/spec/support/acceptance/test_data.rb index 676516ca..bce642ad 100644 --- a/spec/support/acceptance/test_data.rb +++ b/spec/support/acceptance/test_data.rb @@ -37,3 +37,6 @@ def test_data puts "Debug: Test-Data" puts data.inspect + +puts "Debug: Verfügbare Java-Version" +puts %x{ls -l /opt} From 9ba42e4cd67bbb6b088397f144ce0f8640ae801f Mon Sep 17 00:00:00 2001 From: Marcus Poller Date: Mon, 13 Oct 2025 11:41:34 +0200 Subject: [PATCH 04/40] Debug: WildFly-37 --- spec/support/acceptance/test_data.rb | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/spec/support/acceptance/test_data.rb b/spec/support/acceptance/test_data.rb index bce642ad..34f646f1 100644 --- a/spec/support/acceptance/test_data.rb +++ b/spec/support/acceptance/test_data.rb @@ -2,7 +2,8 @@ def test_data RSpec.configuration.test_data end -profile = ENV['TEST_profile'] || 'wildfly:9.0.2' +#profile = ENV['TEST_profile'] || 'wildfly:9.0.2' # letzte funktionierend bekannte Version +profile = ENV['TEST_profile'] || 'wildfly:37.0.1' puts "Marcus war hier" puts "Debug: Profile" From 2fd84e8feb4eae1c7cc0614646c72b8ec11c7bdf Mon Sep 17 00:00:00 2001 From: Marcus Poller Date: Mon, 13 Oct 2025 11:43:22 +0200 Subject: [PATCH 05/40] lint --- spec/support/acceptance/test_data.rb | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/spec/support/acceptance/test_data.rb b/spec/support/acceptance/test_data.rb index 34f646f1..bf84048f 100644 --- a/spec/support/acceptance/test_data.rb +++ b/spec/support/acceptance/test_data.rb @@ -2,7 +2,10 @@ def test_data RSpec.configuration.test_data end -#profile = ENV['TEST_profile'] || 'wildfly:9.0.2' # letzte funktionierend bekannte Version +=begin +nur um spec zu ärgern +=end +# profile = ENV['TEST_profile'] || 'wildfly:9.0.2' # letzte funktionierend bekannte Version profile = ENV['TEST_profile'] || 'wildfly:37.0.1' puts "Marcus war hier" From 599ca1ad163126b13d4e590702825dcb661b63ad Mon Sep 17 00:00:00 2001 From: Marcus Poller Date: Mon, 13 Oct 2025 11:54:07 +0200 Subject: [PATCH 06/40] rubucop mag multiline comments nicht --- spec/support/acceptance/test_data.rb | 3 --- 1 file changed, 3 deletions(-) diff --git a/spec/support/acceptance/test_data.rb b/spec/support/acceptance/test_data.rb index bf84048f..d13029de 100644 --- a/spec/support/acceptance/test_data.rb +++ b/spec/support/acceptance/test_data.rb @@ -2,9 +2,6 @@ def test_data RSpec.configuration.test_data end -=begin -nur um spec zu ärgern -=end # profile = ENV['TEST_profile'] || 'wildfly:9.0.2' # letzte funktionierend bekannte Version profile = ENV['TEST_profile'] || 'wildfly:37.0.1' From 7ce8088b2b1d69fcb829451c9607fb0b570fb24a Mon Sep 17 00:00:00 2001 From: Marcus Poller Date: Mon, 13 Oct 2025 12:05:03 +0200 Subject: [PATCH 07/40] rubucop mag %x{} nicht --- spec/support/acceptance/test_data.rb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/spec/support/acceptance/test_data.rb b/spec/support/acceptance/test_data.rb index d13029de..f233794b 100644 --- a/spec/support/acceptance/test_data.rb +++ b/spec/support/acceptance/test_data.rb @@ -40,4 +40,4 @@ def test_data puts data.inspect puts "Debug: Verfügbare Java-Version" -puts %x{ls -l /opt} +puts `ls -l /opt` From 790519a662ca245c5166de4147a5bce216881e84 Mon Sep 17 00:00:00 2001 From: Marcus Poller Date: Mon, 13 Oct 2025 12:17:05 +0200 Subject: [PATCH 08/40] undefined method `test_data= for # Date: Mon, 13 Oct 2025 12:35:48 +0200 Subject: [PATCH 09/40] rubocop unreachable code --- spec/support/acceptance/test_data.rb | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/spec/support/acceptance/test_data.rb b/spec/support/acceptance/test_data.rb index 0fdb5ff3..b1eb3125 100644 --- a/spec/support/acceptance/test_data.rb +++ b/spec/support/acceptance/test_data.rb @@ -1,6 +1,4 @@ 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' @@ -40,7 +38,9 @@ def test_data puts "Debug: Verfügbare Java-Version" puts `ls -l /opt` -exit 0 +# RSpec.configuration.test_data = data # das ist kaputt undefined method `test_data= for # Date: Mon, 13 Oct 2025 12:37:19 +0200 Subject: [PATCH 10/40] rubocop --- spec/support/acceptance/test_data.rb | 69 ++++++++++++++-------------- 1 file changed, 34 insertions(+), 35 deletions(-) diff --git a/spec/support/acceptance/test_data.rb b/spec/support/acceptance/test_data.rb index b1eb3125..6e042b5d 100644 --- a/spec/support/acceptance/test_data.rb +++ b/spec/support/acceptance/test_data.rb @@ -1,45 +1,44 @@ def test_data + # 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' # letzte funktionierend bekannte Version -profile = ENV['TEST_profile'] || 'wildfly:37.0.1' - -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) - 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) + 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 -data['java_home'] = '/opt/jdk8u192-b12/' + data['java_home'] = '/opt/jdk8u192-b12/' -puts "Debug: Test-Data" -puts data.inspect + puts "Debug: Test-Data" + puts data.inspect -puts "Debug: Verfügbare Java-Version" -puts `ls -l /opt` + puts "Debug: Verfügbare Java-Version" + puts `ls -l /opt` # RSpec.configuration.test_data = data # das ist kaputt undefined method `test_data= for # Date: Mon, 13 Oct 2025 12:38:45 +0200 Subject: [PATCH 11/40] rubocop --- spec/support/acceptance/test_data.rb | 3 --- 1 file changed, 3 deletions(-) diff --git a/spec/support/acceptance/test_data.rb b/spec/support/acceptance/test_data.rb index 6e042b5d..c4bbecab 100644 --- a/spec/support/acceptance/test_data.rb +++ b/spec/support/acceptance/test_data.rb @@ -40,6 +40,3 @@ def test_data # RSpec.configuration.test_data = data # das ist kaputt undefined method `test_data= for # Date: Mon, 13 Oct 2025 12:39:09 +0200 Subject: [PATCH 12/40] rubocop --- spec/support/acceptance/test_data.rb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/spec/support/acceptance/test_data.rb b/spec/support/acceptance/test_data.rb index c4bbecab..90f86989 100644 --- a/spec/support/acceptance/test_data.rb +++ b/spec/support/acceptance/test_data.rb @@ -38,5 +38,5 @@ def test_data puts `ls -l /opt` # RSpec.configuration.test_data = data # das ist kaputt undefined method `test_data= for # Date: Mon, 13 Oct 2025 12:40:36 +0200 Subject: [PATCH 13/40] rubocop --- spec/support/acceptance/test_data.rb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/spec/support/acceptance/test_data.rb b/spec/support/acceptance/test_data.rb index 90f86989..e7bad113 100644 --- a/spec/support/acceptance/test_data.rb +++ b/spec/support/acceptance/test_data.rb @@ -37,6 +37,6 @@ def test_data puts "Debug: Verfügbare Java-Version" puts `ls -l /opt` -# RSpec.configuration.test_data = data # das ist kaputt undefined method `test_data= for # Date: Mon, 13 Oct 2025 13:39:49 +0200 Subject: [PATCH 14/40] rubocop --- spec/support/acceptance/test_data.rb | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/spec/support/acceptance/test_data.rb b/spec/support/acceptance/test_data.rb index e7bad113..85716906 100644 --- a/spec/support/acceptance/test_data.rb +++ b/spec/support/acceptance/test_data.rb @@ -12,8 +12,11 @@ def test_data 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['install_source'] = if data['version'].to_f < 25.0 + "http://download.jboss.org/wildfly/#{data['version']}.Final/wildfly-#{data['version']}.Final.tar.gz" + else + "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,})/ From 26bfad0da1c333a3b80ff61f97d9542bb44973fe Mon Sep 17 00:00:00 2001 From: Marcus Poller Date: Mon, 13 Oct 2025 13:54:23 +0200 Subject: [PATCH 15/40] download url stimmt nicht --- spec/support/acceptance/test_data.rb | 2 ++ 1 file changed, 2 insertions(+) diff --git a/spec/support/acceptance/test_data.rb b/spec/support/acceptance/test_data.rb index 85716906..7ce558a1 100644 --- a/spec/support/acceptance/test_data.rb +++ b/spec/support/acceptance/test_data.rb @@ -13,8 +13,10 @@ def test_data 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' From a5f2bc181111383e02ce2403a25e4b385bf7a61d Mon Sep 17 00:00:00 2001 From: Marcus Poller Date: Mon, 13 Oct 2025 14:03:43 +0200 Subject: [PATCH 16/40] java version? --- spec/support/acceptance/test_data.rb | 2 ++ 1 file changed, 2 insertions(+) diff --git a/spec/support/acceptance/test_data.rb b/spec/support/acceptance/test_data.rb index 7ce558a1..b9029acb 100644 --- a/spec/support/acceptance/test_data.rb +++ b/spec/support/acceptance/test_data.rb @@ -41,6 +41,8 @@ def test_data puts "Debug: Verfügbare Java-Version" puts `ls -l /opt` + puts "Debug: Default Java Version" + puts `java --version` # RSpec.configuration.test_data = data # das ist kaputt undefined method `test_data= for # Date: Mon, 13 Oct 2025 14:14:23 +0200 Subject: [PATCH 17/40] java home --- spec/support/acceptance/test_data.rb | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/spec/support/acceptance/test_data.rb b/spec/support/acceptance/test_data.rb index b9029acb..7aa9db4d 100644 --- a/spec/support/acceptance/test_data.rb +++ b/spec/support/acceptance/test_data.rb @@ -34,7 +34,7 @@ def test_data data['service_name'] = ENV.fetch('TEST_service_name', 'wildfly') end - data['java_home'] = '/opt/jdk8u192-b12/' + data['java_home'] = '/usr/lib/jvm/jre-17-openjdk' puts "Debug: Test-Data" puts data.inspect @@ -43,6 +43,8 @@ def test_data puts `ls -l /opt` puts "Debug: Default Java Version" puts `java --version` + puts "Debug: Java Home" + puts `ls -l #{data['java_home']}` # RSpec.configuration.test_data = data # das ist kaputt undefined method `test_data= for # Date: Mon, 13 Oct 2025 14:20:00 +0200 Subject: [PATCH 18/40] java home --- spec/support/acceptance/test_data.rb | 2 ++ 1 file changed, 2 insertions(+) diff --git a/spec/support/acceptance/test_data.rb b/spec/support/acceptance/test_data.rb index 7aa9db4d..3562dd0f 100644 --- a/spec/support/acceptance/test_data.rb +++ b/spec/support/acceptance/test_data.rb @@ -45,6 +45,8 @@ def test_data puts `java --version` puts "Debug: Java Home" puts `ls -l #{data['java_home']}` + puts "Debug: which java" + puts `which java` # RSpec.configuration.test_data = data # das ist kaputt undefined method `test_data= for # Date: Mon, 13 Oct 2025 14:25:12 +0200 Subject: [PATCH 19/40] java home --- spec/support/acceptance/test_data.rb | 2 ++ 1 file changed, 2 insertions(+) diff --git a/spec/support/acceptance/test_data.rb b/spec/support/acceptance/test_data.rb index 3562dd0f..ccd49348 100644 --- a/spec/support/acceptance/test_data.rb +++ b/spec/support/acceptance/test_data.rb @@ -47,6 +47,8 @@ def test_data puts `ls -l #{data['java_home']}` puts "Debug: which java" puts `which java` + puts "Debug: Java Link" + puts `ls -l $(which java)` # RSpec.configuration.test_data = data # das ist kaputt undefined method `test_data= for # Date: Mon, 13 Oct 2025 14:56:16 +0200 Subject: [PATCH 20/40] java home --- spec/support/acceptance/test_data.rb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/spec/support/acceptance/test_data.rb b/spec/support/acceptance/test_data.rb index ccd49348..861999be 100644 --- a/spec/support/acceptance/test_data.rb +++ b/spec/support/acceptance/test_data.rb @@ -34,7 +34,7 @@ def test_data data['service_name'] = ENV.fetch('TEST_service_name', 'wildfly') end - data['java_home'] = '/usr/lib/jvm/jre-17-openjdk' + data['java_home'] = `readlink /etc/alternatives/java`.gsub(%r{bin/java$}, '') puts "Debug: Test-Data" puts data.inspect From 375151e90549f331bd65653802608c370140c75a Mon Sep 17 00:00:00 2001 From: Marcus Poller Date: Mon, 13 Oct 2025 15:00:21 +0200 Subject: [PATCH 21/40] java home - space --- spec/support/acceptance/test_data.rb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/spec/support/acceptance/test_data.rb b/spec/support/acceptance/test_data.rb index 861999be..2b13d380 100644 --- a/spec/support/acceptance/test_data.rb +++ b/spec/support/acceptance/test_data.rb @@ -34,7 +34,7 @@ def test_data data['service_name'] = ENV.fetch('TEST_service_name', 'wildfly') end - data['java_home'] = `readlink /etc/alternatives/java`.gsub(%r{bin/java$}, '') + data['java_home'] = `readlink /etc/alternatives/java`.gsub(%r{bin/java$}, '').strip puts "Debug: Test-Data" puts data.inspect From 203795974bb86e02adb7867bba3764980a71331b Mon Sep 17 00:00:00 2001 From: Marcus Poller Date: Mon, 13 Oct 2025 15:19:05 +0200 Subject: [PATCH 22/40] java home --- spec/support/acceptance/test_data.rb | 12 ++---------- 1 file changed, 2 insertions(+), 10 deletions(-) diff --git a/spec/support/acceptance/test_data.rb b/spec/support/acceptance/test_data.rb index 2b13d380..d2a1ab23 100644 --- a/spec/support/acceptance/test_data.rb +++ b/spec/support/acceptance/test_data.rb @@ -39,16 +39,8 @@ def test_data puts "Debug: Test-Data" puts data.inspect - puts "Debug: Verfügbare Java-Version" - puts `ls -l /opt` - puts "Debug: Default Java Version" - puts `java --version` - puts "Debug: Java Home" - puts `ls -l #{data['java_home']}` - puts "Debug: which java" - puts `which java` - puts "Debug: Java Link" - puts `ls -l $(which java)` + 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 # Date: Tue, 14 Oct 2025 08:02:44 +0200 Subject: [PATCH 23/40] -execute_manifest +apply_manifest --- spec/acceptance/1_standalone_spec.rb | 4 ++-- spec/acceptance/2_deployment_spec.rb | 4 ++-- spec/acceptance/3_recursive_resource_spec.rb | 4 ++-- spec/acceptance/4_domain_spec.rb | 4 ++-- spec/acceptance/5_domain_spec_custom_server_group.rb | 4 ++-- 5 files changed, 10 insertions(+), 10 deletions(-) diff --git a/spec/acceptance/1_standalone_spec.rb b/spec/acceptance/1_standalone_spec.rb index e760fe5f..ae23a282 100644 --- a/spec/acceptance/1_standalone_spec.rb +++ b/spec/acceptance/1_standalone_spec.rb @@ -56,8 +56,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 diff --git a/spec/acceptance/2_deployment_spec.rb b/spec/acceptance/2_deployment_spec.rb index e9f422aa..da5d8325 100644 --- a/spec/acceptance/2_deployment_spec.rb +++ b/spec/acceptance/2_deployment_spec.rb @@ -22,8 +22,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 diff --git a/spec/acceptance/3_recursive_resource_spec.rb b/spec/acceptance/3_recursive_resource_spec.rb index 00855ce4..81553b5f 100644 --- a/spec/acceptance/3_recursive_resource_spec.rb +++ b/spec/acceptance/3_recursive_resource_spec.rb @@ -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 diff --git a/spec/acceptance/4_domain_spec.rb b/spec/acceptance/4_domain_spec.rb index 0cd7c880..f792f911 100644 --- a/spec/acceptance/4_domain_spec.rb +++ b/spec/acceptance/4_domain_spec.rb @@ -30,8 +30,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 diff --git a/spec/acceptance/5_domain_spec_custom_server_group.rb b/spec/acceptance/5_domain_spec_custom_server_group.rb index e4bbc965..d17ed044 100644 --- a/spec/acceptance/5_domain_spec_custom_server_group.rb +++ b/spec/acceptance/5_domain_spec_custom_server_group.rb @@ -26,8 +26,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 From 66d54d8c826fd6c15b94b8683cc939c638206817 Mon Sep 17 00:00:00 2001 From: Marcus Poller Date: Tue, 14 Oct 2025 08:21:18 +0200 Subject: [PATCH 24/40] maven url --- spec/acceptance/1_standalone_spec.rb | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/spec/acceptance/1_standalone_spec.rb b/spec/acceptance/1_standalone_spec.rb index ae23a282..f0e58467 100644 --- a/spec/acceptance/1_standalone_spec.rb +++ b/spec/acceptance/1_standalone_spec.rb @@ -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 => 'https://repo1.maven.org/maven2/org/postgresql/postgresql/9.3-1103-jdbc41/postgresql-9.3-1103-jdbc41.jar', dependencies => ['javax.api', 'javax.transaction.api'] } -> From 9a641ef8c27bd38b4354e1270363881d5f99d91a Mon Sep 17 00:00:00 2001 From: Marcus Poller Date: Tue, 14 Oct 2025 08:26:44 +0200 Subject: [PATCH 25/40] Postgres.jar URL umgezogen --- spec/acceptance/1_standalone_spec.rb | 2 +- spec/acceptance/3_recursive_resource_spec.rb | 2 +- spec/support/acceptance/test_data.rb | 1 + 3 files changed, 3 insertions(+), 2 deletions(-) diff --git a/spec/acceptance/1_standalone_spec.rb b/spec/acceptance/1_standalone_spec.rb index f0e58467..2d31d9cf 100644 --- a/spec/acceptance/1_standalone_spec.rb +++ b/spec/acceptance/1_standalone_spec.rb @@ -15,7 +15,7 @@ class { 'wildfly': wildfly::config::module { 'org.postgresql': # 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 => 'https://repo1.maven.org/maven2/org/postgresql/postgresql/9.3-1103-jdbc41/postgresql-9.3-1103-jdbc41.jar', + source => '#{test_data['postgres_jar_source']}', dependencies => ['javax.api', 'javax.transaction.api'] } -> diff --git a/spec/acceptance/3_recursive_resource_spec.rb b/spec/acceptance/3_recursive_resource_spec.rb index 81553b5f..2ff72007 100644 --- a/spec/acceptance/3_recursive_resource_spec.rb +++ b/spec/acceptance/3_recursive_resource_spec.rb @@ -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'], } -> diff --git a/spec/support/acceptance/test_data.rb b/spec/support/acceptance/test_data.rb index d2a1ab23..ff3754c6 100644 --- a/spec/support/acceptance/test_data.rb +++ b/spec/support/acceptance/test_data.rb @@ -32,6 +32,7 @@ def test_data 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') + data['postgres_jar_source'] = "https://repo1.maven.org/maven2/org/postgresql/postgresql/9.3-1103-jdbc41/postgresql-9.3-1103-jdbc41.jar" end data['java_home'] = `readlink /etc/alternatives/java`.gsub(%r{bin/java$}, '').strip From 0ae10a68d7310fd06e38cec7578cd8bca155d2af Mon Sep 17 00:00:00 2001 From: Marcus Poller Date: Tue, 14 Oct 2025 08:36:01 +0200 Subject: [PATCH 26/40] Alle WAR von central.maven.org nach repo1.maven.org umgezogen --- spec/acceptance/2_deployment_spec.rb | 4 ++-- spec/acceptance/4_domain_spec.rb | 2 +- spec/acceptance/5_domain_spec_custom_server_group.rb | 2 +- spec/support/acceptance/test_data.rb | 2 ++ 4 files changed, 6 insertions(+), 4 deletions(-) diff --git a/spec/acceptance/2_deployment_spec.rb b/spec/acceptance/2_deployment_spec.rb index da5d8325..1ce4a64f 100644 --- a/spec/acceptance/2_deployment_spec.rb +++ b/spec/acceptance/2_deployment_spec.rb @@ -14,11 +14,11 @@ 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 diff --git a/spec/acceptance/4_domain_spec.rb b/spec/acceptance/4_domain_spec.rb index f792f911..483a63cf 100644 --- a/spec/acceptance/4_domain_spec.rb +++ b/spec/acceptance/4_domain_spec.rb @@ -24,7 +24,7 @@ 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', } diff --git a/spec/acceptance/5_domain_spec_custom_server_group.rb b/spec/acceptance/5_domain_spec_custom_server_group.rb index d17ed044..67886721 100644 --- a/spec/acceptance/5_domain_spec_custom_server_group.rb +++ b/spec/acceptance/5_domain_spec_custom_server_group.rb @@ -20,7 +20,7 @@ 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', } diff --git a/spec/support/acceptance/test_data.rb b/spec/support/acceptance/test_data.rb index ff3754c6..250e6c99 100644 --- a/spec/support/acceptance/test_data.rb +++ b/spec/support/acceptance/test_data.rb @@ -33,6 +33,8 @@ def test_data 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') 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" end data['java_home'] = `readlink /etc/alternatives/java`.gsub(%r{bin/java$}, '').strip From 99367aa1fe86742f901c0f3cc2c4621b35aa97f5 Mon Sep 17 00:00:00 2001 From: Marcus Poller Date: Tue, 14 Oct 2025 08:43:58 +0200 Subject: [PATCH 27/40] fix: im case umgezogen --- spec/support/acceptance/test_data.rb | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/spec/support/acceptance/test_data.rb b/spec/support/acceptance/test_data.rb index 250e6c99..24340e4d 100644 --- a/spec/support/acceptance/test_data.rb +++ b/spec/support/acceptance/test_data.rb @@ -32,12 +32,12 @@ def test_data 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') - 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" end 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" puts "Debug: Test-Data" puts data.inspect From f73313d364e3e15679cb11b7269bc8caa25a6f6c Mon Sep 17 00:00:00 2001 From: Marcus Poller Date: Tue, 14 Oct 2025 09:44:27 +0200 Subject: [PATCH 28/40] mein Testfall --- spec/acceptance/6_uptodate_wildfly.rb | 76 +++++++++++++++++++++++++++ 1 file changed, 76 insertions(+) create mode 100644 spec/acceptance/6_uptodate_wildfly.rb diff --git a/spec/acceptance/6_uptodate_wildfly.rb b/spec/acceptance/6_uptodate_wildfly.rb new file mode 100644 index 00000000..5b8ea659 --- /dev/null +++ b/spec/acceptance/6_uptodate_wildfly.rb @@ -0,0 +1,76 @@ +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/' + +package {'java-17-openjdk.x86_64': + 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 => '/usr/lib/jvm/jre-17-openjdk', + 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 + apply_manifest(pp, :catch_failures => true, :acceptable_exit_codes => [0, 2]) + apply_manifest(pp, :catch_failures => true, :acceptable_exit_codes => [0]) + end + end +end From 9b4a49143a8f58cec402c13db04f56bac0944915 Mon Sep 17 00:00:00 2001 From: Marcus Poller Date: Tue, 14 Oct 2025 09:48:12 +0200 Subject: [PATCH 29/40] mein Testfall --- .../{6_uptodate_wildfly.rb => 0_uptodate_wildfly_spec.rb} | 0 1 file changed, 0 insertions(+), 0 deletions(-) rename spec/acceptance/{6_uptodate_wildfly.rb => 0_uptodate_wildfly_spec.rb} (100%) diff --git a/spec/acceptance/6_uptodate_wildfly.rb b/spec/acceptance/0_uptodate_wildfly_spec.rb similarity index 100% rename from spec/acceptance/6_uptodate_wildfly.rb rename to spec/acceptance/0_uptodate_wildfly_spec.rb From 5e197fda19fe51eb53acbe72ab1d3c1719651628 Mon Sep 17 00:00:00 2001 From: Marcus Poller Date: Tue, 14 Oct 2025 09:55:14 +0200 Subject: [PATCH 30/40] lint --- spec/acceptance/0_uptodate_wildfly_spec.rb | 126 ++++++++++----------- 1 file changed, 63 insertions(+), 63 deletions(-) diff --git a/spec/acceptance/0_uptodate_wildfly_spec.rb b/spec/acceptance/0_uptodate_wildfly_spec.rb index 5b8ea659..756a1429 100644 --- a/spec/acceptance/0_uptodate_wildfly_spec.rb +++ b/spec/acceptance/0_uptodate_wildfly_spec.rb @@ -1,69 +1,69 @@ 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' + Exec { + path => $facts['path'], } -$_service_name = 'very-buggy-server' -$_uid = '1000' -$_user = 'wildfly' -$link_name = '/home/wildfly/' - -package {'java-17-openjdk.x86_64': - 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 => '/usr/lib/jvm/jre-17-openjdk', - 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', -} + + # 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/' + + package {'java-17-openjdk.x86_64': + 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 => '/usr/lib/jvm/jre-17-openjdk', + 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 @@ -71,6 +71,6 @@ it 'applies the manfest without error, idempotently' do apply_manifest(pp, :catch_failures => true, :acceptable_exit_codes => [0, 2]) apply_manifest(pp, :catch_failures => true, :acceptable_exit_codes => [0]) - end + end end end From a8793178bf09d5205ef1bbb529c133ee29a3132f Mon Sep 17 00:00:00 2001 From: Marcus Poller Date: Tue, 14 Oct 2025 10:27:23 +0200 Subject: [PATCH 31/40] bifurication --- .../{1_standalone_spec.rb => 1_standalone_sp_disabled_ec.rb} | 2 ++ .../{2_deployment_spec.rb => 2_deployment_sp_disabled_ec.rb} | 0 ..._resource_spec.rb => 3_recursive_resource_sp_disabled_ec.rb} | 0 .../acceptance/{4_domain_spec.rb => 4_domain_sp_disabled_ec.rb} | 0 4 files changed, 2 insertions(+) rename spec/acceptance/{1_standalone_spec.rb => 1_standalone_sp_disabled_ec.rb} (98%) rename spec/acceptance/{2_deployment_spec.rb => 2_deployment_sp_disabled_ec.rb} (100%) rename spec/acceptance/{3_recursive_resource_spec.rb => 3_recursive_resource_sp_disabled_ec.rb} (100%) rename spec/acceptance/{4_domain_spec.rb => 4_domain_sp_disabled_ec.rb} (100%) diff --git a/spec/acceptance/1_standalone_spec.rb b/spec/acceptance/1_standalone_sp_disabled_ec.rb similarity index 98% rename from spec/acceptance/1_standalone_spec.rb rename to spec/acceptance/1_standalone_sp_disabled_ec.rb index 2d31d9cf..cf706d81 100644 --- a/spec/acceptance/1_standalone_spec.rb +++ b/spec/acceptance/1_standalone_sp_disabled_ec.rb @@ -58,6 +58,8 @@ class { 'wildfly': } EOS + 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') diff --git a/spec/acceptance/2_deployment_spec.rb b/spec/acceptance/2_deployment_sp_disabled_ec.rb similarity index 100% rename from spec/acceptance/2_deployment_spec.rb rename to spec/acceptance/2_deployment_sp_disabled_ec.rb diff --git a/spec/acceptance/3_recursive_resource_spec.rb b/spec/acceptance/3_recursive_resource_sp_disabled_ec.rb similarity index 100% rename from spec/acceptance/3_recursive_resource_spec.rb rename to spec/acceptance/3_recursive_resource_sp_disabled_ec.rb diff --git a/spec/acceptance/4_domain_spec.rb b/spec/acceptance/4_domain_sp_disabled_ec.rb similarity index 100% rename from spec/acceptance/4_domain_spec.rb rename to spec/acceptance/4_domain_sp_disabled_ec.rb From 57285bd3d9fe858abe90fb4190457c0b2e70d497 Mon Sep 17 00:00:00 2001 From: Marcus Poller Date: Tue, 14 Oct 2025 11:47:28 +0200 Subject: [PATCH 32/40] rubocop --- spec/acceptance/0_uptodate_wildfly_spec.rb | 6 +++--- spec/acceptance/4_domain_sp_disabled_ec.rb | 13 +++++++------ 2 files changed, 10 insertions(+), 9 deletions(-) diff --git a/spec/acceptance/0_uptodate_wildfly_spec.rb b/spec/acceptance/0_uptodate_wildfly_spec.rb index 756a1429..847359c1 100644 --- a/spec/acceptance/0_uptodate_wildfly_spec.rb +++ b/spec/acceptance/0_uptodate_wildfly_spec.rb @@ -66,11 +66,11 @@ } EOP -describe "up to date wildfly without any frills" do +describe 'up to date wildfly without any frills' do context 'it installs at least once' do it 'applies the manfest without error, idempotently' do - apply_manifest(pp, :catch_failures => true, :acceptable_exit_codes => [0, 2]) - apply_manifest(pp, :catch_failures => true, :acceptable_exit_codes => [0]) + apply_manifest(pp, catch_failures: true, acceptable_exit_codes: [0, 2]) + apply_manifest(pp, catch_failures: true, catch_changes: true, acceptable_exit_codes: [0]) end end end diff --git a/spec/acceptance/4_domain_sp_disabled_ec.rb b/spec/acceptance/4_domain_sp_disabled_ec.rb index 483a63cf..d4c3b51e 100644 --- a/spec/acceptance/4_domain_sp_disabled_ec.rb +++ b/spec/acceptance/4_domain_sp_disabled_ec.rb @@ -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'", From 32d5378ecbff67a63980998a287d2a425b16cfdd Mon Sep 17 00:00:00 2001 From: Marcus Poller Date: Tue, 14 Oct 2025 11:54:29 +0200 Subject: [PATCH 33/40] Cannot specify more than one of `catch_failures`, `catch_changes`, `expect_failures`, or `expect_changes` for a single manifest --- spec/acceptance/0_uptodate_wildfly_spec.rb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/spec/acceptance/0_uptodate_wildfly_spec.rb b/spec/acceptance/0_uptodate_wildfly_spec.rb index 847359c1..5048a384 100644 --- a/spec/acceptance/0_uptodate_wildfly_spec.rb +++ b/spec/acceptance/0_uptodate_wildfly_spec.rb @@ -70,7 +70,7 @@ context 'it installs at least once' do it 'applies the manfest without error, idempotently' do apply_manifest(pp, catch_failures: true, acceptable_exit_codes: [0, 2]) - apply_manifest(pp, catch_failures: true, catch_changes: true, acceptable_exit_codes: [0]) + apply_manifest(pp, catch_changes: true, acceptable_exit_codes: [0]) end end end From 50390ab14354f4c39e38c8a367c5f9c31c96c567 Mon Sep 17 00:00:00 2001 From: Marcus Poller Date: Tue, 14 Oct 2025 12:08:35 +0200 Subject: [PATCH 34/40] java package name --- spec/acceptance/0_uptodate_wildfly_spec.rb | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/spec/acceptance/0_uptodate_wildfly_spec.rb b/spec/acceptance/0_uptodate_wildfly_spec.rb index 5048a384..f5b7bfe1 100644 --- a/spec/acceptance/0_uptodate_wildfly_spec.rb +++ b/spec/acceptance/0_uptodate_wildfly_spec.rb @@ -23,7 +23,13 @@ $_user = 'wildfly' $link_name = '/home/wildfly/' - package {'java-17-openjdk.x86_64': + if $facter['os']['family'] == 'Debian' { + $javapkg = 'openjdk-17-jdk' + } else { + $javapkg = java-17-openjdk.x86_64' + } + + package { $javapkg: ensure => present, } -> From 61573a0c3c5252c3cffff4fffbb69d2156cad283 Mon Sep 17 00:00:00 2001 From: Marcus Poller Date: Tue, 14 Oct 2025 12:11:19 +0200 Subject: [PATCH 35/40] java package name --- spec/acceptance/0_uptodate_wildfly_spec.rb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/spec/acceptance/0_uptodate_wildfly_spec.rb b/spec/acceptance/0_uptodate_wildfly_spec.rb index f5b7bfe1..3737efd5 100644 --- a/spec/acceptance/0_uptodate_wildfly_spec.rb +++ b/spec/acceptance/0_uptodate_wildfly_spec.rb @@ -26,7 +26,7 @@ if $facter['os']['family'] == 'Debian' { $javapkg = 'openjdk-17-jdk' } else { - $javapkg = java-17-openjdk.x86_64' + $javapkg = 'java-17-openjdk.x86_64' } package { $javapkg: From 36a49b9e93cb6106098df8893fc2241b23d1a8e9 Mon Sep 17 00:00:00 2001 From: Marcus Poller Date: Tue, 14 Oct 2025 12:38:42 +0200 Subject: [PATCH 36/40] typo --- spec/acceptance/0_uptodate_wildfly_spec.rb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/spec/acceptance/0_uptodate_wildfly_spec.rb b/spec/acceptance/0_uptodate_wildfly_spec.rb index 3737efd5..1f66cb2e 100644 --- a/spec/acceptance/0_uptodate_wildfly_spec.rb +++ b/spec/acceptance/0_uptodate_wildfly_spec.rb @@ -23,7 +23,7 @@ $_user = 'wildfly' $link_name = '/home/wildfly/' - if $facter['os']['family'] == 'Debian' { + if $facts['os']['family'] == 'Debian' { $javapkg = 'openjdk-17-jdk' } else { $javapkg = 'java-17-openjdk.x86_64' From f8993b65c814f8b51303c47e87bb3b76e8ba8ab8 Mon Sep 17 00:00:00 2001 From: Marcus Poller Date: Wed, 15 Oct 2025 13:22:17 +0200 Subject: [PATCH 37/40] conditional java home --- spec/acceptance/0_uptodate_wildfly_spec.rb | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/spec/acceptance/0_uptodate_wildfly_spec.rb b/spec/acceptance/0_uptodate_wildfly_spec.rb index 1f66cb2e..2ec983aa 100644 --- a/spec/acceptance/0_uptodate_wildfly_spec.rb +++ b/spec/acceptance/0_uptodate_wildfly_spec.rb @@ -25,8 +25,10 @@ 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: @@ -56,7 +58,7 @@ group => $_user, install_cache_dir => '/tmp/wildfly/', install_source => $_install_source_gitlab_issue_355, - java_home => '/usr/lib/jvm/jre-17-openjdk', + java_home => $java_home, java_opts => undef, java_maxmetaspace_size => '2048m', java_xms => '128M', From c08cf1a1a3a36b603d3028f8fdee0823f80880ef Mon Sep 17 00:00:00 2001 From: Marcus Poller Date: Wed, 15 Oct 2025 13:35:42 +0200 Subject: [PATCH 38/40] JAVA_HOME --- spec/acceptance/0_uptodate_wildfly_spec.rb | 2 +- spec/support/acceptance/test_data.rb | 1 + 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/spec/acceptance/0_uptodate_wildfly_spec.rb b/spec/acceptance/0_uptodate_wildfly_spec.rb index 2ec983aa..2250cde6 100644 --- a/spec/acceptance/0_uptodate_wildfly_spec.rb +++ b/spec/acceptance/0_uptodate_wildfly_spec.rb @@ -58,7 +58,7 @@ group => $_user, install_cache_dir => '/tmp/wildfly/', install_source => $_install_source_gitlab_issue_355, - java_home => $java_home, + java_home => $javahome, java_opts => undef, java_maxmetaspace_size => '2048m', java_xms => '128M', diff --git a/spec/support/acceptance/test_data.rb b/spec/support/acceptance/test_data.rb index 24340e4d..4eef4a9e 100644 --- a/spec/support/acceptance/test_data.rb +++ b/spec/support/acceptance/test_data.rb @@ -38,6 +38,7 @@ def test_data 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 From ca9519f703a0a91eafce44f7a65b946001f1a15e Mon Sep 17 00:00:00 2001 From: Marcus Poller Date: Wed, 15 Oct 2025 14:15:07 +0200 Subject: [PATCH 39/40] x --- spec/acceptance/1_standalone_wildfly_spec.rb | 79 ++++++++++++++++++++ 1 file changed, 79 insertions(+) create mode 100644 spec/acceptance/1_standalone_wildfly_spec.rb diff --git a/spec/acceptance/1_standalone_wildfly_spec.rb b/spec/acceptance/1_standalone_wildfly_spec.rb new file mode 100644 index 00000000..a2356fb0 --- /dev/null +++ b/spec/acceptance/1_standalone_wildfly_spec.rb @@ -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 'up to date wildfly without any frills' do + context 'it installs at least once' do + it 'applies the manfest without error, idempotently' do + apply_manifest(pp, catch_failures: true, acceptable_exit_codes: [0, 2]) + apply_manifest(pp, catch_changes: true, acceptable_exit_codes: [0]) + end + end +end From 5a33e4871570720a58a0cdefe6a76163a8856187 Mon Sep 17 00:00:00 2001 From: Marcus Poller Date: Wed, 15 Oct 2025 14:20:24 +0200 Subject: [PATCH 40/40] distinguish test cases --- spec/acceptance/1_standalone_wildfly_spec.rb | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/spec/acceptance/1_standalone_wildfly_spec.rb b/spec/acceptance/1_standalone_wildfly_spec.rb index a2356fb0..4206a2e9 100644 --- a/spec/acceptance/1_standalone_wildfly_spec.rb +++ b/spec/acceptance/1_standalone_wildfly_spec.rb @@ -69,8 +69,8 @@ } EOP -describe 'up to date wildfly without any frills' do - context 'it installs at least once' do +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 apply_manifest(pp, catch_failures: true, acceptable_exit_codes: [0, 2]) apply_manifest(pp, catch_changes: true, acceptable_exit_codes: [0])