diff --git a/spec/acceptance/default_parameters_spec.rb b/spec/acceptance/default_parameters_spec.rb index f03a4e04..3923b90c 100644 --- a/spec/acceptance/default_parameters_spec.rb +++ b/spec/acceptance/default_parameters_spec.rb @@ -15,17 +15,27 @@ 'Debian' => '/usr/lib/jvm/java-1.11.0-openjdk-amd64', } - class { 'postgresql::server': } + # The output of `systemctl status postgresql` is non ascii which + # breaks the Exec in Postgresql::Server::Instance::Reload + # on rhel based docker containers + # We don't need the output. + class { 'postgresql::server': + service_status => 'systemctl status postgresql > /dev/null' + } postgresql::server::db { 'jira': user => 'jiraadm', password => postgresql::postgresql_password('jiraadm', 'mypassword'), } + # There is a bug in the check-java.sh that prevents jira from starting on Centos Stream 8 + # https://jira.atlassian.com/browse/JRASERVER-77097 + # Running with script_check_java_manage => true to solve this class { 'jira': - java_package => $java_package, - javahome => $java_home, - require => Postgresql::Server::Db['jira'], + java_package => $java_package, + javahome => $java_home, + script_check_java_manage => true, + require => Postgresql::Server::Db['jira'], } EOS pp_upgrade = <<-EOS @@ -40,9 +50,10 @@ class { 'jira': } class { 'jira': - version => '8.16.0', - java_package => $java_package, - javahome => $java_home, + version => '8.16.0', + java_package => $java_package, + javahome => $java_home, + script_check_java_manage => true, } EOS @@ -53,14 +64,16 @@ class { 'jira': shell wget_cmd, acceptable_exit_codes: [0, 8] sleep SLEEP_SECONDS shell wget_cmd, acceptable_exit_codes: [0, 8] - sleep SLEEP_SECONDS + + apply_manifest(pp, catch_changes: true) + apply_manifest(pp_upgrade, catch_failures: true) sleep SLEEP_SECONDS shell wget_cmd, acceptable_exit_codes: [0, 8] sleep SLEEP_SECONDS shell wget_cmd, acceptable_exit_codes: [0, 8] - sleep SLEEP_SECONDS - apply_manifest(pp_upgrade, catch_failures: true) + + apply_manifest(pp_upgrade, catch_changes: true) end describe process('java') do @@ -76,10 +89,9 @@ class { 'jira': it { is_expected.to be_running } end - specify do - expect(user('jira')).to exist. - and belong_to_group 'jira'. - and have_login_shell '/bin/true' + describe user('jira') do + it { is_expected.to belong_to_group 'jira' } + it { is_expected.to have_login_shell '/bin/true' } end describe command('wget -q --tries=24 --retry-connrefused --read-timeout=10 -O- localhost:8080') do diff --git a/spec/acceptance/mysql_spec.rb b/spec/acceptance/mysql_spec.rb index b286e299..d11aac12 100644 --- a/spec/acceptance/mysql_spec.rb +++ b/spec/acceptance/mysql_spec.rb @@ -46,19 +46,23 @@ class { 'java': require => Exec['tmpkey'], } + # There is a bug in the check-java.sh that prevents jira from starting on Centos Stream 8 + # https://jira.atlassian.com/browse/JRASERVER-77097 + # Running with script_check_java_manage => true to solve this class { 'jira': - installdir => '/opt/atlassian-jira', - homedir => '/opt/jira-home', - javahome => '/usr', - jvm_type => 'oracle-jdk-1.8', - db => 'mysql', - dbport => 3306, - dbdriver => 'com.mysql.jdbc.Driver', - dbtype => 'mysql', - tomcat_port => 8081, - tomcat_native_ssl => true, - tomcat_keystore_file => '/tmp/jira.ks', - require => [Mysql::Db['jira'], Java_ks['jira']], + installdir => '/opt/atlassian-jira', + homedir => '/opt/jira-home', + javahome => '/usr', + jvm_type => 'oracle-jdk-1.8', + db => 'mysql', + dbport => 3306, + dbdriver => 'com.mysql.jdbc.Driver', + dbtype => 'mysql', + tomcat_port => 8081, + tomcat_native_ssl => true, + tomcat_keystore_file => '/tmp/jira.ks', + script_check_java_manage => true, + require => [Mysql::Db['jira'], Java_ks['jira']], } EOS @@ -68,7 +72,7 @@ class { 'jira': shell wget_cmd, acceptable_exit_codes: [0, 8] sleep SLEEP_SECONDS shell wget_cmd, acceptable_exit_codes: [0, 8] - sleep SLEEP_SECONDS + apply_manifest(pp, catch_changes: true) end @@ -85,10 +89,9 @@ class { 'jira': it { is_expected.to be_running } end - specify do - expect(user('jira')).to exist. - and belong_to_group 'jira'. - and have_login_shell '/bin/true' + describe user('jira') do + it { is_expected.to belong_to_group 'jira' } + it { is_expected.to have_login_shell '/bin/true' } end specify do