freeipa/ipatests/pytest_ipa/integration
Stanislav Levin 63747bc0c0 ipatests: Collect all logs on all Unix hosts
Each integration test entity sets up its own list of logfiles.
This is made by calling the callback of host's 'collect_log',
which knows nothing about the context of execution: whether it's
the test class scope or the test method one. Of course, in this
case one-time collection of test method log is not supported
because the logs tracker collects only test class logs.
    In the meantime, almost all the entities (except 'client')
collect identical logs. Besides, due to the IPA roles
transformation an each IPA host can become master, replica or
client, all of these, in turn, can have subroles. So, the
most common case is the collection of all the possible logs from
all the IPA (Unix) hosts. However, the customization of a logfiles
collection is possible.
    The collection is performed with the help of 'integration_logs'
fixture. For example, to add a logfile to list of logs on a test
completion one should add the dependency on this fixture and call
its 'collect_method_log' method.
    ```
    class TestFoo(IntegrationTest):
        def test_foo(self):
            pass

        def test_bar(self, integration_logs):
            integration_logs.collect_method_log(self.master, '/logfile')
    ```
    Collected logs:
    1) 'test_foo' - default logs
    2) 'test_bar' - default logs + /logfile
    3) 'TestFoo' - default logs

Fixes: https://pagure.io/freeipa/issue/8265
Signed-off-by: Stanislav Levin <slev@altlinux.org>
Reviewed-By: Rob Crittenden <rcritten@redhat.com>
2020-04-28 17:50:10 +02:00
..
__init__.py ipatests: Collect all logs on all Unix hosts 2020-04-28 17:50:10 +02:00
config.py ipatests: Collect all logs on all Unix hosts 2020-04-28 17:50:10 +02:00
create_caless_pki.py ipatests: add test for certinstall with notBefore in the future 2019-12-19 15:50:44 +01:00
env_config.py Test installation with (fake) userspace FIPS 2019-11-14 16:01:15 +01:00
fips.py Test installation with (fake) userspace FIPS 2019-11-14 16:01:15 +01:00
firewall.py ipatests: Mark firewalld commands as no-op on non-firewalld distros 2020-04-08 16:33:35 +02:00
host.py Add pytest OpenSSH transport with password 2020-03-24 10:22:18 +02:00
tasks.py ipatests: Collect all logs on all Unix hosts 2020-04-28 17:50:10 +02:00
transport.py Add pytest OpenSSH transport with password 2020-03-24 10:22:18 +02:00