@@ -42,10 +42,19 @@ case $test_mode in
4242 package_list=$( rpm_repoquery) ||
4343 bb_log_err " unable to retrieve package list from repository"
4444 package_list=$( echo " $package_list " | grep -viE ' galera|columnstore' )
45+ alternative_names_package_list=$package_list
4546 bb_log_warn " Due to MCOL-4120 and other issues, Columnstore upgrade will be tested separately"
4647 ;;
4748 server)
4849 package_list=" MariaDB-server MariaDB-client"
50+ alternative_names_package_list=$package_list
51+ if [[ " $test_type " == " distro" ]]; then
52+ if [[ " $ID_LIKE " =~ ^suse.* ]]; then
53+ alternative_names_package_list=" mariadb mariadb-client"
54+ else
55+ alternative_names_package_list=" mariadb-server mariadb"
56+ fi
57+ fi
4958 ;;
5059 columnstore)
5160 package_list=$( rpm_repoquery)
@@ -54,6 +63,7 @@ case $test_mode in
5463 exit
5564 fi
5665 package_list=" MariaDB-server MariaDB-columnstore-engine"
66+ alternative_names_package_list=$package_list
5767 ;;
5868 * )
5969 bb_log_err " unknown test mode ($test_mode )"
6373
6474bb_log_info " Package_list: $package_list "
6575
66- # # //TEMP this needs to be implemented once we have SLES VM in new BB
67- # # Prepare yum/zypper configuration for installation of the last release
68- # if which zypper; then
69- # repo_location=/etc/zypp/repos.d
70- # install_command="zypper --no-gpg-checks install --from mariadb -y"
71- # cleanup_command="zypper clean --all"
72- # remove_command="zypper remove -y"
73- # # Since there is no reasonable "upgrade" command in zypper which would
74- # # pick up RPM files needed to upgrade existing packages, we have to use "install".
75- # # However, if we run "install *.rpm", it will install all packages, regardless
76- # # the test mode, and we will get a lot of differences in contents after upgrade
77- # # (more plugins, etc.). So, instead for each package that we are going to install,
78- # # we'll also find an RPM file which provides it, and will use its name in
79- # # in the "upgrade" (second install) command
80- # if [[ $test_mode == "all" ]]; then
81- # rm -f rpms/*columnstore*.rpm
82- # rpms_for_upgrade="rpms/*.rpm"
83- # else
84- # rpms_for_upgrade=""
85- # for p in $package_list; do
86- # for f in rpms/*.rpm; do
87- # if rpm -qp "$f" --provides | grep -i "^$p ="; then
88- # rpms_for_upgrade="$rpms_for_upgrade $f"
89- # break
90- # fi
91- # done
92- # done
93- # fi
94- # upgrade_command="zypper --no-gpg-checks install -y $rpms_for_upgrade"
95-
96- # As of now (February 2018), RPM packages do not support major upgrade.
97- # To imitate it, we will remove previous packages and install new ones.
98- # //TEMP is this still true??
99- # else
100- #
101- # repo_location=/etc/yum.repos.d
102- # install_command="sudo $pkg_cmd -y --nogpgcheck install"
103- # cleanup_command="sudo $pkg_cmd clean all"
104- # upgrade_command="sudo $pkg_cmd -y --nogpgcheck upgrade"
105- # if [[ $test_type == "major" ]]; then
106- # upgrade_command="sudo $pkg_cmd -y --nogpgcheck install"
107- # fi
108- # # //TEMP not sure about the reason of this
109- # # if $pkg_cmd autoremove 2>&1 | grep -q 'need to be root'; then
110- # # remove_command="sudo $pkg_cmd -y autoremove"
111- # # else
112- # # remove_command="sudo $pkg_cmd -y remove"
113- # # fi
114- # remove_command="sudo $pkg_cmd -y autoremove"
115-
116- # Workaround for TODO-1479 (errors upon reading from SUSE repos):
117- # sudo rm -rf
118- # /etc/zypp/repos.d/SUSE_Linux_Enterprise_Server_12_SP3_x86_64:SLES12-SP3-Updates.repo
119- # /etc/zypp/repos.d/SUSE_Linux_Enterprise_Server_12_SP3_x86_64:SLES12-SP3-Pool.repo
120-
12176# ID_LIKE may not exist
12277set +u
12378if [[ $ID_LIKE =~ ^suse* ]]; then
13287set -u
13388
13489# Install previous release
135- echo " $package_list " | xargs sudo " $pkg_cmd " " $pkg_cmd_options " install ||
90+ echo " $alternative_names_package_list " | xargs sudo " $pkg_cmd " " $pkg_cmd_options " install ||
13691 bb_log_err " installation of a previous release failed, see the output above"
13792# fi
13893
@@ -184,16 +139,16 @@ if [[ $package_version == "$old_version" ]]; then
184139fi
185140
186141# //TEMP upgrade does not work without this but why? Can't we fix it?
187- if [[ $test_type == " major" ]]; then
142+ if [[ " $test_type " =~ ^( major| distro)$ ]]; then
188143 bb_log_info " remove old packages for major upgrade"
189- packages_to_remove=$( rpm -qa | grep ' MariaDB-' | awk -F' -' ' {print $1"-"$2}' )
144+ packages_to_remove=$( rpm -qa | grep -E ' ^( MariaDB|mariadb) -' | awk -F' -' ' {print $1"-"$2}' )
190145 echo " $packages_to_remove " | xargs sudo " $pkg_cmd " " $pkg_cmd_options " remove
191146 rpm -qa | grep -iE ' maria|mysql' || true
192147fi
193148
194149rpm_setup_bb_galera_artifacts_mirror
195150rpm_setup_bb_artifacts_mirror
196- if [[ $test_type == " major" ]]; then
151+ if [[ " $test_type " =~ ^( major| distro)$ ]]; then
197152 # major upgrade (remove then install)
198153 echo " $package_list " | xargs sudo " $pkg_cmd " " $pkg_cmd_options " install
199154else
220175
221176# Optionally (re)start the server
222177set -e
223- if [[ $test_type == " major" ]] || [[ $test_mode == " columnstore" ]]; then
178+ if [[ " $test_type " =~ ^( major| distro)$ ]] || [[ $test_mode == " columnstore" ]]; then
224179 control_mariadb_server restart
225180fi
226181
232187
233188# Run mariadb-upgrade for non-GA branches (minor upgrades in GA branches
234189# shouldn't need it)
235- if [[ $major_version == " $development_branch " ]] || [[ $test_type == " major" ]]; then
190+ if [[ $major_version == " $development_branch " ]] || [[ " $test_type " =~ ^( major| distro)$ ]]; then
236191 sudo mariadb-upgrade
237192fi
238193
0 commit comments