Re: [Spacewalk-devel] [PATCH] fixing other python tests

2014-02-13 Thread Flavio Castelli
On 13/02/14 15:42, Flavio Castelli wrote: I just realized I forgot to push this small patch upstream. Here we go again, I forgot another patch :) Flavio From 64c7ed901c1faeb2167251d1e7ca8fe1c9e2c90a Mon Sep 17 00:00:00 2001 From: Flavio Castelli fcaste...@suse.com Date: Wed, 15 Jan 2014 11

[Spacewalk-devel] Behind the scenes: how SUSE tests spacewalk

2014-02-05 Thread Flavio Castelli
I've been procrastinating this mail for quite some time, but the recent discussion about the quality of patches moved this task on the top of my TODO list. The purpose of this mail is to illustrate the recent changes made to our testing infrastructure. I'll give you a little background

Re: [Spacewalk-devel] [PATCHES] More work on the python tests

2014-01-21 Thread Flavio Castelli
On 20/01/14 10:16, Michael Mraka wrote: Great job. Thank you for fixing the tests. I've reviewed and committed them to master. That's great news. Did you have a chance to look at the few tests which are still broken? As I said in my previous mail I'm running out of ideas... Cheers Flavio

[Spacewalk-devel] [PATCH] Add contents of tasko/sat to the output of spacewalk-debug

2014-01-16 Thread Flavio Castelli
This is a simple patch which adds /var/log/tasko/sat to the tarball created by spacewalk-debug. Cheers Flavio ___ Spacewalk-devel mailing list Spacewalk-devel@redhat.com https://www.redhat.com/mailman/listinfo/spacewalk-devel

[Spacewalk-devel] [PATCH] Added extra log folder to spacewalk-debug

2014-01-16 Thread Flavio Castelli
Add extra log folder /var/log/rhn/tasko/sat/ in spacewalk-debug. --- backend/satellite_tools/spacewalk-debug | 6 ++ 1 file changed, 6 insertions(+) diff --git a/backend/satellite_tools/spacewalk-debug b/backend/satellite_tools/spacewalk-debug index 31b952f..83c8b40 100755 ---

[Spacewalk-devel] [PATCHES] More work on the python tests

2014-01-15 Thread Flavio Castelli
These commits bring back to life 39 python tests which have been left unmaintained for quite a long time. While fixing and improving the tests I also took the chance to move some of them to better locations. I tried to be consistent with what has been done in other parts of the code base. All

[Spacewalk-devel] [PATCH 12/28] python test_log.py: switched to db_settings.ini

2014-01-15 Thread Flavio Castelli
Changed the test to use the db connection params written inside of db_settings.ini. --- backend/server/test/unit-test/rhnSQL/test_lob.py | 11 +-- 1 file changed, 9 insertions(+), 2 deletions(-) diff --git a/backend/server/test/unit-test/rhnSQL/test_lob.py

[Spacewalk-devel] [PATCH 08/28] python oracle driver: fixed bug inside Procedure

2014-01-15 Thread Flavio Castelli
The `_munge_arg` method of `Procedure` was broken because: * it referenced the old `self.proc` variable which is long gone. * it always converted all the arguments to the 1st sqltype (which happened to be `sql_types.NUMERIC`). This commit fixes the `test_new_org_1` test inside of

[Spacewalk-devel] [PATCH 14/28] python: fixed issue inside of Oracle driver

2014-01-15 Thread Flavio Castelli
The function which mapped store procedures and functions return types to rhnSQL's own types didn't process all the known types. In fact it exited immediately if the first comparison didn't pass. --- backend/server/rhnSQL/driver_cx_Oracle.py | 6 -- 1 file changed, 4 insertions(+), 2

[Spacewalk-devel] [PATCH 02/28] python tests: remove useless files

2014-01-15 Thread Flavio Castelli
All these files are empty except for `setpath.py` which is not being used. --- backend/test/unit/spacewalk/__init__.py| 0 backend/test/unit/spacewalk/test/__init__.py | 0 .../test/unit/spacewalk/test/server/__init__.py| 0 backend/test/unit/spacewalk/test/setpath.py

[Spacewalk-devel] [PATCH 06/28] python: fixed error caused by the audit feature

2014-01-15 Thread Flavio Castelli
Ensure the audit log table is cleared. --- backend/server/test/unit-test/rhnSQL/test_misc_functions.py | 1 + 1 file changed, 1 insertion(+) diff --git a/backend/server/test/unit-test/rhnSQL/test_misc_functions.py b/backend/server/test/unit-test/rhnSQL/test_misc_functions.py index

[Spacewalk-devel] [PATCH 23/28] python tests: fixed 'create_new_user' helper

