Skip to content

Commit 561e833

Browse files
committed
fix acceptance tests
1 parent 468caae commit 561e833

File tree

2 files changed

+65
-31
lines changed

2 files changed

+65
-31
lines changed

spec/acceptance/default_parameters_spec.rb

Lines changed: 26 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -15,17 +15,27 @@
1515
'Debian' => '/usr/lib/jvm/java-1.11.0-openjdk-amd64',
1616
}
1717
18-
class { 'postgresql::server': }
18+
# The output of `systemctl status postgresql` is non ascii which
19+
# breaks the Exec in Postgresql::Server::Instance::Reload
20+
# on rhel based docker containers
21+
# We don't need the output.
22+
class { 'postgresql::server':
23+
service_status => 'systemctl status postgresql > /dev/null'
24+
}
1925
2026
postgresql::server::db { 'jira':
2127
user => 'jiraadm',
2228
password => postgresql::postgresql_password('jiraadm', 'mypassword'),
2329
}
2430
31+
# There is a bug in the check-java.sh that prevents jira from starting on Centos Stream 8
32+
# https://jira.atlassian.com/browse/JRASERVER-77097
33+
# Running with script_check_java_manage => true to solve this
2534
class { 'jira':
26-
java_package => $java_package,
27-
javahome => $java_home,
28-
require => Postgresql::Server::Db['jira'],
35+
java_package => $java_package,
36+
javahome => $java_home,
37+
script_check_java_manage => true,
38+
require => Postgresql::Server::Db['jira'],
2939
}
3040
EOS
3141
pp_upgrade = <<-EOS
@@ -40,9 +50,10 @@ class { 'jira':
4050
}
4151
4252
class { 'jira':
43-
version => '8.16.0',
44-
java_package => $java_package,
45-
javahome => $java_home,
53+
version => '8.16.0',
54+
java_package => $java_package,
55+
javahome => $java_home,
56+
script_check_java_manage => true,
4657
}
4758
EOS
4859

@@ -53,14 +64,16 @@ class { 'jira':
5364
shell wget_cmd, acceptable_exit_codes: [0, 8]
5465
sleep SLEEP_SECONDS
5566
shell wget_cmd, acceptable_exit_codes: [0, 8]
56-
sleep SLEEP_SECONDS
67+
68+
apply_manifest(pp, catch_changes: true)
69+
5770
apply_manifest(pp_upgrade, catch_failures: true)
5871
sleep SLEEP_SECONDS
5972
shell wget_cmd, acceptable_exit_codes: [0, 8]
6073
sleep SLEEP_SECONDS
6174
shell wget_cmd, acceptable_exit_codes: [0, 8]
62-
sleep SLEEP_SECONDS
63-
apply_manifest(pp_upgrade, catch_failures: true)
75+
76+
apply_manifest(pp_upgrade, catch_changes: true)
6477
end
6578

6679
describe process('java') do
@@ -76,10 +89,9 @@ class { 'jira':
7689
it { is_expected.to be_running }
7790
end
7891

79-
specify do
80-
expect(user('jira')).to exist.
81-
and belong_to_group 'jira'.
82-
and have_login_shell '/bin/true'
92+
describe user('jira') do
93+
it { is_expected.to belong_to_group 'jira' }
94+
it { is_expected.to have_login_shell '/bin/true' }
8395
end
8496

8597
describe command('wget -q --tries=24 --retry-connrefused --read-timeout=10 -O- localhost:8080') do

spec/acceptance/mysql_spec.rb

Lines changed: 39 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -5,8 +5,27 @@
55
describe 'jira mysql' do
66
it 'installs with defaults' do
77
pp = <<-EOS
8+
# On ubuntu 20.04 and 22.04 the default is to install mariadb
9+
# As the ubuntu 20.04 runner we use in github actions allready has mysql installed
10+
# a apparmor error is triggerd when using mariadb in this test..
11+
# Forcing the use of mysql
12+
if $facts['os']['name'] == 'Ubuntu' and versioncmp($facts['os']['release']['major'], '20.04') >= 0 {
13+
$mysql_service_name = 'mysql'
14+
$mysql_server_package = 'mysql-server'
15+
$mysql_client_package = 'mysql-client'
16+
} else {
17+
$mysql_service_name = undef
18+
$mysql_server_package = undef
19+
$mysql_client_package = undef
20+
}
21+
822
class { 'mysql::server':
923
root_password => 'strongpassword',
24+
package_name => $mysql_server_package,
25+
service_name => $mysql_service_name,
26+
}
27+
class { 'mysql::client':
28+
package_name => $mysql_client_package,
1029
}
1130
1231
# Default MySQL is too old for utf8mb4 on CentOS 7, or something. Also Ubuntu 20.04
@@ -46,19 +65,23 @@ class { 'java':
4665
require => Exec['tmpkey'],
4766
}
4867
68+
# There is a bug in the check-java.sh that prevents jira from starting on Centos Stream 8
69+
# https://jira.atlassian.com/browse/JRASERVER-77097
70+
# Running with script_check_java_manage => true to solve this
4971
class { 'jira':
50-
installdir => '/opt/atlassian-jira',
51-
homedir => '/opt/jira-home',
52-
javahome => '/usr',
53-
jvm_type => 'oracle-jdk-1.8',
54-
db => 'mysql',
55-
dbport => 3306,
56-
dbdriver => 'com.mysql.jdbc.Driver',
57-
dbtype => 'mysql',
58-
tomcat_port => 8081,
59-
tomcat_native_ssl => true,
60-
tomcat_keystore_file => '/tmp/jira.ks',
61-
require => [Mysql::Db['jira'], Java_ks['jira']],
72+
installdir => '/opt/atlassian-jira',
73+
homedir => '/opt/jira-home',
74+
javahome => '/usr',
75+
jvm_type => 'oracle-jdk-1.8',
76+
db => 'mysql',
77+
dbport => 3306,
78+
dbdriver => 'com.mysql.jdbc.Driver',
79+
dbtype => 'mysql',
80+
tomcat_port => 8081,
81+
tomcat_native_ssl => true,
82+
tomcat_keystore_file => '/tmp/jira.ks',
83+
script_check_java_manage => true,
84+
require => [Mysql::Db['jira'], Java_ks['jira']],
6285
}
6386
EOS
6487

@@ -68,7 +91,7 @@ class { 'jira':
6891
shell wget_cmd, acceptable_exit_codes: [0, 8]
6992
sleep SLEEP_SECONDS
7093
shell wget_cmd, acceptable_exit_codes: [0, 8]
71-
sleep SLEEP_SECONDS
94+
7295
apply_manifest(pp, catch_changes: true)
7396
end
7497

@@ -85,10 +108,9 @@ class { 'jira':
85108
it { is_expected.to be_running }
86109
end
87110

88-
specify do
89-
expect(user('jira')).to exist.
90-
and belong_to_group 'jira'.
91-
and have_login_shell '/bin/true'
111+
describe user('jira') do
112+
it { is_expected.to belong_to_group 'jira' }
113+
it { is_expected.to have_login_shell '/bin/true' }
92114
end
93115

94116
specify do

0 commit comments

Comments
 (0)