diff --git a/0006-fix_unit_tests.patch b/0006-fix_unit_tests.patch new file mode 100644 index 0000000..460fafd --- /dev/null +++ b/0006-fix_unit_tests.patch @@ -0,0 +1,93 @@ +diff --git a/makefile b/makefile +index 9fd86eeb..959f83af 100644 +--- a/makefile ++++ b/makefile +@@ -721,7 +721,7 @@ endif + .PHONY: test + test: $(test_deps) + @echo "makefile: Running unit and function tests" +- py.test --color=yes --cov $(package_name) --cov $(mock_package_name) $(coverage_report) --cov-config coveragerc $(pytest_warning_opts) $(pytest_opts) tests/unittest tests/functiontest -s ++ py.test $(pytest_warning_opts) $(pytest_opts) tests/unittest tests/functiontest -s -v + @echo "makefile: Done running tests" + + .PHONY: installtest +diff --git a/tests/functiontest/conftest.py b/tests/functiontest/conftest.py +index 42936f88..44e89845 100644 +--- a/tests/functiontest/conftest.py ++++ b/tests/functiontest/conftest.py +@@ -207,7 +207,7 @@ def patched_makefile(self, mode='r', bufsize=-1): + else: + timeout = self.timeout + t.join(timeout) +- if t.isAlive(): ++ if t.is_alive(): + raise socket.timeout + + return self.fd +diff --git a/tests/unittest/pywbem/test_recorder.py b/tests/unittest/pywbem/test_recorder.py +index 5caf7f12..2436acc9 100755 +--- a/tests/unittest/pywbem/test_recorder.py ++++ b/tests/unittest/pywbem/test_recorder.py +@@ -1611,11 +1611,11 @@ class LogOperationRecorderTests(BaseLogOperationRecorderTests): + "classname='CIM_Foo', " + "keybindings=NocaseDict({'Chicken': 'Ham'}), " + "namespace='root/cimv2', host='woot.com'), " +- "Params=OrderedDict([" +- "('StringParam', 'Spotty'), " +- "('Uint8', Uint8(cimtype='uint8', minvalue=0, maxvalue=255, 1)), " +- "('Sint8', Sint8(cimtype='sint8', minvalue=-128, maxvalue=127, 2))" +- "]))") ++ "Params=OrderedDict({" ++ "'StringParam': 'Spotty', " ++ "'Uint8': Uint8(cimtype='uint8', minvalue=0, maxvalue=255, 1), " ++ "'Sint8': Sint8(cimtype='sint8', minvalue=-128, maxvalue=127, 2)})" ++ ")") + + result_ret = "Return:test_id InvokeMethod(tuple )" + +diff --git a/tests/unittest/test_wbemcli.py b/tests/unittest/test_wbemcli.py +index 45a77a1c..2078e697 100755 +--- a/tests/unittest/test_wbemcli.py ++++ b/tests/unittest/test_wbemcli.py +@@ -59,8 +59,8 @@ input requests as soon as the interactive shell is started. + + Use h() in thenteractive shell for help for wbemcli methods and variables. + +-Deprecated: The wbemcli command has been deprecated in pywbem 0.15.0. +-Version 1.0.0 of pywbem will remove the wbemcli command. ++Deprecated: The ~CMDLINE_EXE~ command has been deprecated in pywbem 0.15.0. ++Version 1.0.0 of pywbem will remove the ~CMDLINE_EXE~ command. + The recommended replacement is to use the pywbemcli command from the + pywbemtools package on Pypi. + +@@ -130,7 +130,7 @@ Connection security related options: + then be part of the certfile + + General options: +- -s [scripts [scripts ...]], --scripts [scripts [scripts ...]] ++ -s [scripts ...], --scripts [scripts ...] + Execute the python code defined by the script before the + user gets control. This argument may be repeated to load + multiple scripts or multiple scripts may be listed for a +@@ -139,7 +139,7 @@ General options: + -v, --verbose Print more messages while processing + -V, --version Display pywbem version and exit. + --statistics Enable gathering of statistics on operations. +- --mock-server [file name [file name ...]] ++ --mock-server [file name ...] + Activate pywbem_mock in place of a live WBEMConnection + and compile/build the files defined (".mof" suffix or + "py" suffix. MOF files are compiled and python files +diff --git a/tests/utils.py b/tests/utils.py +index 06ec6a85..1d661cd0 100644 +--- a/tests/utils.py ++++ b/tests/utils.py +@@ -48,7 +48,7 @@ def skip_if_moftab_regenerated(): + if test_installed: + # The mofparsetab and moflextab files should not be auto-generated + # in this case. +- pytest.fail("Cannot run this MOF testcase against an installed " ++ pytest.skip("Cannot run this MOF testcase against an installed " + "pywbem (version {0}, installed at {1}) " + "because that installation does not contain the " + "mofparsetab.py or moflextab.py files". diff --git a/gating.yaml b/gating.yaml new file mode 100644 index 0000000..2c7ed80 --- /dev/null +++ b/gating.yaml @@ -0,0 +1,6 @@ +--- !Policy +product_versions: + - rhel-* +decision_context: osci_compose_gate +rules: + - !PassingTestCaseRule {test_case_name: osci.brew-build.tier0.functional} diff --git a/pywbem.spec b/pywbem.spec index 225e9b0..f2f1cd6 100644 --- a/pywbem.spec +++ b/pywbem.spec @@ -3,7 +3,7 @@ Name: pywbem Version: 0.17.6 Epoch: 1 -Release: 10%{?dist} +Release: 11%{?dist} Summary: Python WBEM client interface and related utilities License: LGPL-2.1-or-later URL: https://github.com/pywbem/pywbem @@ -13,6 +13,7 @@ Patch2: 0002-coverity-deadcode.patch Patch3: 0003-coverity-forward-null.patch Patch4: 0004-coverity-identifier-typo.patch Patch5: 0005-python3_12.patch +Patch6: 0006-fix_unit_tests.patch BuildRequires: python3-pip python3-PyYAML python3-ply python3-rpm-macros BuildRequires: python3-devel BuildRequires: python3-setuptools @@ -72,6 +73,9 @@ mv -v %{buildroot}/%{_bindir}/wbemcli.py %{buildroot}/%{_bindir}/pywbemcli.py %doc README.rst %changelog +* Wed Jul 17 2024 Tony Asleson - 1:0.17.6-11 +- Add gating + * Mon Jul 15 2024 Tony Asleson - 1:0.17.6-10 - Changes to support python 3.12 diff --git a/tests/tests.yml b/tests/tests.yml new file mode 100644 index 0000000..50a00a6 --- /dev/null +++ b/tests/tests.yml @@ -0,0 +1,23 @@ +- hosts: localhost + roles: + - role: standard-test-basic + tags: + - classic + tests: + - simple: + dir: ./pywbem + run: TEST_WBEMCLI_NAME=pywbemcli TEST_INSTALLED=1 make test + required_packages: + - python3-pywbem + - python3-pytest + - python3-coverage + - python3-httpretty + - python3-testfixtures + - python3-pytz + - python3-formencode + - python3-lxml + - python3-yamlloader + repositories: + - repo: "https://github.com/tasleson/pywbem.git" + dest: "pywbem" + version: "0.17.6_stable"