Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

add PXC 57 EOL package tests #680

Open
wants to merge 2 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
52 changes: 38 additions & 14 deletions molecule/pxc/pxc57-bootstrap-maj_upgrade/tasks/main.yml
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
---
- name: Fetch the vars from file for upgrade
- name: Fetch the vars from file
ansible.builtin.include_vars: "{{ ENV_VAR_PATH }}"

- set_fact:
Expand All @@ -16,7 +16,7 @@
man_ip: "{{ PXC3_IP }}"
when:
- "'pxc3' in inventory_hostname"

- debug: var=man_ip

- name: include tasks for test env setup
Expand Down Expand Up @@ -55,7 +55,17 @@
flush: yes
when: ansible_os_family == "RedHat"

- name: install PXC 5.7 previous deb packages
- name: update apt cache debian
apt:
update_cache: yes
when: ansible_os_family == "Debian"

- name: update rpm cache redhat
yum:
update_cache: yes
when: ansible_os_family == "RedHat"

- name: install PXC 5.7 deb packages
apt:
name: "{{ packages }}"
update_cache: yes
Expand Down Expand Up @@ -95,20 +105,31 @@
- python3-pymysql
when: (ansible_os_family == "Debian") and (ansible_distribution_release == "buster")

- name: install PXC 5.7 previous rpm packages
- name: install PXC 5.7 rpm packages
yum:
name: "{{ packages }}"
state: latest
vars:
packages:
- Percona-XtraDB-Cluster-full-57
- Percona-XtraDB-Cluster-57
when: ansible_os_family == "RedHat"
when: ansible_os_family == "RedHat"
environment:
PERCONA_TELEMETRY_URL: "https://check-dev.percona.com/v1/telemetry/GenericReport"
PERCONA_TELEMETRY_DISABLE: "1"

- name: install python mysql rpm packages
- name: check telemetry (enabled)
command: /package-testing/check_telemetry.sh pxc -e

- name: get telemetry_uuid content
command: cat /usr/local/percona/telemetry_uuid
register: t_uuid_output

- name: output telemetry_uuid content
debug:
var: t_uuid_output

- name: install python mysql rpm packages for CentOS 6 and 7
yum:
name: "{{ packages }}"
state: latest
Expand All @@ -117,7 +138,7 @@
- MySQL-python
when: ansible_os_family == "RedHat" and (ansible_distribution_major_version != "8" and ansible_distribution_major_version != "9")

- name: install python mysql rpm packages for OL8 and OL9
- name: install python mysql rpm packages for CentOS 8
yum:
name: "{{ packages }}"
state: latest
Expand All @@ -126,7 +147,7 @@
- python3-PyMySQL
when: ansible_os_family == "RedHat" and (ansible_distribution_major_version == "8" or ansible_distribution_major_version == "9")

- name: stop mysql service
- name: stop mysql service with service command
command: systemctl stop mysql

- name: copy pxc config on centos 6
Expand All @@ -147,8 +168,8 @@

- name: bootstrap cluster on RHEL7
command: systemctl start [email protected]
when: ((ansible_os_family == "RedHat" and ansible_distribution_major_version >= "7") or (ansible_distribution == "Amazon"))

when: ansible_os_family == "RedHat"
- name: run the bootstrap service on debian/ubuntu
command: service mysql bootstrap-pxc
when: ansible_os_family == "Debian"
Expand Down Expand Up @@ -183,11 +204,14 @@
# other tests
- name: install plugins
command: /package-testing/plugins_test_57.sh pxc

- name: register PXC version before upgrade
- name: register PXC version
shell: mysqld --version
register: pxc_version

- name: print PXC version before upgrade
- name: print PXC version
debug: var=pxc_version


- name: check PXC 5.7 version
command: /package-testing/version_check.sh pxc57
when: lookup('env', 'check_version') == "yes" or lookup('env', 'check_version') == ""
6 changes: 3 additions & 3 deletions molecule/pxc/pxc57-common-install/tasks/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -146,9 +146,9 @@
command: /package-testing/package_check.sh pxc57
when: lookup('env', 'check_version') == "yes" or lookup('env', 'check_version') == ""

