Resolves: rhbz#1493416 rhbz#1796827 rhbz#2059147 rhbz#2092950 rhbz#2112079 rhbz#2112270 rhbz#2112293 rhbz#2117599 rhbz#2117601

- Rebased to latest upstream sources (see CHANGELOG.md)
- Updated pcs-web-ui
- Added bundled rubygem: childprocess
- Removed bundled rubygem: open4
- Updated bundled rubygems: mustermann, rack, rack-protection, rack-test, sinatra, tilt
This commit is contained in:
Miroslav Lisik 2022-10-25 16:01:39 +02:00
parent 2ad9e29003
commit 9455af1d47
12 changed files with 117 additions and 2783 deletions

11
.gitignore vendored
View File

@ -168,3 +168,14 @@
/pcs-web-ui-node-modules-0.1.14.tar.xz
/pcs-0.11.3.tar.gz
/rack-2.2.3.1.gem
/rack-2.2.4.gem
/pcs-0.11.3.185-6d88.tar.gz
/childprocess-4.1.0.gem
/mustermann-3.0.0.gem
/tilt-2.0.11.gem
/tornado-6.2.0.tar.gz
/sinatra-3.0.2.gem
/rack-protection-3.0.2.gem
/pcs-web-ui-0.1.15.tar.gz
/pcs-web-ui-node-modules-0.1.15.tar.xz
/rack-test-2.0.2.gem

Binary file not shown.

Before

Width:  |  Height:  |  Size: 2.7 KiB

View File

@ -1,46 +0,0 @@
From f863c38497eb716141c9e585ddb418191e9fc2a4 Mon Sep 17 00:00:00 2001
From: Tomas Jelinek <tojeline@redhat.com>
Date: Fri, 15 Jul 2022 15:55:57 +0200
Subject: [PATCH 3/3] booth sync: check whether /etc/booth exists
---
pcsd/pcsd_file.rb | 6 +-----
pcsd/remote.rb | 4 ++++
2 files changed, 5 insertions(+), 5 deletions(-)
diff --git a/pcsd/pcsd_file.rb b/pcsd/pcsd_file.rb
index d82b55d2..394db59a 100644
--- a/pcsd/pcsd_file.rb
+++ b/pcsd/pcsd_file.rb
@@ -112,12 +112,8 @@ module PcsdFile
end
end
- def dir()
- return BOOTH_CONFIG_DIR
- end
-
def full_file_name()
- @full_file_name ||= File.join(self.dir, @file[:name])
+ @full_file_name ||= File.join(BOOTH_CONFIG_DIR, @file[:name])
end
end
diff --git a/pcsd/remote.rb b/pcsd/remote.rb
index 854674eb..144d25f3 100644
--- a/pcsd/remote.rb
+++ b/pcsd/remote.rb
@@ -2090,6 +2090,10 @@ def booth_set_config(params, request, auth_user)
check_permissions(auth_user, Permissions::WRITE)
data = check_request_data_for_json(params, auth_user)
+ if not File.directory?(BOOTH_CONFIG_DIR)
+ raise "Configuration directory for booth '/etc/booth' is missing. Is booth installed?"
+ end
+
PcsdExchangeFormat::validate_item_map_is_Hash('files', data)
PcsdExchangeFormat::validate_item_is_Hash('file', :config, data[:config])
if data[:authfile]
--
2.35.3

File diff suppressed because it is too large Load Diff

View File

