Re: [Freeipa-devel] [PATCHES] 0227-0229 freeipa-tests package Beaker integration plugin

2013-06-17 Thread Jan Cholasta

On 14.6.2013 16:01, Petr Viktorin wrote:

On 06/14/2013 03:20 PM, Jan Cholasta wrote:

Hi,

On 28.5.2013 17:55, Petr Viktorin wrote:

Hello,

Patch 0227 creates the freeipa-tests package.
As a system package, it needs a more unique name than tests, so I
renamed it to ipatests. I also changed imports and references to it.
Sorry to everyone developing tests right now ­– there will be conflicts,
but hopefully they'll be straightforward.
Note that the test suite does not yet pass when run outside the Git
tree. Work on that is ongoing but not a priority right now (it's more
important to get some integration tests running). Help would be
appreciated :)


Typo in commit message: Tename the 'tests' directory ...


Thanks for the catch!


The patch needs rebasing.


Attaching rebased versions.


Patch 0228 adds a wrapper based on make-test which runs the
system-installed test suite. freeipa-tests installs it as
/usr/bin/ipa-run-tests.
As I said above the tests currently fail when run this way.

Patch 0229 adds a Nose plugin for integration with BeakerLib[1]. When
the plugin is loaded (ipa-run-tests does that) and enabled (using the
--with-beakerlib option), it hooks into Nose and runs rlPhase*, rlPass,
rlFail and rlLog* Bash functions at appropriate events.



I still need to actually run the code, I will do that with your patches
230-240 included.


If I may suggest, please test this set by itself. The tests→ipatests
rename blocks or conflicts with other patches so it would be good to get
it in soon, without waiting on the integration testing review.




When I run make test I get the following error:

Traceback (most recent call last):
  File /usr/lib/python2.7/site-packages/nose/loader.py, line 413, in 
loadTestsFromName

addr.filename, addr.module)
  File /usr/lib/python2.7/site-packages/nose/importer.py, line 47, in 
importFromPath

return self.importFromDir(dir_path, fqname)
  File /usr/lib/python2.7/site-packages/nose/importer.py, line 94, in 
importFromDir

mod = load_module(part_fqname, fh, filename, desc)
  File 
/home/jcholast/freeipa/ipatests/test_xmlrpc/test_host_plugin.py, line 
59, in module

fd = open('tests/test_xmlrpc/service.crt', 'r')
IOError: [Errno 2] No such file or directory: 
'tests/test_xmlrpc/service.crt'


I believe the certificate path should begin with ipatests instead of 
tests.



When I run ipa-run-tests, I get an additional similar error in 
test_service_plugin.py:


Traceback (most recent call last):
  File /usr/lib/python2.7/site-packages/nose/loader.py, line 413, in 
loadTestsFromName

addr.filename, addr.module)
  File /usr/lib/python2.7/site-packages/nose/importer.py, line 47, in 
importFromPath

return self.importFromDir(dir_path, fqname)
  File /usr/lib/python2.7/site-packages/nose/importer.py, line 94, in 
importFromDir

mod = load_module(part_fqname, fh, filename, desc)
  File 
/usr/lib/python2.7/site-packages/ipatests/test_xmlrpc/test_service_plugin.py, 
line 42, in module

fd = open('ipatests/test_xmlrpc/service.crt', 'r')
IOError: [Errno 2] No such file or directory: 
'ipatests/test_xmlrpc/service.crt'



Also with ipa-run-tests, many of the cmdline tests are failing with:

Traceback (most recent call last):
  File /usr/lib/python2.7/site-packages/nose/case.py, line 381, in setUp
try_run(self.inst, ('setup', 'setUp'))
  File /usr/lib/python2.7/site-packages/nose/util.py, line 469, in 
try_run

return func()
  File 
/usr/lib/python2.7/site-packages/ipatests/test_cmdline/cmdline.py, 
line 58, in setUp

