Script 'mail_helper' called by obssrc Hello community, here is the log from the commit of package crmsh for openSUSE:Factory checked in at 2021-04-01 14:16:54 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ Comparing /work/SRC/openSUSE:Factory/crmsh (Old) and /work/SRC/openSUSE:Factory/.crmsh.new.2401 (New) ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Package is "crmsh" Thu Apr 1 14:16:54 2021 rev:205 rq:881778 version:4.3.0+20210323.086cc4a3 Changes: -------- --- /work/SRC/openSUSE:Factory/crmsh/crmsh.changes 2021-03-19 16:43:26.382136955 +0100 +++ /work/SRC/openSUSE:Factory/.crmsh.new.2401/crmsh.changes 2021-04-01 14:18:08.780057993 +0200 @@ -1,0 +2,14 @@ +Mon Mar 29 02:23:00 UTC 2021 - XinLiang <xli...@suse.com> + +- Update to version crmsh-4.3.0+20210323.086cc4a3 + * Change the package format + +------------------------------------------------------------------- +Tue Mar 23 03:29:34 UTC 2021 - xli...@suse.com + +- Update to version 4.3.0+git.20210323.086cc4a3: + * Dev: behave: add functional test for changing /etc/hosts + * Dev: unittest: adjust unit test for get_cluster_node_hostname change + * Fix: bootstrap: get the peer node name correctly (bsc#1183654) + +------------------------------------------------------------------- Old: ---- crmsh-4.3.0+git.20210319.b0adc897.tar.bz2 New: ---- crmsh-4.3.0+20210323.086cc4a3.tar.bz2 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ Other differences: ------------------ ++++++ crmsh.spec ++++++ --- /var/tmp/diff_new_pack.zFtfCt/_old 2021-04-01 14:18:09.424058995 +0200 +++ /var/tmp/diff_new_pack.zFtfCt/_new 2021-04-01 14:18:09.424058995 +0200 @@ -36,7 +36,7 @@ Summary: High Availability cluster command-line interface License: GPL-2.0-or-later Group: %{pkg_group} -Version: 4.3.0+git.20210319.b0adc897 +Version: 4.3.0+20210323.086cc4a3 Release: 0 URL: http://crmsh.github.io Source0: %{name}-%{version}.tar.bz2 ++++++ _service ++++++ --- /var/tmp/diff_new_pack.zFtfCt/_old 2021-04-01 14:18:09.452059039 +0200 +++ /var/tmp/diff_new_pack.zFtfCt/_new 2021-04-01 14:18:09.452059039 +0200 @@ -3,7 +3,7 @@ <param name="url">https://github.com/ClusterLabs/crmsh.git</param> <param name="scm">git</param> <param name="filename">crmsh</param> - <param name="versionformat">4.3.0+git.%cd.%h</param> + <param name="versionformat">4.3.0+%cd.%h</param> <param name="revision">master</param> <param name="changesgenerate">enable</param> </service> ++++++ _servicedata ++++++ --- /var/tmp/diff_new_pack.zFtfCt/_old 2021-04-01 14:18:09.472059070 +0200 +++ /var/tmp/diff_new_pack.zFtfCt/_new 2021-04-01 14:18:09.472059070 +0200 @@ -9,6 +9,6 @@ </service> <service name="tar_scm"> <param name="url">https://github.com/ClusterLabs/crmsh.git</param> - <param name="changesrevision">b0adc897a8c08e5b6cab39c2981367f811b1492f</param> + <param name="changesrevision">086cc4a3c7963b93ea5b9251c669bae25059c922</param> </service> </servicedata> \ No newline at end of file ++++++ crmsh-4.3.0+git.20210319.b0adc897.tar.bz2 -> crmsh-4.3.0+20210323.086cc4a3.tar.bz2 ++++++ diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/crmsh-4.3.0+git.20210319.b0adc897/crmsh/bootstrap.py new/crmsh-4.3.0+20210323.086cc4a3/crmsh/bootstrap.py --- old/crmsh-4.3.0+git.20210319.b0adc897/crmsh/bootstrap.py 2021-03-19 05:13:08.000000000 +0100 +++ new/crmsh-4.3.0+20210323.086cc4a3/crmsh/bootstrap.py 2021-03-23 03:50:09.000000000 +0100 @@ -769,17 +769,14 @@ def get_cluster_node_hostname(): """ - Get the hostname of the cluster node used during the join process if an IP address is used. + Get the hostname of the cluster node """ peer_node = None if _context.cluster_node: - if utils.IP.is_valid_ip(_context.cluster_node): - rc, out, err = utils.get_stdout_stderr("ssh {} crm_node --name".format(_context.cluster_node)) - if rc != 0: - error(err) - peer_node = out - else: - peer_node = _context.cluster_node + rc, out, err = utils.get_stdout_stderr("ssh {} crm_node --name".format(_context.cluster_node)) + if rc != 0: + error(err) + peer_node = out return peer_node diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/crmsh-4.3.0+git.20210319.b0adc897/test/features/bootstrap_bugs.feature new/crmsh-4.3.0+20210323.086cc4a3/test/features/bootstrap_bugs.feature --- old/crmsh-4.3.0+git.20210319.b0adc897/test/features/bootstrap_bugs.feature 2021-03-19 05:13:08.000000000 +0100 +++ new/crmsh-4.3.0+20210323.086cc4a3/test/features/bootstrap_bugs.feature 2021-03-23 03:50:09.000000000 +0100 @@ -96,3 +96,18 @@ When Try "crm cluster join -c hanode1 -y" on "hanode3" Then Except "ERROR: cluster.join: Timed out after 120 seconds. Cannot continue since the lock directory exists at the node (hanode1:/run/.crmsh_lock_directory)" When Run "rm -rf /run/.crmsh_lock_directory" on "hanode1" + + @clean + Scenario: Change host name in /etc/hosts as alias(bsc#1183654) + Given Cluster service is "stopped" on "hanode1" + And Cluster service is "stopped" on "hanode2" + When Run "echo '10.10.10.2 HANODE1' >> /etc/hosts" on "hanode1" + When Run "echo '10.10.10.3 HANODE2' >> /etc/hosts" on "hanode2" + When Run "crm cluster init -y" on "hanode1" + Then Cluster service is "started" on "hanode1" + When Run "crm cluster join -c HANODE1 -y" on "hanode2" + Then Cluster service is "started" on "hanode2" + And Online nodes are "hanode1 hanode2" + When Run "crm cluster remove HANODE2 -y" on "hanode1" + Then Cluster service is "stopped" on "hanode2" + And Online nodes are "hanode1" diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/crmsh-4.3.0+git.20210319.b0adc897/test/unittests/test_bootstrap.py new/crmsh-4.3.0+20210323.086cc4a3/test/unittests/test_bootstrap.py --- old/crmsh-4.3.0+git.20210319.b0adc897/test/unittests/test_bootstrap.py 2021-03-19 05:13:08.000000000 +0100 +++ new/crmsh-4.3.0+20210323.086cc4a3/test/unittests/test_bootstrap.py 2021-03-23 03:50:09.000000000 +0100 @@ -1175,41 +1175,28 @@ ]) mock_append.assert_called_once_with("/root/.ssh/id_rsa.pub", "/root/.ssh/authorized_keys") - @mock.patch('crmsh.utils.IP.is_valid_ip') @mock.patch('crmsh.utils.get_stdout_stderr') - def test_get_cluster_node_hostname_None(self, mock_stdout_stderr, mock_valid_ip): - bootstrap._context = mock.Mock(cluster_node=None) + def test_get_cluster_node_hostname(self, mock_stdout_stderr): + bootstrap._context = mock.Mock(cluster_node="node1") + mock_stdout_stderr.return_value = (0, "Node1", None) peer_node = bootstrap.get_cluster_node_hostname() - assert peer_node is None + assert peer_node == "Node1" - mock_valid_ip.assert_not_called() - mock_stdout_stderr.assert_not_called() + mock_stdout_stderr.assert_called_once_with("ssh node1 crm_node --name") - @mock.patch('crmsh.utils.IP.is_valid_ip') + @mock.patch('crmsh.bootstrap.error') @mock.patch('crmsh.utils.get_stdout_stderr') - def test_get_cluster_node_hostname_IP(self, mock_stdout_stderr, mock_valid_ip): - bootstrap._context = mock.Mock(cluster_node="1.1.1.1") - mock_valid_ip.return_value = True - mock_stdout_stderr.return_value = (0, "node1", None) - - peer_node = bootstrap.get_cluster_node_hostname() - assert peer_node == "node1" - - mock_valid_ip.assert_called_once_with("1.1.1.1") - mock_stdout_stderr.assert_called_once_with("ssh 1.1.1.1 crm_node --name") - - @mock.patch('crmsh.utils.IP.is_valid_ip') - @mock.patch('crmsh.utils.get_stdout_stderr') - def test_get_cluster_node_hostname_HOST(self, mock_stdout_stderr, mock_valid_ip): + def test_get_cluster_node_hostname_error(self, mock_stdout_stderr, mock_error): bootstrap._context = mock.Mock(cluster_node="node2") - mock_valid_ip.return_value = False + mock_stdout_stderr.return_value = (1, None, "error") + mock_error.side_effect = SystemExit - peer_node = bootstrap.get_cluster_node_hostname() - assert peer_node == "node2" + with self.assertRaises(SystemExit): + bootstrap.get_cluster_node_hostname() - mock_valid_ip.assert_called_once_with("node2") - mock_stdout_stderr.assert_not_called() + mock_stdout_stderr.assert_called_once_with("ssh node2 crm_node --name") + mock_error.assert_called_once_with("error") @mock.patch('crmsh.utils.this_node') @mock.patch('re.search')