- name: run bats tests for mysql init scripts
shell: "sleep {{ sleep_before_tests | default('0') }}; /usr/local/bin/bats /package-testing/bats/pxc-init-scripts.bats"
throttle: 1
# - name: run bats tests for mysql init scripts
# shell: "sleep {{ sleep_before_tests | default('0') }}; /usr/local/bin/bats /package-testing/bats/pxc-init-scripts.bats"
# throttle: 1

- name: start mysql service
command: systemctl start mysql
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ provisioner:
destroy: ../../../../playbooks/destroy.yml
prepare: ../../../playbooks/prepare.yml
converge: ../../playbooks/playbook.yml
side_effect: ../../../../../playbooks/pxc80_upgrade_bootstrap.yml
side_effect: ../../../../../playbooks/pxc80_upgrade_common.yml
inventory:
host_vars:
pxc2-57-common-centos-7-maj_upgrade:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ provisioner:
destroy: ../../../../playbooks/destroy.yml
prepare: ../../../playbooks/prepare.yml
converge: ../../playbooks/playbook.yml
side_effect: ../../../../../playbooks/pxc80_upgrade_bootstrap.yml
side_effect: ../../../../../playbooks/pxc80_upgrade_common.yml
inventory:
host_vars:
pxc2-57-common-debian-10-maj_upgrade:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ provisioner:
destroy: ../../../../playbooks/destroy.yml
prepare: ../../../playbooks/prepare.yml
converge: ../../playbooks/playbook.yml
side_effect: ../../../../../playbooks/pxc80_upgrade_bootstrap.yml
side_effect: ../../../../../playbooks/pxc80_upgrade_common.yml
inventory:
host_vars:
pxc2-57-common-debian-11-maj_upgrade:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ provisioner:
destroy: ../../../../playbooks/destroy.yml
prepare: ../../../playbooks/prepare.yml
converge: ../../playbooks/playbook.yml
side_effect: ../../../../../playbooks/pxc80_upgrade_bootstrap.yml
side_effect: ../../../../../playbooks/pxc80_upgrade_common.yml
inventory:
host_vars:
pxc2-57-common-debian-12-maj_upgrade:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ provisioner:
destroy: ../../../../playbooks/destroy.yml
prepare: ../../../playbooks/prepare.yml
converge: ../../playbooks/playbook.yml
side_effect: ../../../../../playbooks/pxc80_upgrade_bootstrap.yml
side_effect: ../../../../../playbooks/pxc80_upgrade_common.yml
inventory:
host_vars:
pxc2-57-common-min-amazon-2-maj_upgrade:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ provisioner:
destroy: ../../../../playbooks/destroy.yml
prepare: ../../../playbooks/prepare.yml
converge: ../../playbooks/playbook.yml
side_effect: ../../../../../playbooks/pxc80_upgrade_bootstrap.yml
side_effect: ../../../../../playbooks/pxc80_upgrade_common.yml
inventory:
host_vars:
pxc2-57-common-ol-8-maj_upgrade:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ provisioner:
destroy: ../../../../playbooks/destroy.yml
prepare: ../../../playbooks/prepare.yml
converge: ../../playbooks/playbook.yml
side_effect: ../../../../../playbooks/pxc80_upgrade_bootstrap.yml
side_effect: ../../../../../playbooks/pxc80_upgrade_common.yml
inventory:
host_vars:
pxc2-57-common-ol-9-maj_upgrade:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ provisioner:
destroy: ../../../../playbooks/destroy.yml
prepare: ../../../playbooks/prepare.yml
converge: ../../playbooks/playbook.yml
side_effect: ../../../../../playbooks/pxc80_upgrade_bootstrap.yml
side_effect: ../../../../../playbooks/pxc80_upgrade_common.yml
inventory:
host_vars:
pxc2-57-common-ubuntu-bionic-maj_upgrade:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ provisioner:
destroy: ../../../../playbooks/destroy.yml
prepare: ../../../playbooks/prepare.yml
converge: ../../playbooks/playbook.yml
side_effect: ../../../../../playbooks/pxc80_upgrade_bootstrap.yml
side_effect: ../../../../../playbooks/pxc80_upgrade_common.yml
inventory:
host_vars:
pxc2-57-common-ubuntu-focal-maj_upgrade:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ provisioner:
destroy: ../../../../playbooks/destroy.yml
prepare: ../../../playbooks/prepare.yml
converge: ../../playbooks/playbook.yml
side_effect: ../../../../../playbooks/pxc80_upgrade_bootstrap.yml
side_effect: ../../../../../playbooks/pxc80_upgrade_common.yml
inventory:
host_vars:
pxc2-57-common-ubuntu-jammy-maj_upgrade:
Expand Down
40 changes: 32 additions & 8 deletions molecule/pxc/pxc57-common-maj_upgrade/tasks/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -50,6 +50,16 @@
flush: yes
when: ansible_os_family == "RedHat"

