Skip to content

Commit

Permalink
Fix installation and testing on Ubuntu 18.04 bionic, EL7, Fedora and (#…
Browse files Browse the repository at this point in the history
…571)

Opensuse
Also:
- attempt to fix many of the tests that run in travis-ci
- Fix seemingly all the systemd-based installations by not deleting the default my.cnf file
- rename the mysql_test cookbook to test
- fix many test failures on fedora, rhel7 and opensuse
- rebase and squash a dozen different commits into one

Signed-off-by: Irving Popovetsky <[email protected]>
  • Loading branch information
Irving Popovetsky authored and damacus committed Jul 30, 2018
1 parent 5e5784c commit d53a05f
Show file tree
Hide file tree
Showing 23 changed files with 136 additions and 155 deletions.
67 changes: 43 additions & 24 deletions .kitchen.yml
Original file line number Diff line number Diff line change
@@ -1,6 +1,9 @@
<%
dists_with_56 = %w(centos-6 centos-7 fedora-28 ubuntu-14.04 opensuse-leap amazon-linux)
dists_with_57 = %w(centos-6 centos-7 fedora-28 ubuntu-16.04)
yum_dists_with_56 = %w(centos-6 centos-7 fedora-28 amazon-linux)
suse_dists_with_56 = %w(opensuse-leap)
apt_dists_with_56 = %w(ubuntu-14.04)
yum_dists_with_57 = %w(centos-6 centos-7 fedora-28 fedora-latest)
apt_dists_with_57 = %w(ubuntu-16.04 ubuntu-18.04)
%>
---
driver:
Expand Down Expand Up @@ -36,78 +39,94 @@ suites:
#
- name: installation_client_package-56
run_list:
- recipe[mysql_test::installation_client]
- recipe[test::installation_client]
attributes:
mysql:
version: '5.6'
includes: <%= dists_with_56 %>
includes: <%= apt_dists_with_56 %>

- name: installation_client_package-57
run_list:
- recipe[mysql_test::installation_client]
- recipe[test::installation_client]
attributes:
mysql:
version: '5.7'
includes: <%= dists_with_57 %>
includes: <%= apt_dists_with_57 %>

- name: installation_client_package-56-yum
run_list:
- recipe[selinux::disabled]
- recipe[mysql_test::yum_repo]
- recipe[mysql_test::installation_client]
- recipe[test::yum_repo]
- recipe[test::installation_client]
attributes:
mysql:
version: '5.6'
includes: <%= dists_with_56 %>
includes: <%= yum_dists_with_56 %>

- name: installation_client_package-56-suse
run_list:
- recipe[test::yum_repo]
- recipe[test::installation_client]
attributes:
mysql:
version: '5.6'
includes: <%= suse_dists_with_56 %>

- name: installation_client_package-57-yum
run_list:
- recipe[selinux::disabled]
- recipe[mysql_test::yum_repo]
- recipe[mysql_test::installation_client]
- recipe[test::yum_repo]
- recipe[test::installation_client]
attributes:
mysql:
version: '5.7'
includes: <%= dists_with_57 %>
includes: <%= yum_dists_with_57 %>

#
# server smoke
#

- name: smoke56
run_list:
- recipe[mysql_test::smoke]
- recipe[test::smoke]
attributes:
mysql:
version: '5.6'
includes: <%= dists_with_56 %>
includes: <%= apt_dists_with_56 %>

- name: smoke57
run_list:
- recipe[mysql_test::smoke]
- recipe[selinux::disabled]
- recipe[mysql_test::yum_repo]
- recipe[test::smoke]
attributes:
mysql:
version: '5.7'
includes: <%= dists_with_57 %>
includes: <%= apt_dists_with_57 %>

- name: smoke56-yum
run_list:
- recipe[selinux::disabled]
- recipe[mysql_test::yum_repo]
- recipe[mysql_test::smoke]
- recipe[test::yum_repo]
- recipe[test::smoke]
attributes:
mysql:
version: '5.6'
includes: <%= yum_dists_with_56 %>

- name: smoke56-suse
run_list:
- recipe[test::yum_repo]
- recipe[test::smoke]
attributes:
mysql:
version: '5.6'
includes: <%= dists_with_56 %>
includes: <%= suse_dists_with_56 %>

- name: smoke57-yum
run_list:
- recipe[selinux::disabled]
- recipe[mysql_test::yum_repo]
- recipe[mysql_test::smoke]
- recipe[test::yum_repo]
- recipe[test::smoke]
attributes:
mysql:
version: '5.7'
includes: <%= dists_with_57 %>
includes: <%= yum_dists_with_57 %>
32 changes: 12 additions & 20 deletions .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -21,30 +21,22 @@ env:
- KITCHEN_YAML=.kitchen.yml
- KITCHEN_LOCAL_YAML=.kitchen.dokken.yml
matrix:
- INSTANCE=smoke51-centos-6
- INSTANCE=smoke55-yum-centos-6
- INSTANCE=smoke55-yum-centos-7
- INSTANCE=smoke55-debian-8
- INSTANCE=smoke55-ubuntu-1404
- INSTANCE=smoke56-yum-centos-6
- INSTANCE=smoke56-yum-centos-7
- INSTANCE=smoke56-ubuntu-1404
- INSTANCE=smoke56-opensuse-leap
- INSTANCE=smoke57-yum-centos-6
- INSTANCE=smoke57-yum-centos-7
- INSTANCE=smoke57-ubuntu-1604
- INSTANCE=installation-client-package-51-centos-6
- INSTANCE=installation-client-package-55-yum-centos-6
- INSTANCE=installation-client-package-55-yum-centos-7
- INSTANCE=installation-client-package-55-debian-8
- INSTANCE=installation-client-package-55-ubuntu-1404
- INSTANCE=installation-client-package-57-ubuntu-1604
- INSTANCE=installation-client-package-57-ubuntu-1804
- INSTANCE=installation-client-package-56-yum-centos-6
- INSTANCE=installation-client-package-56-yum-centos-7
- INSTANCE=installation-client-package-56-ubuntu-1404
- INSTANCE=installation-client-package-56-opensuse-leap
- INSTANCE=installation-client-package-56-suse-opensuse-leap
- INSTANCE=installation-client-package-57-yum-centos-6
- INSTANCE=installation-client-package-57-yum-centos-7
- INSTANCE=installation-client-package-57-ubuntu-1604
- INSTANCE=installation-client-package-57-yum-fedora-latest
- INSTANCE=smoke57-ubuntu-1604
- INSTANCE=smoke57-ubuntu-1804
- INSTANCE=smoke56-yum-centos-6
- INSTANCE=smoke56-yum-centos-7
- INSTANCE=smoke56-suse-opensuse-leap
- INSTANCE=smoke57-yum-centos-6
- INSTANCE=smoke57-yum-centos-7
- INSTANCE=smoke57-yum-fedora-latest

