summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorTomas Babej <tbabej@redhat.com>2014-04-09 13:38:07 +0200
committerAlexander Bokovoy <abokovoy@redhat.com>2014-05-09 13:57:04 +0300
commitd98e06c3144435b2ae2bb94505fbea836fce128c (patch)
tree31dc991eeec8ac1cafd7b8cee78489584cbbb283
parent086d9f46dd26114ecc722205824c0ce6f0c049cd (diff)
downloadfreeipa-d98e06c3144435b2ae2bb94505fbea836fce128c.tar.gz
freeipa-d98e06c3144435b2ae2bb94505fbea836fce128c.tar.xz
freeipa-d98e06c3144435b2ae2bb94505fbea836fce128c.zip
ipatests: Setup SSSD debugging mode by default
Reviewed-By: Jakub Hrozek <jhrozek@redhat.com> Reviewed-By: Alexander Bokovoy <abokovoy@redhat.com>
-rwxr-xr-xipatests/ipa-test-task11
-rw-r--r--ipatests/man/ipa-test-task.14
-rw-r--r--ipatests/test_integration/tasks.py28
3 files changed, 43 insertions, 0 deletions
diff --git a/ipatests/ipa-test-task b/ipatests/ipa-test-task
index 91bc8689c..02a04b6ab 100755
--- a/ipatests/ipa-test-task
+++ b/ipatests/ipa-test-task
@@ -205,6 +205,13 @@ class TaskRunner(object):
subparser.set_defaults(func=self.clear_sssd_cache)
subparser = subparsers.add_parser(
+ 'setup-sssd-debugging',
+ help='Turns on SSSD debugging levels.')
+ subparser.add_argument('host', type=str,
+ help='IPA Host to turn SSSD debugging on')
+ subparser.set_defaults(func=self.setup_sssd_debugging)
+
+ subparser = subparsers.add_parser(
'sync-time',
help='Synchronize time on host with respect to server')
subparser.add_argument('host', type=str,
@@ -410,6 +417,10 @@ class TaskRunner(object):
host = self.get_host(args.host, default=args.domain.master)
tasks.clear_sssd_cache(host)
+ def setup_sssd_debugging(self, args):
+ host = self.get_host(args.host, default=args.domain.master)
+ tasks.setup_sssd_debugging(host)
+
def sync_time(self, args):
host = self.get_host(args.host, default=args.domain.master)
server = self.get_host(args.server)
diff --git a/ipatests/man/ipa-test-task.1 b/ipatests/man/ipa-test-task.1
index f6717d3f5..4b855b54f 100644
--- a/ipatests/man/ipa-test-task.1
+++ b/ipatests/man/ipa-test-task.1
@@ -143,6 +143,10 @@ Configures auth_to_local rule in /etc/krb5.conf
Clears SSSD cache by removing the cache files. Restarts SSSD.
.TP
+\fBipa\-test\-task setup\-sssd\-debugging HOST\fR
+Sets up SSSD debugging. Restarts SSSD.
+
+.TP
\fBipa\-test\-task sync\-time HOST SERVER\fR
Syncs the time with the remote server. Please note that this function leaves
ntpd stopped.
diff --git a/ipatests/test_integration/tasks.py b/ipatests/test_integration/tasks.py
index a6c6f30d4..ca5b44e4f 100644
--- a/ipatests/test_integration/tasks.py
+++ b/ipatests/test_integration/tasks.py
@@ -201,6 +201,7 @@ def install_master(host):
'--forwarder', host.config.dns_forwarder])
enable_replication_debugging(host)
+ setup_sssd_debugging(host)
kinit_admin(host)
@@ -232,6 +233,7 @@ def install_replica(master, replica, setup_ca=True):
replica.run_command(args)
enable_replication_debugging(replica)
+ setup_sssd_debugging(replica)
kinit_admin(replica)
@@ -249,6 +251,7 @@ def install_client(master, client, extra_args=()):
'--server', master.hostname]
+ list(extra_args))
+ setup_sssd_debugging(client)
kinit_admin(client)
@@ -407,6 +410,31 @@ def configure_auth_to_local_rule(master, ad):
master.run_command(['systemctl', 'restart', 'sssd'])
+def setup_sssd_debugging(host):
+ """
+ Sets debug level to 7 in each section of sssd.conf file.
+ """
+
+ # Set debug level in each section of sssd.conf file to 7
+ # First, remove any previous occurences
+ host.run_command(['sed', '-i',
+ '/debug_level = 7/d',
+ '/etc/sssd/sssd.conf'
+ ], raiseonerr=False)
+
+ # Add the debug directive to each section
+ host.run_command(['sed', '-i',
+ '/\[*\]/ a\debug_level = 7',
+ '/etc/sssd/sssd.conf'
+ ], raiseonerr=False)
+
+
+ host.collect_log('/var/log/sssd/*')
+
+ # Clear the cache and restart SSSD
+ clear_sssd_cache(host)
+
+
def clear_sssd_cache(host):
"""
Clears SSSD cache by removing the cache files. Restarts SSSD.