Re: [Freeipa-devel] [PATCHES 180-182] ipatests: Improvements!

2014-05-09 Thread Alexander Bokovoy

On Fri, 09 May 2014, Alexander Bokovoy wrote:

On Tue, 06 May 2014, Tomas Babej wrote:


On 05/05/2014 06:08 PM, Alexander Bokovoy wrote:

On Fri, 02 May 2014, Jakub Hrozek wrote:

On Wed, Apr 30, 2014 at 03:59:01PM +0200, Tomas Babej wrote:

Hi,

* patch 180 fixes incorrect hostname usage when connecting to legacy
clients
* patch 181 sets up SSSD in debug_level 7 by default
* patch 182 does the same, but on the legacy clients

--
Tomas Babej
Associate Software Engineer | Red Hat | Identity Management
RHCE | Brno Site | IRC: tbabej | freeipa.org



ACK to the general intent of debug_level by default. Have you considered
using the python ConfigAPI sssd has to change the sections rather than
running a sed script?

I agree.

The patchset in current form does work fine for me in the tests.
However, I'd rather wait for a new revision which incorporates changes
requested by the Jakub.




I'm not sure using python ConfigAPI would be a better option here, for one
particular reason - the tests themselves are not run on the machine where
we want to change the config.

Hence we need to enclose everything we want done on the client in the
run_command method.

Moving from sed to using python ConfigAPI would mean moving from:

+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)

to creating the python script file of ~10-15 lines on the client and
then running it on
the client itself via:

+ host.run_command(['python', 'set_sssd_debug_level.py'])

Given that, it does not seem that much simpler than using two sed
commands to me.

Yes, it is clearly an overkill in this case.

ACK.

Pushed patches 180-182 to master.

--
/ Alexander Bokovoy

___
Freeipa-devel mailing list
Freeipa-devel@redhat.com
https://www.redhat.com/mailman/listinfo/freeipa-devel


Re: [Freeipa-devel] [PATCHES 180-182] ipatests: Improvements!

2014-05-09 Thread Alexander Bokovoy

On Tue, 06 May 2014, Tomas Babej wrote:


On 05/05/2014 06:08 PM, Alexander Bokovoy wrote:

On Fri, 02 May 2014, Jakub Hrozek wrote:

On Wed, Apr 30, 2014 at 03:59:01PM +0200, Tomas Babej wrote:

Hi,

* patch 180 fixes incorrect hostname usage when connecting to legacy
clients
* patch 181 sets up SSSD in debug_level 7 by default
* patch 182 does the same, but on the legacy clients

--
Tomas Babej
Associate Software Engineer | Red Hat | Identity Management
RHCE | Brno Site | IRC: tbabej | freeipa.org



ACK to the general intent of debug_level by default. Have you considered
using the python ConfigAPI sssd has to change the sections rather than
running a sed script?

I agree.

The patchset in current form does work fine for me in the tests.
However, I'd rather wait for a new revision which incorporates changes
requested by the Jakub.




I'm not sure using python ConfigAPI would be a better option here, for one
particular reason - the tests themselves are not run on the machine where
we want to change the config.

Hence we need to enclose everything we want done on the client in the
run_command method.

Moving from sed to using python ConfigAPI would mean moving from:

+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)

to creating the python script file of ~10-15 lines on the client and
then running it on
the client itself via:

+ host.run_command(['python', 'set_sssd_debug_level.py'])

Given that, it does not seem that much simpler than using two sed
commands to me.

Yes, it is clearly an overkill in this case.

ACK.

--
/ Alexander Bokovoy

___
Freeipa-devel mailing list
Freeipa-devel@redhat.com
https://www.redhat.com/mailman/listinfo/freeipa-devel


Re: [Freeipa-devel] [PATCHES 180-182] ipatests: Improvements!

2014-05-06 Thread Tomas Babej

On 05/05/2014 06:08 PM, Alexander Bokovoy wrote:
> On Fri, 02 May 2014, Jakub Hrozek wrote:
>> On Wed, Apr 30, 2014 at 03:59:01PM +0200, Tomas Babej wrote:
>>> Hi,
>>>
>>> * patch 180 fixes incorrect hostname usage when connecting to legacy
>>> clients
>>> * patch 181 sets up SSSD in debug_level 7 by default
>>> * patch 182 does the same, but on the legacy clients
>>>
>>> -- 
>>> Tomas Babej
>>> Associate Software Engineer | Red Hat | Identity Management
>>> RHCE | Brno Site | IRC: tbabej | freeipa.org
>>>
>>
>> ACK to the general intent of debug_level by default. Have you considered
>> using the python ConfigAPI sssd has to change the sections rather than
>> running a sed script?
> I agree.
>
> The patchset in current form does work fine for me in the tests.
> However, I'd rather wait for a new revision which incorporates changes
> requested by the Jakub.
>
>

I'm not sure using python ConfigAPI would be a better option here, for one
particular reason - the tests themselves are not run on the machine where
we want to change the config.

Hence we need to enclose everything we want done on the client in the
run_command method.

Moving from sed to using python ConfigAPI would mean moving from:

+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)

to creating the python script file of ~10-15 lines on the client and
then running it on
the client itself via:

+ host.run_command(['python', 'set_sssd_debug_level.py'])

Given that, it does not seem that much simpler than using two sed
commands to me.

-- 
Tomas Babej
Associate Software Engineer | Red Hat | Identity Management
RHCE | Brno Site | IRC: tbabej | freeipa.org 

___
Freeipa-devel mailing list
Freeipa-devel@redhat.com
https://www.redhat.com/mailman/listinfo/freeipa-devel