before_script:
- sudo iptables -L DOCKER || ( echo "DOCKER iptables chain missing" ; sudo iptables -N DOCKER )
Expand Down
30 changes: 25 additions & 5 deletions libraries/helpers.rb
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,16 @@ def el7?
false
end

def fedora?
return true if node['platform_family'] == 'fedora'
false
end

def suse?
return true if node['platform_family'] == 'suse'
false
end

def jessie?
return true if node['platform'] == 'debian' && node['platform_version'].to_i == 8
false
Expand Down Expand Up @@ -58,7 +68,7 @@ def default_pid_file

def default_major_version
# rhelish
return '5.1' if el6?
return '5.6' if el6?
return '5.6' if el7?
return '5.6' if node['platform'] == 'amazon'

Expand All @@ -68,11 +78,12 @@ def default_major_version
# ubuntu
return '5.5' if trusty?
return '5.7' if xenial?
return '5.7' if bionic?

# misc
return '5.6' if node['platform'] == 'freebsd'
return '5.6' if node['platform'] == 'fedora'
return '5.6' if node['platform_family'] == 'suse'
return '5.7' if fedora?
return '5.6' if suse?
end

def major_from_full(v)
Expand Down Expand Up @@ -268,13 +279,22 @@ def mysqladmin_bin
def mysqld_bin
return "#{prefix_dir}/libexec/mysqld" if node['platform_family'] == 'smartos'
return "#{base_dir}/bin/mysqld" if node['platform_family'] == 'omnios'
return '/usr/sbin/mysqld' if node['platform_family'] == 'fedora' && v56plus
return '/usr/libexec/mysqld' if node['platform_family'] == 'fedora'
return '/usr/sbin/mysqld' if fedora? && v56plus
return '/usr/libexec/mysqld' if fedora?
return 'mysqld' if scl_package?
"#{prefix_dir}/usr/sbin/mysqld"
end

def mysql_systemd_start_pre
return '/usr/bin/mysqld_pre_systemd' if v57plus && (el7? || fedora?)
return '/usr/bin/mysql-systemd-start pre' if node['platform_family'] == 'rhel'
return '/usr/lib/mysql/mysql-systemd-helper install' if suse?
'/usr/share/mysql/mysql-systemd-start pre'
end

def mysql_systemd
return "/usr/libexec/#{mysql_name}-wait-ready $MAINPID" if v57plus && (el7? || fedora?)
return '/usr/bin/mysql-systemd-start' if node['platform_family'] == 'rhel'
return '/usr/share/mysql/mysql-systemd-start' if v57plus
"/usr/libexec/#{mysql_name}-wait-ready $MAINPID"
end
Expand Down
1 change: 1 addition & 0 deletions libraries/mysql_service_base.rb
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,7 @@ def create_config
# setting up multiple services.
file "#{prefix_dir}/etc/mysql/my.cnf" do
action :delete
not_if { node['init_package'] == 'systemd' }
end

file "#{prefix_dir}/etc/my.cnf" do
Expand Down
4 changes: 3 additions & 1 deletion libraries/mysql_service_manager_systemd.rb
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,9 @@ class MysqlServiceManagerSystemd < MysqlServiceBase
config: new_resource,
etc_dir: etc_dir,
base_dir: base_dir,
mysqld_bin: mysqld_bin
mysqld_bin: mysqld_bin,
mysql_systemd_start_pre: mysql_systemd_start_pre,
mysql_systemd: mysql_systemd
)
cookbook 'mysql'
notifies :run, "execute[#{new_resource.instance} systemctl daemon-reload]", :immediately
Expand Down
4 changes: 2 additions & 2 deletions metadata.rb
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
maintainer_email '[email protected]'
license 'Apache-2.0'
description 'Provides mysql_service, mysql_config, and mysql_client resources'
version '8.5.1'
version '8.5.2'

%w(redhat centos scientific oracle).each do |el|
supports el, '>= 6.0'
Expand All @@ -12,7 +12,7 @@
supports 'amazon'
supports 'fedora'
supports 'debian', '>= 7.0'
supports 'ubuntu', '>= 12.04'
supports 'ubuntu', '>= 14.04'

supports 'opensuse', '>= 13.0'
supports 'opensuseleap'
Expand Down
Loading

0 comments on commit d53a05f

Please sign in to comment.