From 6141335b61b08b2f5fd8d1bf2d7743d711977902 Mon Sep 17 00:00:00 2001 From: Lukas Slebodnik Date: Nov 10 2018 20:34:28 +0000 Subject: [PATCH 1/2] test_pac_responder: Skip test if pac responder is not installed Merges: https://pagure.io/SSSD/sssd/pull-request/3881 --- diff --git a/src/tests/intg/test_pac_responder.py b/src/tests/intg/test_pac_responder.py index adc3196..a93c6ca 100644 --- a/src/tests/intg/test_pac_responder.py +++ b/src/tests/intg/test_pac_responder.py @@ -27,6 +27,12 @@ import pytest from util import unindent +def have_sssd_responder(responder_name): + responder_path = os.path.join(config.LIBEXEC_PATH, "sssd", responder_name) + + return os.access(responder_path, os.X_OK) + + def stop_sssd(): with open(config.PIDFILE_PATH, "r") as pid_file: pid = int(pid_file.read()) @@ -99,6 +105,8 @@ def timeout_handler(signum, frame): raise Exception("Timeout") +@pytest.mark.skipif(not have_sssd_responder("sssd_pac"), + reason="No PAC responder, skipping") def test_multithreaded_pac_client(local_domain_only, sssd_pac_test_client): """ Test for ticket From 9aa9ebab5449362f8c1fbcac28dbfab90310c6f2 Mon Sep 17 00:00:00 2001 From: Lukas Slebodnik Date: Nov 10 2018 20:34:37 +0000 Subject: [PATCH 2/2] INTG: Show extra test summary info with pytest It will show reasons why tests were skipped. e.g. ====================== test session starts ======================== platform linux -- Python 3.7.1, pytest-3.9.3, py-1.5.4, pluggy-0.7.1 -- /usr/bin/python3 cachedir: .pytest_cache rootdir: /dev/shm/sssd/src/tests/intg, inifile: collected 286 items / 285 deselected test_pac_responder.py::test_multithreaded_pac_client SKIPPED [100%] ==================== short test summary info ====================== SKIP [1] test_pac_responder.py:108: No PAC responder, skipping Merges: https://pagure.io/SSSD/sssd/pull-request/3881 --- diff --git a/src/tests/intg/Makefile.am b/src/tests/intg/Makefile.am index 44fb635..25093b5 100644 --- a/src/tests/intg/Makefile.am +++ b/src/tests/intg/Makefile.am @@ -177,5 +177,5 @@ intgcheck-installed: config.py passwd group pam_sss_service pam_sss_sc_required DBUS_SESSION_BUS_ADDRESS="unix:path=$$DBUS_SOCK_DIR/fake_socket" \ DBUS_SYSTEM_BUS_ADDRESS="unix:path=$$DBUS_SOCK_DIR/system_bus_socket" \ DBUS_SYSTEM_BUS_DEFAULT_ADDRESS="$$DBUS_SYSTEM_BUS_ADDRESS" \ - fakeroot $(PYTHON2) $(PYTEST) -v --tb=native $(INTGCHECK_PYTEST_ARGS) . + fakeroot $(PYTHON2) $(PYTEST) -v -r a --tb=native $(INTGCHECK_PYTEST_ARGS) . rm -f $(DESTDIR)$(logpath)/*