2014-01-15 Thread Flavio Castelli
Fixed the 'create_new_user' helper function: removed calls to no longer available variables, added support for encrypted passwords and fixed password validation when encrypted passwords are not toggled. --- backend/server/test/unit-test/rhnSQL/misc_functions.py | 18 -- 1 file

[Spacewalk-devel] [PATCH 03/28] python test: moved non-unit test files to proper location

2014-01-15 Thread Flavio Castelli
--- backend/server/test/cx_create_table.py | 68 backend/server/test/test_capabilities.py | 94 ++ backend/server/test/unit-test/cx_create_table.py | 68 backend/server/test/unit-test/test_capabilities.py | 94

[Spacewalk-devel] [PATCH 25/28] python rhnSQL: proper cleanup after connection error

2014-01-15 Thread Flavio Castelli
Ensured the global database instance initialized by rhnSQL is not reused when there's a database connection error. The bug emerged while running the whole test suite: all the tests executed after `test_exceptions` failed because they weren't able to connect to the database. ---

[Spacewalk-devel] [PATCH 21/28] python test: fixed create_new_user helper function

2014-01-15 Thread Flavio Castelli
The previous code was no longer working. --- .../server/test/unit-test/rhnSQL/misc_functions.py | 76 +++--- 1 file changed, 67 insertions(+), 9 deletions(-) diff --git a/backend/server/test/unit-test/rhnSQL/misc_functions.py

[Spacewalk-devel] [PATCH 27/28] python tests: load db settings from conf file

2014-01-15 Thread Flavio Castelli
Updated the `test_server_registration` to load the db connection settings from a configuration file. --- backend/server/test/unit-test/rhnSQL/test_server_registration.py | 9 +++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git

[Spacewalk-devel] [PATCH 16/28] ptyhon test_1.py: fixed 'test_function_1'

2014-01-15 Thread Flavio Castelli
Changed the test checking the return value of a sql function to use a function which does not require testing data to be added to the db. --- backend/server/test/unit-test/rhnSQL/test_1.py | 8 1 file changed, 4 insertions(+), 4 deletions(-) diff --git

[Spacewalk-devel] [PATCH 10/28] python test_exceptions.py: fixed broken test

2014-01-15 Thread Flavio Castelli
Call the db connection helper using the right parameters. --- .../server/test/unit-test/rhnSQL/test_exceptions.py | 19 ++- 1 file changed, 18 insertions(+), 1 deletion(-) diff --git a/backend/server/test/unit-test/rhnSQL/test_exceptions.py

[Spacewalk-devel] [PATCH 17/28] python test_1.py: fixed 'test_procedure_1'

2014-01-15 Thread Flavio Castelli
Fixed more tests by using the right signature when calling the store procedure chosen by the tests. --- backend/server/test/unit-test/rhnSQL/test_1.py | 10 ++ 1 file changed, 2 insertions(+), 8 deletions(-) diff --git a/backend/server/test/unit-test/rhnSQL/test_1.py

[Spacewalk-devel] [PATCH 18/28] python test_1.py: fixed row count test

2014-01-15 Thread Flavio Castelli
Ensured the table used by the test is available, plus dropped it on exit. Changed the test to use prepared statements rather than straight 'execute'. The latter does not return any information about the number of items added/removed from the table. Moreover the code used on production which does

[Spacewalk-devel] [PATCH 13/28] python: fixed broken test

2014-01-15 Thread Flavio Castelli
Made possible to run test_rhnServerGroup without any error. --- .../test/unit-test/rhnSQL/test_rhnServerGroup.py | 20 1 file changed, 16 insertions(+), 4 deletions(-) diff --git a/backend/server/test/unit-test/rhnSQL/test_rhnServerGroup.py

[Spacewalk-devel] [PATCH 20/28] python test: fixed test_rhnChannel

2014-01-15 Thread Flavio Castelli
All the test are passing now. --- .../test/unit-test/rhnSQL/test_rhnChannel.py | 30 +++--- 1 file changed, 26 insertions(+), 4 deletions(-) diff --git a/backend/server/test/unit-test/rhnSQL/test_rhnChannel.py b/backend/server/test/unit-test/rhnSQL/test_rhnChannel.py index

[Spacewalk-devel] [PATCH 07/28] python: fixed create org helper

2014-01-15 Thread Flavio Castelli
The python code didn't invoke the stored procedure with the right arguments. --- backend/server/test/attic/rhnServerGroup.py | 12 1 file changed, 8 insertions(+), 4 deletions(-) diff --git a/backend/server/test/attic/rhnServerGroup.py b/backend/server/test/attic/rhnServerGroup.py

