Hello community, here is the log from the commit of package crmsh for openSUSE:Factory checked in at 2020-03-17 13:09:27 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ Comparing /work/SRC/openSUSE:Factory/crmsh (Old) and /work/SRC/openSUSE:Factory/.crmsh.new.3160 (New) ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Package is "crmsh" Tue Mar 17 13:09:27 2020 rev:177 rq:785611 version:4.2.0+git.1584360067.097e3790 Changes: -------- --- /work/SRC/openSUSE:Factory/crmsh/crmsh.changes 2020-03-12 23:12:36.615331124 +0100 +++ /work/SRC/openSUSE:Factory/.crmsh.new.3160/crmsh.changes 2020-03-17 13:09:29.813769092 +0100 @@ -1,0 +2,8 @@ +Mon Mar 16 12:10:14 UTC 2020 - xli...@suse.com + +- Update to version 4.2.0+git.1584360067.097e3790: + * Dev: unittest: unit test for changed function csync2_update + * Dev: behave: functional test for scenarios of bsc#1166684 + * Fix: bootstrap: use csync2 '-f' option correctly(bsc#1166684) + +------------------------------------------------------------------- Old: ---- crmsh-4.2.0+git.1584013187.b45cfcb6.tar.bz2 New: ---- crmsh-4.2.0+git.1584360067.097e3790.tar.bz2 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ Other differences: ------------------ ++++++ crmsh.spec ++++++ --- /var/tmp/diff_new_pack.4U2mnO/_old 2020-03-17 13:09:30.437769572 +0100 +++ /var/tmp/diff_new_pack.4U2mnO/_new 2020-03-17 13:09:30.441769574 +0100 @@ -36,7 +36,7 @@ Summary: High Availability cluster command-line interface License: GPL-2.0-or-later Group: %{pkg_group} -Version: 4.2.0+git.1584013187.b45cfcb6 +Version: 4.2.0+git.1584360067.097e3790 Release: 0 Url: http://crmsh.github.io Source0: %{name}-%{version}.tar.bz2 ++++++ _servicedata ++++++ --- /var/tmp/diff_new_pack.4U2mnO/_old 2020-03-17 13:09:30.469769596 +0100 +++ /var/tmp/diff_new_pack.4U2mnO/_new 2020-03-17 13:09:30.473769599 +0100 @@ -5,4 +5,4 @@ <param name="url">https://github.com/liangxin1300/crmsh.git</param> <param name="changesrevision">d8dc51b4cb34964aa72e918999ebc7f03b48f3c9</param></service><service name="tar_scm"> <param name="url">https://github.com/ClusterLabs/crmsh.git</param> - <param name="changesrevision">b256772e34cde162c8245581097d13070ae51254</param></service></servicedata> \ No newline at end of file + <param name="changesrevision">2c10d3df8de68a2df4e2f3ada933528ddba22b1e</param></service></servicedata> \ No newline at end of file ++++++ crmsh-4.2.0+git.1584013187.b45cfcb6.tar.bz2 -> crmsh-4.2.0+git.1584360067.097e3790.tar.bz2 ++++++ diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/crmsh-4.2.0+git.1584013187.b45cfcb6/crmsh/bootstrap.py new/crmsh-4.2.0+git.1584360067.097e3790/crmsh/bootstrap.py --- old/crmsh-4.2.0+git.1584013187.b45cfcb6/crmsh/bootstrap.py 2020-03-12 12:39:47.000000000 +0100 +++ new/crmsh-4.2.0+git.1584360067.097e3790/crmsh/bootstrap.py 2020-03-16 13:01:07.000000000 +0100 @@ -784,9 +784,17 @@ def csync2_update(path): - invoke("csync2 -rm %s" % (path)) - invoke("csync2 -rf %s" % (path)) - invoke("csync2 -rxv %s" % (path)) + ''' + Sync path to all peers + + If there was a conflict, use '-f' to force this side to win + ''' + invoke("csync2 -rm {}".format(path)) + if invoke("csync2 -rxv {}".format(path)): + return + invoke("csync2 -rf {}".format(path)) + if not invoke("csync2 -rxv {}".format(path)): + warn("{} was not synced".format(path)) def init_csync2_remote(): @@ -1740,7 +1748,7 @@ # they haven't gone to all nodes in the cluster, which means a # subseqent join of another node can fail its sync of corosync.conf # when it updates expected_votes. Grrr... - if not invoke('ssh -o StrictHostKeyChecking=no root@%s "csync2 -mr / ; csync2 -fr / ; csync2 -xv"' % (seed_host)): + if not invoke('ssh -o StrictHostKeyChecking=no root@{} "csync2 -rm /; csync2 -rxv || csync2 -rf / && csync2 -rxv"'.format(seed_host)): print("") warn("csync2 run failed - some files may not be sync'd") diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/crmsh-4.2.0+git.1584013187.b45cfcb6/test/docker_scripts.sh new/crmsh-4.2.0+git.1584360067.097e3790/test/docker_scripts.sh --- old/crmsh-4.2.0+git.1584013187.b45cfcb6/test/docker_scripts.sh 2020-03-12 12:39:47.000000000 +0100 +++ new/crmsh-4.2.0+git.1584360067.097e3790/test/docker_scripts.sh 2020-03-16 13:01:07.000000000 +0100 @@ -36,7 +36,7 @@ docker run -d --name=qnetd-node --hostname qnetd-node \ --privileged -v /sys/fs/cgroup:/sys/fs/cgroup:ro ${Docker_image} docker network connect --ip=10.10.10.9 second_net qnetd-node - docker exec -t qnetd-node /bin/sh -c "zypper -n in corosync-qnetd" + docker exec -t qnetd-node /bin/sh -c "zypper ref;zypper -n in corosync-qnetd" docker exec -t qnetd-node /bin/sh -c "systemctl start sshd.service" # deploy node without ssh.service running for validation diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/crmsh-4.2.0+git.1584013187.b45cfcb6/test/features/qdevice_setup_remove.feature new/crmsh-4.2.0+git.1584360067.097e3790/test/features/qdevice_setup_remove.feature --- old/crmsh-4.2.0+git.1584013187.b45cfcb6/test/features/qdevice_setup_remove.feature 2020-03-12 12:39:47.000000000 +0100 +++ new/crmsh-4.2.0+git.1584360067.097e3790/test/features/qdevice_setup_remove.feature 2020-03-16 13:01:07.000000000 +0100 @@ -32,6 +32,8 @@ Then Cluster service is "started" on "hanode2" And Online nodes are "hanode1 hanode2" And Service "corosync-qdevice" is "stopped" on "hanode2" + When Run "echo "# This is a test for bsc#1166684" >> /etc/corosync/corosync.conf" on "hanode1" + When Run "scp /etc/corosync/corosync.conf root@hanode2:/etc/corosync" on "hanode1" When Run "crm cluster init qdevice --qnetd-hostname=qnetd-node -y" on "hanode1" Then Service "corosync-qdevice" is "started" on "hanode1" And Service "corosync-qdevice" is "started" on "hanode2" diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/crmsh-4.2.0+git.1584013187.b45cfcb6/test/unittests/test_bootstrap.py new/crmsh-4.2.0+git.1584360067.097e3790/test/unittests/test_bootstrap.py --- old/crmsh-4.2.0+git.1584013187.b45cfcb6/test/unittests/test_bootstrap.py 2020-03-12 12:39:47.000000000 +0100 +++ new/crmsh-4.2.0+git.1584360067.097e3790/test/unittests/test_bootstrap.py 2020-03-16 13:01:07.000000000 +0100 @@ -282,3 +282,25 @@ mock_csync2.assert_not_called() mock_stop_service.assert_not_called() mock_error.assert_not_called() + + @mock.patch('crmsh.bootstrap.invoke') + def test_csync2_update_no_conflicts(self, mock_invoke): + mock_invoke.side_effect = [True, True] + bootstrap.csync2_update("/etc/corosync.conf") + mock_invoke.assert_has_calls([ + mock.call("csync2 -rm /etc/corosync.conf"), + mock.call("csync2 -rxv /etc/corosync.conf") + ]) + + @mock.patch('crmsh.bootstrap.warn') + @mock.patch('crmsh.bootstrap.invoke') + def test_csync2_update(self, mock_invoke, mock_warn): + mock_invoke.side_effect = [True, False, True, False] + bootstrap.csync2_update("/etc/corosync.conf") + mock_invoke.assert_has_calls([ + mock.call("csync2 -rm /etc/corosync.conf"), + mock.call("csync2 -rxv /etc/corosync.conf"), + mock.call("csync2 -rf /etc/corosync.conf"), + mock.call("csync2 -rxv /etc/corosync.conf") + ]) + mock_warn.assert_called_once_with("/etc/corosync.conf was not synced")