- name: update apt cache debian
apt:
update_cache: yes
when: ansible_os_family == "Debian"

- name: update rpm cache redhat
yum:
update_cache: yes
when: ansible_os_family == "RedHat"
##
- name: install PXC 5.7 new deb packages
apt:
name: "{{ packages }}"
Expand All @@ -64,23 +74,25 @@
PERCONA_TELEMETRY_URL: "https://check-dev.percona.com/v1/telemetry/GenericReport"
PERCONA_TELEMETRY_DISABLE: "1"

- name: install python mysql deb packages for Debian Buster

- name: install python mysql deb packages
apt:
name: "{{ packages }}"
update_cache: yes
vars:
packages:
- python-mysqldb
when: (ansible_os_family == "Debian") and (ansible_distribution_release == "buster")
when: (ansible_os_family == "Debian") and (ansible_distribution_release != "focal" and ansible_distribution_release != "bionic" and ansible_distribution_release != "bullseye" and ansible_distribution_release != "jammy" and ansible_distribution_release != "bookworm")

- name: install python mysql deb packages except Debian Buster
- name: install python mysql deb packages for focal and bionic
apt:
name: "{{ packages }}"
update_cache: yes
vars:
packages:
- python3-mysqldb
when: (ansible_os_family == "Debian") and (ansible_distribution_release != "buster")
when: (ansible_os_family == "Debian") and (ansible_distribution_release == "focal" or ansible_distribution_release == "bionic" or ansible_distribution_release == "bullseye" or ansible_distribution_release == "jammy" or ansible_distribution_release == "bookworm")


- name: install PXC 5.7 new rpm packages
yum:
Expand All @@ -95,6 +107,9 @@
PERCONA_TELEMETRY_URL: "https://check-dev.percona.com/v1/telemetry/GenericReport"
PERCONA_TELEMETRY_DISABLE: "1"

- name: check telemetry (disabled)
command: /package-testing/check_telemetry.sh pxc -d

- name: stop mysql service
command: systemctl stop mysql

Expand All @@ -118,11 +133,11 @@
command: systemctl start mysql
throttle: 1

- name: register PXC version before upgrade
- name: register PXC version
shell: mysqld --version
register: pxc_version

- name: print PXC version before upgrade
- name: print PXC version
debug: var=pxc_version

- name: check that PXC version is correct
Expand All @@ -134,13 +149,22 @@
when: lookup('env', 'check_version') == "yes" or lookup('env', 'check_version') == ""

# - name: run bats tests for mysql init scripts
# shell: sleep {{ sleep_before_tests | default('0') }}; /usr/local/bin/bats /package-testing/bats/pxc-init-scripts.bats
# shell: "sleep {{ sleep_before_tests | default('0') }}; /usr/local/bin/bats /package-testing/bats/pxc-init-scripts.bats"
# throttle: 1

- name: start mysql service
command: systemctl start mysql
throttle: 1

- name: Check that the PXC Cluster is up and running
shell: mysql -e "SHOW GLOBAL STATUS LIKE 'wsrep_cluster_size';" | awk '{print$2}' | sed -n '2 p' | grep '3'
shell: mysql -e "SHOW GLOBAL STATUS LIKE 'wsrep_cluster_size';" | awk '{print$2}' | sed -n '2 p'
register: cluster_size_check

- name: Passed the cluster size check
shell: echo "Passed"
when: cluster_size_check.stdout == "3"

- name: Check the cluster_size_check
ansible.builtin.fail:
msg: "The cluster is less than 3 nodes FAILING the play"
when: cluster_size_check.stdout != "3"
11 changes: 11 additions & 0 deletions playbooks/blank-playbook.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
---
# This playbook installs PS/PXC client package and checks that it works correctly

- hosts: all
name: Blank Run
become: true
become_method: sudo
tasks:
- name: Blank Run
debug:
msg: "Blank Run"
Loading