[Spacewalk-devel] [PATCH 19/28] python test_1.py: fixed 'execption procedure' test

2014-01-15 Thread Flavio Castelli
Changed the test to expect the right type of exception. --- backend/server/test/unit-test/rhnSQL/test_1.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/backend/server/test/unit-test/rhnSQL/test_1.py b/backend/server/test/unit-test/rhnSQL/test_1.py index 6a7c076..be121e1

[Spacewalk-devel] [PATCH 28/28] python tests: initial work on test_server_registration

2014-01-15 Thread Flavio Castelli
Started to fix some of the broken tests defined inside of `test_server_registration`. --- .../server/test/unit-test/rhnSQL/misc_functions.py | 174 +++-- .../unit-test/rhnSQL/test_server_registration.py | 117 +- 2 files changed, 235 insertions(+), 56 deletions(-)

[Spacewalk-devel] [PATCH 26/28] python tests: fixed rhnsql-tests

2014-01-15 Thread Flavio Castelli
Updated the inline documentation of the `convert_named_query_params` to reflect the changes made to its API. Updated the rhnsql-tests to the new API. --- backend/server/rhnSQL/driver_postgresql.py | 6 + .../server/test/unit-test/rhnSQL/rhnsql-tests.py | 31 +-

[Spacewalk-devel] [PATCH 15/28] python tests: initial work on test_1.py

2014-01-15 Thread Flavio Castelli
* Read db connection settings from the db_settings.ini file. * Ensure audit loggin feature won't cause failures. --- backend/server/test/unit-test/rhnSQL/test_1.py | 12 ++-- 1 file changed, 10 insertions(+), 2 deletions(-) diff --git a/backend/server/test/unit-test/rhnSQL/test_1.py

Re: [Spacewalk-devel] [Patch] Client registration via proxy crashes

2013-12-17 Thread Flavio Castelli
On 17/12/13 10:17, Flavio Castelli wrote: Fixed an error raised during the client registration via proxy when 'X-RHN-IP-Path' header is not set. This regression has been introduced by commit 251005196b02b. I found another issue later in the same part of the code. If you want I can merge

[Spacewalk-devel] Python server: better logging of exceptions

2013-11-12 Thread Flavio Castelli
Castelli SUSE LINUX Products GmbH Maxfeldstraße 5, 90409 Nürnberg Germany From 30cd21a0d00a4c7fae72bbf1f2aebe530117359a Mon Sep 17 00:00:00 2001 From: Flavio Castelli fcaste...@suse.com Date: Tue, 12 Nov 2013 11:40:39 +0100 Subject: [PATCH] python server: better logging of exceptions Ensured all

[Spacewalk-devel] [PATCH 2/2] Another update to spacewalk-repo-sync's man page

2013-10-22 Thread Flavio Castelli
Added another missin option to spacewalk-repo-sync's man page. Now all the cli options are mentioned inside of the man page. --- backend/satellite_tools/spacewalk-repo-sync.sgml | 11 +++ 1 file changed, 11 insertions(+) diff --git a/backend/satellite_tools/spacewalk-repo-sync.sgml

[Spacewalk-devel] [PATCH 1/2] bnc#846351: updated spacewalk-repo-sync's man page

2013-10-22 Thread Flavio Castelli
Added the previously undocumented -Y, --deep-verify option to spacewalk-repo-sync's man page. This fixes bnc#846351. --- backend/satellite_tools/spacewalk-repo-sync.sgml | 11 +++ 1 file changed, 11 insertions(+) diff --git a/backend/satellite_tools/spacewalk-repo-sync.sgml

Re: [Spacewalk-devel] Update spacewalk-repo-sync man page

2013-10-22 Thread Flavio Castelli
these features are missing from upstream. Unfortunately it does not make sense to upstream them because they are too SUSE specific. Cheers Flavio -- Flavio Castelli SUSE LINUX Products GmbH Maxfeldstraße 5, 90409 Nürnberg Germany ___ Spacewalk-devel mailing

[Spacewalk-devel] Python Oracle tests up and running

2013-10-18 Thread Flavio Castelli
These patches are pretty similar to the ones I sent some weeks ago covering the PostgreSQL tests. All the Oracle tests are running fine either by invoking the `runtests-oracle.py` directly or by using nosetests. ___ Spacewalk-devel mailing list

[Spacewalk-devel] [PATCH 1/4] python oracle tests: fixed import statements

2013-10-18 Thread Flavio Castelli
Fixed the import statements. This makes possible to run the test suite. --- backend/test/runtests-oracle.py | 9 + 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/backend/test/runtests-oracle.py b/backend/test/runtests-oracle.py index cb5f97a..c13f70f 100755 ---

