Skip to content

Commit

Permalink
print mysql error.log
Browse files Browse the repository at this point in the history
  • Loading branch information
h-haaks committed Feb 7, 2024
1 parent bb0dcc7 commit 632e297
Show file tree
Hide file tree
Showing 2 changed files with 191 additions and 190 deletions.
204 changes: 102 additions & 102 deletions spec/acceptance/default_parameters_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -2,105 +2,105 @@

require 'spec_helper_acceptance'

describe 'jira postgresql' do
it 'installs with defaults' do
pp = <<-EOS
$java_package = $facts['os']['family'] ? {
'RedHat' => 'java-11-openjdk-headless',
'Debian' => 'openjdk-11-jre-headless',
}
$java_home = $facts['os']['family'] ? {
'RedHat' => '/usr/lib/jvm/jre-11-openjdk',
'Debian' => '/usr/lib/jvm/java-1.11.0-openjdk-amd64',
}
# 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,
script_check_java_manage => true,
require => Postgresql::Server::Db['jira'],
}
EOS
pp_upgrade = <<-EOS
$java_package = $facts['os']['family'] ? {
'RedHat' => 'java-11-openjdk-headless',
'Debian' => 'openjdk-11-jre-headless',
}
$java_home = $facts['os']['family'] ? {
'RedHat' => '/usr/lib/jvm/jre-11-openjdk',
'Debian' => '/usr/lib/jvm/java-1.11.0-openjdk-amd64',
}
class { 'jira':
version => '8.16.0',
java_package => $java_package,
javahome => $java_home,
script_check_java_manage => true,
}
EOS

# jira just takes *ages* to start up :-(
wget_cmd = 'wget -q --tries=24 --retry-connrefused --read-timeout=10 localhost:8080'
apply_manifest(pp, 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]

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]

apply_manifest(pp_upgrade, catch_changes: true)
end

describe process('java') do
it { is_expected.to be_running }
end

describe port(8080) do
it { is_expected.to be_listening }
end

describe service('jira') do
it { is_expected.to be_enabled }
it { is_expected.to be_running }
end

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
its(:stdout) { is_expected.to include('8.16.0') }
end

describe 'shutdown' do
it { shell('service jira stop', acceptable_exit_codes: [0, 1]) }
it { shell('pkill -9 -f postgres', acceptable_exit_codes: [0, 1]) }
it { shell('pkill -9 -f jira', acceptable_exit_codes: [0, 1]) }
end
end
# describe 'jira postgresql' do
# it 'installs with defaults' do
# pp = <<-EOS
# $java_package = $facts['os']['family'] ? {
# 'RedHat' => 'java-11-openjdk-headless',
# 'Debian' => 'openjdk-11-jre-headless',
# }

# $java_home = $facts['os']['family'] ? {
# 'RedHat' => '/usr/lib/jvm/jre-11-openjdk',
# 'Debian' => '/usr/lib/jvm/java-1.11.0-openjdk-amd64',
# }

# # 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,
# script_check_java_manage => true,
# require => Postgresql::Server::Db['jira'],
# }
# EOS
# pp_upgrade = <<-EOS
# $java_package = $facts['os']['family'] ? {
# 'RedHat' => 'java-11-openjdk-headless',
# 'Debian' => 'openjdk-11-jre-headless',
# }

# $java_home = $facts['os']['family'] ? {
# 'RedHat' => '/usr/lib/jvm/jre-11-openjdk',
# 'Debian' => '/usr/lib/jvm/java-1.11.0-openjdk-amd64',
# }

# class { 'jira':
# version => '8.16.0',
# java_package => $java_package,
# javahome => $java_home,
# script_check_java_manage => true,
# }
# EOS

# # jira just takes *ages* to start up :-(
# wget_cmd = 'wget -q --tries=24 --retry-connrefused --read-timeout=10 localhost:8080'
# apply_manifest(pp, 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]

# 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]

# apply_manifest(pp_upgrade, catch_changes: true)
# end

# describe process('java') do
# it { is_expected.to be_running }
# end

# describe port(8080) do
# it { is_expected.to be_listening }
# end

# describe service('jira') do
# it { is_expected.to be_enabled }
# it { is_expected.to be_running }
# end

# 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
# its(:stdout) { is_expected.to include('8.16.0') }
# end

# describe 'shutdown' do
# it { shell('service jira stop', acceptable_exit_codes: [0, 1]) }
# it { shell('pkill -9 -f postgres', acceptable_exit_codes: [0, 1]) }
# it { shell('pkill -9 -f jira', acceptable_exit_codes: [0, 1]) }
# end
# end
Loading

0 comments on commit 632e297

Please sign in to comment.