'Command %r not available' % self.command
AssertionError: Command 'ipa-client/ipa-getkeytab' not available


Honza

--
Jan Cholasta

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

[Freeipa-devel] [PATCH] 0037 Do not display traceback to user

2013-06-17 Thread Ana Krivokapic
Hello,

Logging tracebacks at the INFO level caused them to be displayed to user on the
command line. Change the log level to DEBUG, so that tracebacks are not visible
to user.

https://fedorahosted.org/freeipa/ticket/3704

-- 
Regards,

Ana Krivokapic
Associate Software Engineer
FreeIPA team
Red Hat Inc.

From 6af7238a489311e5a4b6167b9278a9df81aacbf4 Mon Sep 17 00:00:00 2001
From: Ana Krivokapic akriv...@redhat.com
Date: Mon, 17 Jun 2013 15:04:50 +0200
Subject: [PATCH] Do not display traceback to user

Logging tracebacks at the INFO level caused them to be displayed to user on the
command line. Change the log level to DEBUG, so that tracebacks are not visible
to user.

https://fedorahosted.org/freeipa/ticket/3704
---
 ipaserver/install/installutils.py | 9 -
 1 file changed, 4 insertions(+), 5 deletions(-)

diff --git a/ipaserver/install/installutils.py b/ipaserver/install/installutils.py
index 830a78a8bb805b6902114b7c1b826f25f842a3a7..278240f1e50da1ce24330b5897f41928044c0587 100644
--- a/ipaserver/install/installutils.py
+++ b/ipaserver/install/installutils.py
@@ -618,14 +618,13 @@ def run_script(main_function, operation_name, log_file_name=None,
 root_logger.info('The %s command was successful',
 operation_name)
 else:
-# Log at the INFO level, which is not output to the console
+# Log at the DEBUG level, which is not output to the console
 # (unless in debug/verbose mode), but is written to a logfile
 # if one is open.
 tb = sys.exc_info()[2]
-root_logger.info('\n'.join(traceback.format_tb(tb)))
-root_logger.info('The %s command failed, exception: %s: %s',
-operation_name, type(e).__name__, e)
-exception = e
+root_logger.debug('\n'.join(traceback.format_tb(tb)))
+root_logger.debug('The %s command failed, exception: %s: %s',
+  operation_name, type(e).__name__, e)
 if fail_message and not isinstance(e, SystemExit):
 print fail_message
 raise
-- 
1.8.1.4

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

Re: [Freeipa-devel] [PATCHES] 0227-0229 freeipa-tests package Beaker integration plugin

2013-06-17 Thread Jan Cholasta

On 17.6.2013 14:39, Jan Cholasta wrote:

On 14.6.2013 16:01, Petr Viktorin wrote:

On 06/14/2013 03:20 PM, Jan Cholasta wrote:

Hi,

On 28.5.2013 17:55, Petr Viktorin wrote:

Hello,

Patch 0227 creates the freeipa-tests package.
As a system package, it needs a more unique name than tests, so I
renamed it to ipatests. I also changed imports and references to it.
Sorry to everyone developing tests right now ­– there will be
conflicts,
but hopefully they'll be straightforward.
Note that the test suite does not yet pass when run outside the Git
tree. Work on that is ongoing but not a priority right now (it's more
important to get some integration tests running). Help would be
appreciated :)


Typo in commit message: Tename the 'tests' directory ...


Thanks for the catch!


The patch needs rebasing.


Attaching rebased versions.


Patch 0228 adds a wrapper based on make-test which runs the
system-installed test suite. freeipa-tests installs it as
/usr/bin/ipa-run-tests.
As I said above the tests currently fail when run this way.

Patch 0229 adds a Nose plugin for integration with BeakerLib[1]. When
the plugin is loaded (ipa-run-tests does that) and enabled (using the
--with-beakerlib option), it hooks into Nose and runs rlPhase*, rlPass,
rlFail and rlLog* Bash functions at appropriate events.