[Spacewalk-devel] [PATCH 2/4] python oracle tests: moved connection settings to configuration file

2013-10-18 Thread Flavio Castelli
Moved all the Oracle connection settings to the db_settings.ini file (like we already do with the PostgreSQL's values). --- backend/test/db_settings.ini| 4 backend/test/runtests-oracle.py | 10 +++--- 2 files changed, 11 insertions(+), 3 deletions(-) diff --git

[Spacewalk-devel] [PATCH 4/4] python oracle tests: better integration with nosetest

2013-10-18 Thread Flavio Castelli
Made easier to run python oracle tests using nosetest. --- backend/test/non-unit/server/rhnSQL/dbtests.py | 38 -- backend/test/runtests-oracle.py| 37 +++-- 2 files changed, 34 insertions(+), 41 deletions(-) diff --git

[Spacewalk-devel] [PATCH 3/4] python pgsql driver: behave like the oracle one

2013-10-18 Thread Flavio Castelli
Ensure the PostgreSQL driver raises a `sql_base.SQLError` when a cursor executes a query which has unbound variables. This makes the behaviour of the PostgreSQL driver consistent with the Oracle one. --- backend/server/rhnSQL/driver_postgresql.py | 4

[Spacewalk-devel] [PATCH] python pgsql tests: made easier Jenkins integration

2013-10-15 Thread Flavio Castelli
Made easier to run the pgsql tests using nosetests in conjunction with the 'with-xunit'. Invoking: nosetests --with-xunit --xunit-file pgsql_tests.xml runtests-postgresql.py will produce an xml file which can be parsed by Jenkins. Invoking the script in the old way still works as expected.

[Spacewalk-devel] [PATCH 2/6] Python db tests: moved connection settings to dedicated file

2013-10-04 Thread Flavio Castelli
Moved PostgreSQL connection settings into a dedicated configuration file. This makes easier to use different connection parameters since it's no longer needed to change the python source code. --- backend/test/db_settings.ini| 5 + backend/test/runtests-postgresql.py | 12

[Spacewalk-devel] [PATCH 3/6] Python pgsql driver: handled ProgrammingError exceptions

2013-10-04 Thread Flavio Castelli
Handled psycopg2.ProgramminError exceptions inside of the python pgsql driver. Raise them as sql_base.SQLStatementPrepareError. This is commit fixes the 'test_statement_prepare_error' test. --- backend/server/rhnSQL/driver_postgresql.py | 2 ++ 1 file changed, 2 insertions(+) diff --git

[Spacewalk-devel] [PATCH 1/6] Fixed script which runs python PostgreSQL tests

2013-10-04 Thread Flavio Castelli
The script which starts the python PostgreSQL tests was broken because it didn't find some required resources, plus it looked for files/directories which are no longer available. --- backend/test/runtests-postgresql.py | 9 + 1 file changed, 5 insertions(+), 4 deletions(-) diff --git

[Spacewalk-devel] [PATCHES] Some work on the python PostgreSQL tests

2013-10-04 Thread Flavio Castelli
into the tests interacting with Oracle, that's my next step. Thanks in advance Flavio Castelli -- SUSE LINUX Products GmbH Maxfeldstraße 5, 90409 Nürnberg Germany ___ Spacewalk-devel mailing list Spacewalk-devel@redhat.com https://www.redhat.com/mailman

[Spacewalk-devel] [PATCH 5/6] Python: fixed UserDictCase behaviour when key is not found

2013-10-04 Thread Flavio Castelli
The `UserDictCase` class is a dictionary with case insensitive keys. Since it's inherited from `UserDict` it can be passed to method/functions expecting a classic python dictionary. Unfortunately `UserDictCase` behaved in a different way when the specified key was not found: rather than raising a

[Spacewalk-devel] [PATCH 4/6] Fixed errors inside of the python pgsql test suite.

2013-10-04 Thread Flavio Castelli
Wrapped the 'test_statement_prepare_error' test inside of a transaction, that leaves the database in a clean state after the `rhnSQL.SQLStatementPrepareError` exception is raised. --- backend/test/non-unit/server/rhnSQL/dbtests.py | 5 - 1 file changed, 4 insertions(+), 1 deletion(-) diff

[Spacewalk-devel] [PATCH] fix python gettext_test

2013-08-06 Thread Flavio Castelli
The following patch fixes the execution of the gettext_test. Cheers Flavio -- Flavio Castelli SUSE LINUX Products GmbH Maxfeldstraße 5, 90409 Nürnberg Germany From 98924fbd477e5071c5bfc3ea609df517f0099fe3 Mon Sep 17 00:00:00 2001 From: Flavio Castelli fcaste...@suse.com Date: Tue, 23 Jul 2013 16