Re: [Freeipa-devel] [PATCHES 180-182] ipatests: Improvements!

2014-05-05 Thread Alexander Bokovoy

On Fri, 02 May 2014, Jakub Hrozek wrote:

On Wed, Apr 30, 2014 at 03:59:01PM +0200, Tomas Babej wrote:

Hi,

* patch 180 fixes incorrect hostname usage when connecting to legacy clients
* patch 181 sets up SSSD in debug_level 7 by default
* patch 182 does the same, but on the legacy clients

--
Tomas Babej
Associate Software Engineer | Red Hat | Identity Management
RHCE | Brno Site | IRC: tbabej | freeipa.org



ACK to the general intent of debug_level by default. Have you considered
using the python ConfigAPI sssd has to change the sections rather than
running a sed script?

I agree.

The patchset in current form does work fine for me in the tests.
However, I'd rather wait for a new revision which incorporates changes
requested by the Jakub.


--
/ Alexander Bokovoy

___
Freeipa-devel mailing list
Freeipa-devel@redhat.com
https://www.redhat.com/mailman/listinfo/freeipa-devel


Re: [Freeipa-devel] [PATCHES 180-182] ipatests: Improvements!

2014-05-02 Thread Jakub Hrozek
On Wed, Apr 30, 2014 at 03:59:01PM +0200, Tomas Babej wrote:
> Hi,
> 
> * patch 180 fixes incorrect hostname usage when connecting to legacy clients
> * patch 181 sets up SSSD in debug_level 7 by default
> * patch 182 does the same, but on the legacy clients
> 
> -- 
> Tomas Babej
> Associate Software Engineer | Red Hat | Identity Management
> RHCE | Brno Site | IRC: tbabej | freeipa.org 
> 

ACK to the general intent of debug_level by default. Have you considered
using the python ConfigAPI sssd has to change the sections rather than
running a sed script? 

___
Freeipa-devel mailing list
Freeipa-devel@redhat.com
https://www.redhat.com/mailman/listinfo/freeipa-devel


[Freeipa-devel] [PATCHES 180-182] ipatests: Improvements!

2014-04-30 Thread Tomas Babej
Hi,

* patch 180 fixes incorrect hostname usage when connecting to legacy clients
* patch 181 sets up SSSD in debug_level 7 by default
* patch 182 does the same, but on the legacy clients

-- 
Tomas Babej
Associate Software Engineer | Red Hat | Identity Management
RHCE | Brno Site | IRC: tbabej | freeipa.org 

>From 4e82db959974da9a66da7a379d13321a347c79c3 Mon Sep 17 00:00:00 2001
From: Tomas Babej 
Date: Thu, 10 Apr 2014 09:12:48 +0200
Subject: [PATCH] ipatests: Enable SSSD debugging on legacy clients with SSSD

---
 ipatests/test_integration/test_legacy_clients.py | 13 +++--
 1 file changed, 11 insertions(+), 2 deletions(-)

diff --git a/ipatests/test_integration/test_legacy_clients.py b/ipatests/test_integration/test_legacy_clients.py
index 71b266a946bd1113710f3e4da9b4dd79cd051624..b7fbd0165520aa4fbd951d422074dc09228856f0 100644
--- a/ipatests/test_integration/test_legacy_clients.py
+++ b/ipatests/test_integration/test_legacy_clients.py
@@ -429,9 +429,17 @@ class BaseTestLegacyClientNonPosix(BaseTestLegacyClient,
 pass
 
 
+class BaseTestSSSDMixin(object):
+
+def test_apply_advice(self):
+super(BaseTestSSSDMixin, self).test_apply_advice()
+tasks.setup_sssd_debugging(self.legacy_client)
+
+
 # Tests definitions themselves. Beauty. Just pure beauty.
 
-class TestLegacySSSDBefore19RedHatNonPosix(BaseTestLegacySSSDBefore19RedHat,
+class TestLegacySSSDBefore19RedHatNonPosix(BaseTestSSSDMixin,
+   BaseTestLegacySSSDBefore19RedHat,
BaseTestLegacyClientNonPosix):
 pass
 
@@ -446,7 +454,8 @@ class TestLegacyNssLdapRedHatNonPosix(BaseTestLegacyNssLdapRedHat,
 pass
 
 
-class TestLegacySSSDBefore19RedHatPosix(BaseTestLegacySSSDBefore19RedHat,
+class TestLegacySSSDBefore19RedHatPosix(BaseTestSSSDMixin,
+BaseTestLegacySSSDBefore19RedHat,
 BaseTestLegacyClientPosix):
 pass
 
-- 
1.8.5.3

>From 2d833452eabcf04c0a25ece9c7d3a632f656fe27 Mon Sep 17 00:00:00 2001
From: Tomas Babej 
Date: Wed, 9 Apr 2014 13:38:07 +0200
Subject: [PATCH] ipatests: Setup SSSD debugging mode by default

---
 ipatests/ipa-test-task | 11 +++
 ipatests/man/ipa-test-task.1   |  4 
 ipatests/test_integration/tasks.py | 28 
 3 files changed, 43 insertions(+)

diff --git a/ipatests/ipa-test-task b/ipatests/ipa-test-task
index 91bc8689cb63089069a8ce05396607fe4fbd032a..02a04b6ab3fabbefec0ea6b33e2d37b955e529f3 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 3f523569951c545c9e516f2c1775871d9653d58a..b034e4bd94a31a424cc484196d179fd663fbf982 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 a6c6f30d4c459de979f20aebd28276623ba2f700..ca5b44e4f0c877e35096fdbc46cfeb18bf89c947 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)
 
 ki