I still need to actually run the code, I will do that with your patches
230-240 included.


If I may suggest, please test this set by itself. The tests→ipatests
rename blocks or conflicts with other patches so it would be good to get
it in soon, without waiting on the integration testing review.




When I run make test I get the following error:

Traceback (most recent call last):
   File /usr/lib/python2.7/site-packages/nose/loader.py, line 413, in
loadTestsFromName
 addr.filename, addr.module)
   File /usr/lib/python2.7/site-packages/nose/importer.py, line 47, in
importFromPath
 return self.importFromDir(dir_path, fqname)
   File /usr/lib/python2.7/site-packages/nose/importer.py, line 94, in
importFromDir
 mod = load_module(part_fqname, fh, filename, desc)
   File
/home/jcholast/freeipa/ipatests/test_xmlrpc/test_host_plugin.py, line
59, in module
 fd = open('tests/test_xmlrpc/service.crt', 'r')
IOError: [Errno 2] No such file or directory:
'tests/test_xmlrpc/service.crt'

I believe the certificate path should begin with ipatests instead of
tests.


When I run ipa-run-tests, I get an additional similar error in
test_service_plugin.py:

Traceback (most recent call last):
   File /usr/lib/python2.7/site-packages/nose/loader.py, line 413, in
loadTestsFromName
 addr.filename, addr.module)
   File /usr/lib/python2.7/site-packages/nose/importer.py, line 47, in
importFromPath
 return self.importFromDir(dir_path, fqname)
   File /usr/lib/python2.7/site-packages/nose/importer.py, line 94, in
importFromDir
 mod = load_module(part_fqname, fh, filename, desc)
   File
/usr/lib/python2.7/site-packages/ipatests/test_xmlrpc/test_service_plugin.py,
line 42, in module
 fd = open('ipatests/test_xmlrpc/service.crt', 'r')
IOError: [Errno 2] No such file or directory:
'ipatests/test_xmlrpc/service.crt'


Also with ipa-run-tests, many of the cmdline tests are failing with:

Traceback (most recent call last):
   File /usr/lib/python2.7/site-packages/nose/case.py, line 381, in setUp
 try_run(self.inst, ('setup', 'setUp'))
   File /usr/lib/python2.7/site-packages/nose/util.py, line 469, in
try_run
 return func()
   File
/usr/lib/python2.7/site-packages/ipatests/test_cmdline/cmdline.py,
line 58, in setUp
 'Command %r not available' % self.command
AssertionError: Command 'ipa-client/ipa-getkeytab' not available


Honza



ipa-run-tests --with-beakerlib is horribly slow for me, is that expected?

Honza

--
Jan Cholasta

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

Re: [Freeipa-devel] [PATCH 0067] Add --use-posix option that forces trusted range type

2013-06-17 Thread Ana Krivokapic
On 06/06/2013 11:10 AM, Tomas Babej wrote:
 Hi,

 Adds --use-posix option to ipa trust-add command. It takes two
 allowed values:
 'yes' : the 'ipa-ad-trust-posix' range type is enforced
 'no' : the 'ipa-ad-trust' range type is enforced

 When --use-posix option is not specified, the range type should be
 determined by ID range discovery.

 https://fedorahosted.org/freeipa/ticket/3650

 Tomas


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

The patch works nicely, but I have a few comments:

1) You added a new option to the API, but you forgot to bump the
IPA_API_VERSION_MINOR in the VERSION file.

2) Typo in commit message: shold instead of should.

3) This construct:

+if range_type is not None:
+if range_type != old_range_type:

can be replaced with a more readable variant which also avoids nested ifs:

+if range_type and range_type != old_range_type:


4) Some unit tests to cover the behavior of the newly added option would be 
nice.

-- 
Regards,

Ana Krivokapic
Associate Software Engineer
FreeIPA team
Red Hat Inc.

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