@ -1,126 +0,0 @@
From de4845ea2d22c7dd9f4539360b44a900b1cea193 Mon Sep 17 00:00:00 2001
From: Tomas Jelinek <tojeline@redhat.com>
Date: Thu, 14 Jul 2022 16:46:33 +0200
Subject: [PATCH 2/3] make booth ticket mode value case insensitive
---
pcs/lib/booth/config_validators.py | 10 ++++++++
pcs/lib/commands/booth.py | 14 +++++++++---
pcs_test/tier0/lib/commands/test_booth.py | 28 ++++++++++++++++-------
3 files changed, 41 insertions(+), 11 deletions(-)
diff --git a/pcs/lib/booth/config_validators.py b/pcs/lib/booth/config_validators.py
index 99badc46..6c4a4ddc 100644
--- a/pcs/lib/booth/config_validators.py
+++ b/pcs/lib/booth/config_validators.py
@@ -100,6 +100,16 @@ def remove_ticket(conf_facade, ticket_name):
return []
+def ticket_options_normalization() -> validate.TypeNormalizeFunc:
+ return validate.option_value_normalization(
+ {
+ "mode": (
+ lambda value: value.lower() if isinstance(value, str) else value
+ )
+ }
+ )
+
+
def validate_ticket_name(ticket_name: str) -> reports.ReportItemList:
if not __TICKET_NAME_RE.search(ticket_name):
return [
diff --git a/pcs/lib/commands/booth.py b/pcs/lib/commands/booth.py
index e7891fbe..fc1454ce 100644
--- a/pcs/lib/commands/booth.py
+++ b/pcs/lib/commands/booth.py
@@ -23,7 +23,10 @@ from pcs.common.reports.item import (
)
from pcs.common.services.errors import ManageServiceError
from pcs.common.str_tools import join_multilines
-from pcs.lib import tools
+from pcs.lib import (
+ tools,
+ validate,
+)
from pcs.lib.booth import (
config_files,
config_validators,
@@ -329,17 +332,22 @@ def config_ticket_add(
booth_env = env.get_booth_env(instance_name)
try:
booth_conf = booth_env.config.read_to_facade()
+ options_pairs = validate.values_to_pairs(
+ options, config_validators.ticket_options_normalization()
+ )
report_processor.report_list(
config_validators.add_ticket(
booth_conf,
ticket_name,
- options,
+ options_pairs,
allow_unknown_options=allow_unknown_options,
)
)
if report_processor.has_errors:
raise LibraryError()
- booth_conf.add_ticket(ticket_name, options)
+ booth_conf.add_ticket(
+ ticket_name, validate.pairs_to_values(options_pairs)
+ )
booth_env.config.write_facade(booth_conf, can_overwrite=True)
except RawFileError as e:
report_processor.report(raw_file_error_report(e))
diff --git a/pcs_test/tier0/lib/commands/test_booth.py b/pcs_test/tier0/lib/commands/test_booth.py
index 2b20a199..12b169c2 100644
--- a/pcs_test/tier0/lib/commands/test_booth.py
+++ b/pcs_test/tier0/lib/commands/test_booth.py
@@ -1194,7 +1194,7 @@ class ConfigTicketAdd(TestCase, FixtureMixin):
},
)
- def test_success_ticket_options(self):
+ def assert_success_ticket_options(self, options_command, options_config):
self.config.raw_file.read(
file_type_codes.BOOTH_CONFIG,
self.fixture_cfg_path(),
@@ -1203,17 +1203,29 @@ class ConfigTicketAdd(TestCase, FixtureMixin):
self.config.raw_file.write(
file_type_codes.BOOTH_CONFIG,
self.fixture_cfg_path(),
- self.fixture_cfg_content(
- ticket_list=[
- ["ticketA", [("retries", "10"), ("timeout", "20")]]
- ]
- ),
+ self.fixture_cfg_content(ticket_list=[["ticketA", options_config]]),
can_overwrite=True,
)
commands.config_ticket_add(
- self.env_assist.get_env(),
- "ticketA",
+ self.env_assist.get_env(), "ticketA", options_command
+ )
+
+ def test_success_ticket_options(self):
+ self.assert_success_ticket_options(
{"timeout": "20", "retries": "10"},
+ [("retries", "10"), ("timeout", "20")],
+ )
+
+ def test_success_ticket_options_mode(self):
+ self.assert_success_ticket_options(
+ {"timeout": "20", "retries": "10", "mode": "manual"},
+ [("mode", "manual"), ("retries", "10"), ("timeout", "20")],
+ )
+
+ def test_success_ticket_options_mode_case_insensitive(self):
+ self.assert_success_ticket_options(
+ {"timeout": "20", "retries": "10", "mode": "MaNuAl"},
+ [("mode", "manual"), ("retries", "10"), ("timeout", "20")],
)
def test_ticket_already_exists(self):
--
2.35.3

View File

@ -1,24 +0,0 @@
From eeeaac9a46f3568e0a116048068ff99d0dccf25c Mon Sep 17 00:00:00 2001
From: Tomas Jelinek <tojeline@redhat.com>
Date: Thu, 30 Jun 2022 14:49:16 +0200
Subject: [PATCH] fix 'pcs resource restart' traceback
---
pcs/resource.py | 1 -
1 file changed, 1 deletion(-)
diff --git a/pcs/resource.py b/pcs/resource.py
index eb59d703..8d402c22 100644
--- a/pcs/resource.py
+++ b/pcs/resource.py
@@ -2596,7 +2596,6 @@ def resource_restart(
Options:
* --wait
"""
- del lib
modifiers.ensure_only_supported("--wait")
if not argv:
utils.err("You must specify a resource to restart")
--
2.35.3

View File

@ -1,46 +0,0 @@
From efd5edbfc96a2d85ee0575beca8b163b4ab9179f Mon Sep 17 00:00:00 2001
From: Tomas Jelinek <tojeline@redhat.com>
Date: Wed, 10 Aug 2022 14:47:53 +0200
Subject: [PATCH] fix ruby socket permissions
---
pcsd/rserver.rb | 23 +++++++++++++++++++++++
1 file changed, 23 insertions(+)
diff --git a/pcsd/rserver.rb b/pcsd/rserver.rb
index e2c5e2a1..4fde639e 100644
--- a/pcsd/rserver.rb
+++ b/pcsd/rserver.rb
@@ -7,6 +7,29 @@ require 'thin'
require 'settings.rb'
+# Replace Thin::Backends::UnixServer:connect
+# The only change is 'File.umask(0o777)' instead of 'File.umask(0)' to properly
+# set python-ruby socket permissions
+module Thin
+ module Backends
+ class UnixServer < Base
+ def connect
+ at_exit { remove_socket_file } # In case it crashes
+ old_umask = File.umask(0o077)
+ begin
+ EventMachine.start_unix_domain_server(@socket, UnixConnection, &method(:initialize_connection))
+ # HACK EventMachine.start_unix_domain_server doesn't return the connection signature
+ # so we have to go in the internal stuff to find it.
+ @signature = EventMachine.instance_eval{@acceptors.keys.first}
+ ensure
+ File.umask(old_umask)
+ end
+ end
+ end
+ end
+end
+
+
def pack_response(response)
return [200, {}, [response.to_json.to_str]]
end
--
2.37.3

View File

@ -1,4 +1,4 @@
From 2a578689db8522971840dbb1644a21c341fe7d83 Mon Sep 17 00:00:00 2001
From c4722151ae80e1848a89d4b830909ef18c906db3 Mon Sep 17 00:00:00 2001
From: Ivan Devat <idevat@redhat.com>
Date: Tue, 20 Nov 2018 15:03:56 +0100
Subject: [PATCH] do not support cluster setup with udp(u) transport in RHEL9
@ -34,5 +34,5 @@ index cfa2ac9c..519c853e 100644
support traffic encryption nor compression.
Transport options are:
--
2.35.1
2.37.3

View File

@ -1,4 +1,4 @@
# recipients: idevat,mlisik,omular,tojeline
# recipients: idevat,mlisik,mpospisi,omular,tojeline
--- !Policy
product_versions:
- rhel-9

View File

@ -1,15 +1,15 @@
Name: pcs
Version: 0.11.3
Release: 4%{?dist}
Release: 5%{?dist}
# https://docs.fedoraproject.org/en-US/packaging-guidelines/LicensingGuidelines/
# https://fedoraproject.org/wiki/Licensing:Main?rd=Licensing#Good_Licenses
# GPLv2: pcs
# ASL 2.0: tornado
# MIT: backports, dacite, daemons, ethon, mustermann, rack, rack-protection,
# rack-test, sinatra, tilt
# MIT: backports, childprocess, dacite, daemons, ethon, mustermann, rack,
# rack-protection, rack-test, sinatra, tilt
# GPLv2 or Ruby: eventmachne
# (GPLv2 or Ruby) and BSD: thin
# BSD or Ruby: open4, ruby2_keywords, webrick
# BSD or Ruby: ruby2_keywords, webrick
# BSD and MIT: ffi
License: GPLv2 and ASL 2.0 and MIT and BSD and (GPLv2 or Ruby) and (BSD or Ruby)
URL: https://github.com/ClusterLabs/pcs
@ -18,35 +18,35 @@ Summary: Pacemaker Configuration System
#building only for architectures with pacemaker and corosync available
ExclusiveArch: i686 x86_64 s390x ppc64le aarch64
%global version_or_commit %{version}
# %%global version_or_commit %%{version}.44-9da7
# %%global version_or_commit %%{version}
%global version_or_commit %{version}.185-6d88
%global pcs_source_name %{name}-%{version_or_commit}
# ui_commit can be determined by hash, tag or branch
%global ui_commit 0.1.14
%global ui_modules_version 0.1.14
%global ui_commit 0.1.15
%global ui_modules_version 0.1.15
%global ui_src_name pcs-web-ui-%{ui_commit}
%global pcs_snmp_pkg_name pcs-snmp
%global pyagentx_version 0.4.pcs.2
%global tornado_version 6.1.0
%global tornado_version 6.2.0
%global dacite_version 1.6.0
%global version_rubygem_backports 3.23.0
%global version_rubygem_childprocess 4.1.0
%global version_rubygem_daemons 1.4.1
%global version_rubygem_ethon 0.15.0
%global version_rubygem_eventmachine 1.2.7
%global version_rubygem_ffi 1.15.5
%global version_rubygem_mustermann 1.1.1
%global version_rubygem_open4 1.3.4
%global version_rubygem_rack 2.2.3.1
%global version_rubygem_rack_protection 2.2.0
%global version_rubygem_rack_test 1.1.0
%global version_rubygem_mustermann 3.0.0
%global version_rubygem_rack 2.2.4
%global version_rubygem_rack_protection 3.0.2
%global version_rubygem_rack_test 2.0.2
%global version_rubygem_ruby2_keywords 0.0.5
%global version_rubygem_sinatra 2.2.0
%global version_rubygem_sinatra 3.0.2
%global version_rubygem_thin 1.8.1
%global version_rubygem_tilt 2.0.10
%global version_rubygem_tilt 2.0.11
%global version_rubygem_webrick 1.7.0
%global required_pacemaker_version 2.1.0
@ -81,10 +81,7 @@ Source81: https://rubygems.org/downloads/backports-%{version_rubygem_backports}.
Source82: https://rubygems.org/downloads/ethon-%{version_rubygem_ethon}.gem
Source83: https://rubygems.org/downloads/ffi-%{version_rubygem_ffi}.gem
Source86: https://rubygems.org/downloads/mustermann-%{version_rubygem_mustermann}.gem
# We needed to re-upload open4 rubygem because of issues with sources in gating.
# Unfortunately, there was no newer version available, therefore we had to
# change its 'version' ourselves.
Source87: https://rubygems.org/downloads/open4-%{version_rubygem_open4}.gem#/open4-%{version_rubygem_open4}-1.gem
Source87: https://rubygems.org/downloads/childprocess-%{version_rubygem_childprocess}.gem
Source88: https://rubygems.org/downloads/rack-%{version_rubygem_rack}.gem
Source89: https://rubygems.org/downloads/rack-protection-%{version_rubygem_rack_protection}.gem
Source90: https://rubygems.org/downloads/rack-test-%{version_rubygem_rack_test}.gem
@ -110,11 +107,7 @@ Source101: https://github.com/ClusterLabs/pcs-web-ui/releases/download/%{ui_comm
# pcs patches: <= 200
Patch1: do-not-support-cluster-setup-with-udp-u-transport.patch
Patch2: bz2102663-01-fix-pcs-resource-restart-traceback.patch
Patch3: bz2058243-01-code-formatting.patch
Patch4: bz2058243-02-make-booth-ticket-mode-value-case-insensitive.patch
Patch5: bz2026725-01-booth-sync-check-whether-etc-booth-exists.patch
Patch6: bz2116841-01-fix-ruby-socket-permissions.patch
Patch2: tests-properly-mock-os.kill-in-scheduler-deadlock.patch
# ui patches: >200
# Patch201: bzNUMBER-01-name.patch
@ -211,7 +204,7 @@ Provides: bundled(ethon) = %{version_rubygem_ethon}
Provides: bundled(eventmachine) = %{version_rubygem_eventmachine}
Provides: bundled(ffi) = %{version_rubygem_ffi}
Provides: bundled(mustermann) = %{version_rubygem_mustermann}
Provides: bundled(open4) = %{version_rubygem_open4}
Provides: bundled(childprocess) = %{version_rubygem_childprocess}
Provides: bundled(rack) = %{version_rubygem_rack}
Provides: bundled(rack_protection) = %{version_rubygem_rack_protection}
Provides: bundled(rack_test) = %{version_rubygem_rack_test}
@ -300,10 +293,6 @@ update_times_patch(){
%autopatch -p1 -M 200
update_times_patch %{PATCH1}
update_times_patch %{PATCH2}
update_times_patch %{PATCH3}
update_times_patch %{PATCH4}
update_times_patch %{PATCH5}
update_times_patch %{PATCH6}
# prepare dirs/files necessary for building all bundles
# -----------------------------------------------------
@ -314,9 +303,7 @@ cp -f %SOURCE81 %{rubygem_cache_dir}
cp -f %SOURCE82 %{rubygem_cache_dir}
cp -f %SOURCE83 %{rubygem_cache_dir}
cp -f %SOURCE86 %{rubygem_cache_dir}
# For reason why we are renaming open4 rubygem, see comment of source
# definition above.
cp -f %SOURCE87 %{rubygem_cache_dir}/open4-%{version_rubygem_open4}.gem
cp -f %SOURCE87 %{rubygem_cache_dir}
cp -f %SOURCE88 %{rubygem_cache_dir}
cp -f %SOURCE89 %{rubygem_cache_dir}
cp -f %SOURCE90 %{rubygem_cache_dir}
@ -369,7 +356,7 @@ mv %{rubygem_bundle_dir}/gems/ffi-%{version_rubygem_ffi}/COPYING ffi_COPYING
mv %{rubygem_bundle_dir}/gems/ffi-%{version_rubygem_ffi}/LICENSE ffi_LICENSE
mv %{rubygem_bundle_dir}/gems/ffi-%{version_rubygem_ffi}/LICENSE.SPECS ffi_LICENSE.SPECS
mv %{rubygem_bundle_dir}/gems/mustermann-%{version_rubygem_mustermann}/LICENSE mustermann_LICENSE
mv %{rubygem_bundle_dir}/gems/open4-%{version_rubygem_open4}/LICENSE open4_LICENSE
mv %{rubygem_bundle_dir}/gems/childprocess-%{version_rubygem_childprocess}/LICENSE childprocess_LICENSE
mv %{rubygem_bundle_dir}/gems/rack-%{version_rubygem_rack}/MIT-LICENSE rack_MIT-LICENSE
mv %{rubygem_bundle_dir}/gems/rack-protection-%{version_rubygem_rack_protection}/License rack-protection_License
mv %{rubygem_bundle_dir}/gems/rack-test-%{version_rubygem_rack_test}/MIT-LICENSE.txt rack-test_MIT-LICENSE.txt
@ -484,8 +471,9 @@ run_all_tests
%license tornado_LICENSE
%license dacite_LICENSE
%license COPYING
# rugygem licenses
# rubygem licenses
%license backports_LICENSE.txt
%license childprocess_LICENSE
%license daemons_LICENSE
%license ethon_LICENSE
%license eventmachine_LICENSE
@ -494,7 +482,6 @@ run_all_tests
%license ffi_LICENSE
%license ffi_LICENSE.SPECS
%license mustermann_LICENSE
%license open4_LICENSE
%license rack_MIT-LICENSE
%license rack-protection_License
%license rack-test_MIT-LICENSE.txt
@ -541,6 +528,14 @@ run_all_tests
%license pyagentx_LICENSE.txt
%changelog
* Mon Oct 24 2022 Miroslav Lisik <mlisik@redhat.com> - 0.11.3-5
- Rebased to latest upstream sources (see CHANGELOG.md)
- Updated pcs-web-ui
- Added bundled rubygem: childprocess
- Removed bundled rubygem: open4
- Updated bundled rubygems: mustermann, rack, rack-protection, rack-test, sinatra, tilt
- Resolves: rhbz#1493416 rhbz#1796827 rhbz#2059147 rhbz#2092950 rhbz#2112079 rhbz#2112270 rhbz#2112293 rhbz#2117599 rhbz#2117601
* Mon Sep 05 2022 Miroslav Lisik <mlisik@redhat.com> - 0.11.3-4
- Fixed ruby socket permissions
- Resolves: rhbz#2116841

22
sources
View File

@ -1,21 +1,21 @@
SHA512 (pyagentx-0.4.pcs.2.tar.gz) = d4194fec9a3e5fefe3793d49b7fec1feafef294c7e613a06046c2993daeefc5cb39d7c5b2b402ff83e49b2d976953f862264288c758c0be09d997b5323cc558a
SHA512 (open4-1.3.4-1.gem) = 838a18efcd093d55d9589ff9d5c11054618abef863224c2d9b31445dc735218c2f96d954040e2d3f8d5aab0140e54b627fcc4a1b01c17e59267402a2abdd8efb
SHA512 (eventmachine-1.2.7.gem) = fdbcf9fc933e2414e70f8f48153e9ba6ed7a0029cdf49cdcb4ab72ab26683e727a36c099f017f20681f9c361179461743e501278ca9bd5612e693e26867cc516
SHA512 (mustermann-1.1.1.gem) = 55d5fd9b8309e0b806b2fb0af409fbc71b958b8f91116991439f2c66b1f71f17647a61020b0349a86132e7d3da383121719ea330538abb8f3c8bef5fbff0b747
SHA512 (rack-test-1.1.0.gem) = 16e291fa5a88b6866e8057b4bf1aae4ffe17dd9b0300c1ee36632c5b21ff2075cb4356f6f78437dd84ea76047a5d3abe3dda087a2c154f5e5712e62d7e57fdc9
SHA512 (tilt-2.0.10.gem) = d2e0e1976da24ea4d8581d29a3ac2c0772c2e42f1cd04c48f1e3c1745a14d7cd319f14cead3e5341ec0f6c07aa216b50c29ad96984a85a9757ff9f7cc89b80df
SHA512 (tornado-6.1.0.tar.gz) = bd161a1c30f40f983d608297bca113735cb4baad255de71302a5b4d35be8c02afbc9820728efa912e62e1cbbfad8f92360261a69e0c8759f9e6cb477fbca31c7
SHA512 (dacite-1.6.0.tar.gz) = 034255f095589d309fe5805413d8b148f430cd20a0de305b7954083b530d516da1d8f3f00ebb5264a8cfb77f2b2a76f1e2d863e78bd191f1d85021c5553815da
SHA512 (webrick-1.7.0.gem) = 5f242b50300046fe7c22ecd1640a73e5815e05a72bedfebe6bc39c24c92bd61abdd180860de0d194c0eebbc640b507b6892de181d3b577c5372ace0ca6faf2a3
SHA512 (sinatra-2.2.0.gem) = 4cd5da37b6c7f03bff7f66d99e07b55aea0dfeda54782fdf38b36fad43147745a3040d7c7aaf4bcb3cd86c6aad7308113c0f86e453488cd4e5d8eac00b04fce1
SHA512 (rack-protection-2.2.0.gem) = 06d6c2026e3e93131a2405bbaa8a514ddde48607979828b9fc41309dbdfff2b7c8cac48a6981e76b5dda554f0cbdc7c6ff5f44b8925fce1cb9b7de0a16380ca4
SHA512 (backports-3.23.0.gem) = b6d721a2925a932e451437938e01c6e3f4ac08bafac975063963f7866e17015abfeb6862face89cbd08caf479db75eb085f540263ba251a87c6acc7611ba6d40
SHA512 (daemons-1.4.1.gem) = c057a7cbafc16f9daa073ce9fd5680f5f978826554073f4e77f2b284aee73567253d471224109d060193572f313e5eaa1509a2113a1564c1508969f658c045c5
SHA512 (ethon-0.15.0.gem) = 6e04c70e105fb95f1e0ff62e1d6ae009bb7b39a60d85ec9e43b10c016f33f679620ded253089a738e0cef5010e9023d1093dd92b1caacdde8f6a745cbae2b5b5
SHA512 (ffi-1.15.5.gem) = 074df34edffc7038ab08199350a97b32280d61ea15dd85d459b008bd3363ec5403b4e533621c8e460e5288f01fec944bff9b149851b819e85bab75ad2362227c
SHA512 (ruby2_keywords-0.0.5.gem) = f6b9078b111e68c0017e0025ecdccb976c7a32f35c1a8adf9fd879db0c91f89eb9bd799f9527a846e28056f2a5fbf0f3610cda9538570288c493613c35c83a6f
SHA512 (thin-1.8.1.gem) = c200ea03b7876b2a17b5875557fa967b8d01db20cc401811f314f3285f8249b8793e4709b7bc033a9c5813b9a51e3093c55f717b4a98b8fda171aa82813b7419
SHA512 (pcs-web-ui-0.1.14.tar.gz) = aaaef6dcdd2255a3d48b9b03984debb61a5f83761fa70e5e2ecaf5c99bc38328cb8fc4347f2115b155ebcc862823ac6f89ef573f011ffe1118cb389e3cbe5661
SHA512 (pcs-web-ui-node-modules-0.1.14.tar.xz) = 5042023409fb49fd0fee12d86794d410e3e28608e28e5bc419aa1cf98f17dd3668081821edbf4f6d660707d40697b3dbde697702c7039459325fb6a4171d5d93
SHA512 (pcs-0.11.3.tar.gz) = 5575a825976d668029eed007b7ddf8b3ad7f3eb6a510c56f4c1779c9228660f5141df761166e3dc307de14313be2045c8dd6e637432a7cab6da51163b8e41578
SHA512 (rack-2.2.3.1.gem) = b4e07624c406765811aec237c1837ca43865f08a3edd3d3c96c47c1e7c813fe7f126f448bf62055b12ec6b70bc0b075979c6c9e2effb6d7f032077f5266e989d
SHA512 (rack-2.2.4.gem) = 7e7cd4f0e44e0cd7d26f35ca946a2b6fcee8ad73425583694a7ea9662816b39681325879ad84a2c0d31dbcc2ded1165b0a37d9278bf3d0b0f2bc4615b66b1ca2
SHA512 (pcs-0.11.3.185-6d88.tar.gz) = 4acfe67ee953bd7fc8b424b1433b0b55a5704b8370f4adb21a275c0d85011e799e5c8f87cf3b09b21af1de73c190934d0e09f6f0d23ad4bbcd3a27014db9f981
SHA512 (childprocess-4.1.0.gem) = e635c3acfa5ad85891c3879f240c7e96d47d7d5ec3f472f4ce6661552b0fb7bd72c5e3b9fb73f4f9312b749fbe554b4be388e56a31a3c63c39743d055d774def
SHA512 (mustermann-3.0.0.gem) = c33d41281fe2ac80c0af0c5c31dbab2068c73b9da19a4b82b387bbe551019fc115675634d932a8e56b070c3a06a85d830c982a103e6c5193aff8647f599be6e3
SHA512 (tilt-2.0.11.gem) = 757a292b05b3ddb2cb8de7680f09433cec85b433e03cd9f738534b99c836fb2129870003a9376c24b6a2f6acb732b51b27968cc0e197a832130d4a35b8dc8239
SHA512 (tornado-6.2.0.tar.gz) = b8f98b76198f21bb3a13f44e8698397d7906a415e75621550dfeea8ae3a7e9405f5e314136a93b6714455062501051c145dfd32c71b433715fc8ed591fcb882b
SHA512 (sinatra-3.0.2.gem) = 16638592dcfa4a0968e46bc6c6ce71c817ccaae050fe3d3d05d3f7dfcff86596c2586a821ba0968ae16755fed07a1655d608a9cd6546d90a1c2991099ef5e488
SHA512 (rack-protection-3.0.2.gem) = 54603e8ba22f1b359e5ffe82a3ee99a31a26e5dedd1e46edd4591ca416a1f241dc37ce2b6da25262a9cf9027b0e8687bd23c6dcbea0197131ca33088cbfd0280
SHA512 (pcs-web-ui-0.1.15.tar.gz) = 7a450efc2c83bd277a85417271d7a0176a1e5f2290c2ca169ff37032be96daec7ce59642dd50c26f8b6f2a3f9ead7f23d5a7a83a35e4b279acf519b45be7bdc5
SHA512 (pcs-web-ui-node-modules-0.1.15.tar.xz) = f2323821c15ba4f66179485517f8098a3ff46249c9609c3f2c2bb0ce6a9ddd73187c97c11e083cdb303dd71d2551e55cb5a937897824a7e4e9294b0f4137c293
SHA512 (rack-test-2.0.2.gem) = 1d395d9504f8d84bcf0e251a9c5873eace29f274b177c7a6bfbdce58f6085ab5170f66d16086e3e159aaa47480d5f993c77b64d613cefda342932c39ad37331d

View File

@ -0,0 +1,61 @@
From 7d9285475e669e805483b50076a55a0ca617cf54 Mon Sep 17 00:00:00 2001
From: Ondrej Mular <omular@redhat.com>
Date: Tue, 25 Oct 2022 09:18:19 +0200
Subject: [PATCH] tests: properly mock os.kill in scheduler deadlock test
---
pcs_test/tier0/daemon/async_tasks/test_integration.py | 9 +++++++--
1 file changed, 7 insertions(+), 2 deletions(-)
diff --git a/pcs_test/tier0/daemon/async_tasks/test_integration.py b/pcs_test/tier0/daemon/async_tasks/test_integration.py
index 289da60f..a5ad801f 100644
--- a/pcs_test/tier0/daemon/async_tasks/test_integration.py
+++ b/pcs_test/tier0/daemon/async_tasks/test_integration.py
@@ -1,4 +1,5 @@
import dataclasses
+import signal
from datetime import timedelta
from logging import Logger
from multiprocessing import Process
@@ -507,6 +508,7 @@ class TaskResultsTests(MockOsKillMixin, IntegrationBaseTestCase):
self.assertEqual(RESULT, task_info.result)
+@mock.patch("pcs.daemon.async_tasks.task.os.kill")
class DeadlockTests(
MockOsKillMixin, AssertTaskStatesMixin, IntegrationBaseTestCase
):
@@ -526,7 +528,7 @@ class DeadlockTests(
).start()
@gen_test
- async def test_deadlock_mitigation(self):
+ async def test_deadlock_mitigation(self, mock_kill):
self._create_tasks(2)
self.execute_tasks(["id0"])
await self.perform_actions(1)
@@ -554,13 +556,15 @@ class DeadlockTests(
self.process_obj_mock.close.assert_not_called()
self.finish_tasks(["id1"])
self.process_obj_mock.is_alive.return_value = False
+ mock_kill.assert_not_called()
await self.perform_actions(1)
+ mock_kill.assert_called_once_with(1, signal.SIGCONT)
# tmp worker finished the task and terminated itself
self.assert_task_state_counts_equal(0, 0, 1, 1)
self.process_obj_mock.close.assert_called_once_with()
@gen_test
- async def test_max_worker_count_reached(self):
+ async def test_max_worker_count_reached(self, mock_kill):
self.scheduler._config = dataclasses.replace(
self.scheduler._config, max_worker_count=1
)
@@ -570,3 +574,4 @@ class DeadlockTests(
self.assert_task_state_counts_equal(0, 2, 1, 0)
self.process_cls_mock.assert_not_called()
self.process_obj_mock.assert_not_called()
+ mock_kill.assert_not_called()
--
2.37.3