Re: [Freeipa-devel] [PATCHES] 0227-0229 freeipa-tests package Beaker integration plugin

2013-06-17 Thread Jan Cholasta

On 17.6.2013 15:09, Jan Cholasta wrote:

On 17.6.2013 14:39, Jan Cholasta wrote:

On 14.6.2013 16:01, Petr Viktorin wrote:

On 06/14/2013 03:20 PM, Jan Cholasta wrote:

Hi,

On 28.5.2013 17:55, Petr Viktorin wrote:

Hello,

Patch 0227 creates the freeipa-tests package.
As a system package, it needs a more unique name than tests, so I
renamed it to ipatests. I also changed imports and references to it.
Sorry to everyone developing tests right now ­– there will be
conflicts,
but hopefully they'll be straightforward.
Note that the test suite does not yet pass when run outside the Git
tree. Work on that is ongoing but not a priority right now (it's more
important to get some integration tests running). Help would be
appreciated :)


Typo in commit message: Tename the 'tests' directory ...


Thanks for the catch!


The patch needs rebasing.


Attaching rebased versions.


Patch 0228 adds a wrapper based on make-test which runs the
system-installed test suite. freeipa-tests installs it as
/usr/bin/ipa-run-tests.
As I said above the tests currently fail when run this way.

Patch 0229 adds a Nose plugin for integration with BeakerLib[1]. When
the plugin is loaded (ipa-run-tests does that) and enabled (using the
--with-beakerlib option), it hooks into Nose and runs rlPhase*,
rlPass,
rlFail and rlLog* Bash functions at appropriate events.



I still need to actually run the code, I will do that with your patches
230-240 included.


If I may suggest, please test this set by itself. The tests→ipatests
rename blocks or conflicts with other patches so it would be good to get
it in soon, without waiting on the integration testing review.




When I run make test I get the following error:

Traceback (most recent call last):
   File /usr/lib/python2.7/site-packages/nose/loader.py, line 413, in
loadTestsFromName
 addr.filename, addr.module)
   File /usr/lib/python2.7/site-packages/nose/importer.py, line 47, in
importFromPath
 return self.importFromDir(dir_path, fqname)
   File /usr/lib/python2.7/site-packages/nose/importer.py, line 94, in
importFromDir
 mod = load_module(part_fqname, fh, filename, desc)
   File
/home/jcholast/freeipa/ipatests/test_xmlrpc/test_host_plugin.py, line
59, in module
 fd = open('tests/test_xmlrpc/service.crt', 'r')
IOError: [Errno 2] No such file or directory:
'tests/test_xmlrpc/service.crt'

I believe the certificate path should begin with ipatests instead of
tests.


When I run ipa-run-tests, I get an additional similar error in
test_service_plugin.py:

Traceback (most recent call last):
   File /usr/lib/python2.7/site-packages/nose/loader.py, line 413, in
loadTestsFromName
 addr.filename, addr.module)
   File /usr/lib/python2.7/site-packages/nose/importer.py, line 47, in
importFromPath
 return self.importFromDir(dir_path, fqname)
   File /usr/lib/python2.7/site-packages/nose/importer.py, line 94, in
importFromDir
 mod = load_module(part_fqname, fh, filename, desc)
   File
/usr/lib/python2.7/site-packages/ipatests/test_xmlrpc/test_service_plugin.py,

line 42, in module
 fd = open('ipatests/test_xmlrpc/service.crt', 'r')
IOError: [Errno 2] No such file or directory:
'ipatests/test_xmlrpc/service.crt'


Also with ipa-run-tests, many of the cmdline tests are failing with:

Traceback (most recent call last):
   File /usr/lib/python2.7/site-packages/nose/case.py, line 381, in
setUp
 try_run(self.inst, ('setup', 'setUp'))
   File /usr/lib/python2.7/site-packages/nose/util.py, line 469, in
try_run
 return func()
   File
/usr/lib/python2.7/site-packages/ipatests/test_cmdline/cmdline.py,
line 58, in setUp
 'Command %r not available' % self.command
AssertionError: Command 'ipa-client/ipa-getkeytab' not available


Honza



ipa-run-tests --with-beakerlib is horribly slow for me, is that expected?

Honza



Also I get the following failures with --with-beaker (in addition to the 
previously reported ones):



:: [   LOG] :: Nose test: test_help.test_ipa_help


:: [  ERROR   ] :: [ipa.ipalib.cli.cli] non-public: AttributeError: 
'API' object has no attribute 'parser'

:: [  ERROR   ] :: Traceback (most recent call last):
:: [  ERROR   ] ::   File 
/usr/lib/python2.7/site-packages/ipalib/backend.py, line 129, in execute

:: [  ERROR   ] :: result = self.Command[_name](*args, **options)
:: [  ERROR   ] ::   File 
/usr/lib/python2.7/site-packages/ipalib/frontend.py, line 435, in __call__

:: [  ERROR   ] :: ret = self.run(*args, **options)
:: [  ERROR   ] ::   File 
/usr/lib/python2.7/site-packages/ipalib/cli.py, line 765, in run

:: [  ERROR   ] :: self.api.parser.print_help(outfile)
:: [  ERROR   ] :: AttributeError: 'API' object has no attribute 'parser'
:: [  ERROR   ] :: Traceback (most recent call last):
:: [  ERROR   ] ::   File /usr/lib64/python2.7/unittest/case.py, line 
369, in run


Re: [Freeipa-devel] [PATCHES] 0227-0229 freeipa-tests package Beaker integration plugin

2013-06-17 Thread Jan Cholasta

On 17.6.2013 17:08, Petr Viktorin wrote:

We can fix individual out-of-tree failures later, the priority now is
that in-tree tests are not broken, and that the beakerlib plugin works.



Well, works just fine for me, so ACK.

Honza

--
Jan Cholasta

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


Re: [Freeipa-devel] [PATCHES] 0227-0229 freeipa-tests package Beaker integration plugin

2013-06-17 Thread Martin Kosek

On 06/17/2013 06:59 PM, Jan Cholasta wrote:

On 17.6.2013 17:08, Petr Viktorin wrote:

We can fix individual out-of-tree failures later, the priority now is
that in-tree tests are not broken, and that the beakerlib plugin works.



Well, works just fine for me, so ACK.

Honza



Thanks for review! I just had to merge freeipa.spec.in and update the changelog 
date to avoid making the strict RPM date checker angry.


Pushed all 3 to master.

Martin

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


Re: [Freeipa-devel] [PATCHES] 0227-0229 freeipa-tests package Beaker integration plugin

2013-06-17 Thread Dmitri Pal
On 06/17/2013 11:08 AM, Petr Viktorin wrote:
 ipa-run-tests --with-beakerlib is horribly slow for me, is that
 expected?

 Yes. For every logged line, BeakerLib's default logging backend starts
 up Python, parses a XML file, appends the line, and writes the XML out
 again. So especially with longer runs it's really slow.

Is there any way to solve this problem?
For example send the output over the DBUS to a special service that
would have the python already loaded and would do the appending to the
files and writing the output.
Also there can be an optimization that it would not save the file up
until the change affects a different file.

The logic would be:

loop:
   If do not have an open output file open one and keep it in memory
   Read a request for update until receive a special message for
termination or a signal, then break out of the loop
   If the request for update for the same file update the file
   Else save currently open file and start a new one, add data to the
newly started file
end
close currently open file
  
If we need this cross systems we can do AMQP. I bet this would be powers
of magnitude faster.

-- 
Thank you,
Dmitri Pal

Sr. Engineering Manager for IdM portfolio
Red Hat Inc.


---
Looking to carve out IT costs?
www.redhat.com/carveoutcosts/



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