Commit Graph

102 Commits

Author SHA1 Message Date
Christian Heimes
dd6b72e418 pytest 3.x compatibility
pytest 3.x does no longer support plain pytest.skip() on module level.

Signed-off-by: Christian Heimes <cheimes@redhat.com>
Reviewed-By: Martin Basti <mbasti@redhat.com>
2017-03-27 18:03:14 +02:00
Christian Heimes
fd1b4f6ec9 Add options to run only ipaclient unittests
A new option for ipa-run-tests makes the test runner ignore
subdirectories or skips tests that depend on the ipaserver package or on
a running framework for RPC integration tests. The new option enables
testing of client-only builds.

$ ipatests/ipa-run-tests --ipaclient-unittests
...
platform linux2 -- Python 2.7.13, pytest-2.9.2, py-1.4.32, pluggy-0.3.1
rootdir: /home/heimes/redhat, inifile: tox.ini
plugins: sourceorder-0.5, cov-2.3.0, betamax-0.7.1, multihost-1.1
collected 451 items

test_util.py ........
util.py ..
test_ipaclient/test_csrgen.py ..............ssss...
test_ipalib/test_aci.py ...................
test_ipalib/test_backend.py ........
test_ipalib/test_base.py ...............
test_ipalib/test_capabilities.py .
test_ipalib/test_cli.py ...
test_ipalib/test_config.py ...............
test_ipalib/test_crud.py ...............
test_ipalib/test_errors.py .......
test_ipalib/test_frontend.py ........................................
test_ipalib/test_messages.py ....
test_ipalib/test_output.py ...
test_ipalib/test_parameters.py .............................................................
test_ipalib/test_plugable.py ........
test_ipalib/test_rpc.py ......ssssssss
test_ipalib/test_text.py .............................
test_ipalib/test_x509.py ...
test_ipapython/test_cookie.py ............
test_ipapython/test_dn.py ...........................
test_ipapython/test_ipautil.py ..................................................................
test_ipapython/test_ipavalidate.py ..........
test_ipapython/test_kerberos.py ..............
test_ipapython/test_keyring.py ..........
test_ipapython/test_ssh.py ...............................
test_pkcs10/test_pkcs10.py .....

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

Signed-off-by: Christian Heimes <cheimes@redhat.com>
Reviewed-By: Martin Babinsky <mbabinsk@redhat.com>
2017-03-17 15:02:13 +01:00
Pavel Vomacka
f952757484 TESTS WebUI: Vaults management
Bunch of tests for WebUI Vault Management.

Covers:
Adding vaults
Modifying vaults
Adding members and owners to all types of vaults

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

Reviewed-By: Martin Basti <mbasti@redhat.com>
Reviewed-By: Petr Vobornik <pvoborni@redhat.com>
2017-03-14 10:40:10 +01:00
Pavel Vomacka
0808504ba1 TESTS: Add support for sidebar with facets
Part of: https://fedorahosted.org/freeipa/ticket/5426

Reviewed-By: Martin Basti <mbasti@redhat.com>
Reviewed-By: Petr Vobornik <pvoborni@redhat.com>
2017-03-14 10:40:10 +01:00
Pavel Vomacka
ab8c69f4c6 TESTS: Add support for KRA in ui_driver
https://fedorahosted.org/freeipa/ticket/5426

Reviewed-By: Martin Basti <mbasti@redhat.com>
Reviewed-By: Petr Vobornik <pvoborni@redhat.com>
2017-03-14 10:40:10 +01:00
Pavel Vomacka
6e475988e1 TESTS: Update group type name
As the group type has been changed from 'normal' to 'nonposix' we need to update
this information also in tests.

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

Reviewed-By: Martin Basti <mbasti@redhat.com>
2016-11-14 18:08:15 +01:00
Jan Cholasta
0d370a959b pylint: enable the import-error check
Check for import errors with pylint to make sure new python package
dependencies are not overlooked.

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

Reviewed-By: Petr Spacek <pspacek@redhat.com>
Reviewed-By: Martin Basti <mbasti@redhat.com>
2016-10-24 14:11:08 +02:00
Martin Basti
9d83be3647 Remove unused variables in tests
This commit removes or marks unused variables as "expected to be unused"
by using '_' prefix.

Reviewed-By: Florence Blanc-Renaud <frenaud@redhat.com>
Reviewed-By: Stanislav Laznicka <slaznick@redhat.com>
2016-09-27 13:35:58 +02:00
Jan Barta
275e85d076 pylint: fix unneeded-not
Reviewed-By: Tomas Krizek <tkrizek@redhat.com>
Reviewed-By: Florence Blanc-Renaud <frenaud@redhat.com>
2016-09-22 16:52:57 +02:00
tester
5f5203eb62 TEST: managing service certificates
Part of: https://fedorahosted.org/freeipa/ticket/6064

Reviewed-By: Lenka Doudova <ldoudova@redhat.com>
2016-08-01 17:07:49 +02:00
tester
20e8cef394 TEST: managing host certificates
Parf of: https://fedorahosted.org/freeipa/ticket/6064

Reviewed-By: Lenka Doudova <ldoudova@redhat.com>
2016-08-01 17:07:49 +02:00
tester
37c0bd1dd6 TEST: managing user certificates
Part of: https://fedorahosted.org/freeipa/ticket/6064

Reviewed-By: Lenka Doudova <ldoudova@redhat.com>
2016-08-01 17:07:49 +02:00
Pavel Vomacka
45825b84b0 Add function which check whether the field is empty
Part of: https://fedorahosted.org/freeipa/ticket/6064

Reviewed-By: Lenka Doudova <ldoudova@redhat.com>
2016-08-01 17:07:49 +02:00
tester
26803a0d17 Add possibility to choose parent element by css
Part of: https://fedorahosted.org/freeipa/ticket/6064

Reviewed-By: Lenka Doudova <ldoudova@redhat.com>
2016-08-01 17:07:49 +02:00
Pavel Vomacka
41ace68e04 Set default delete action name to 'delete'
Only specific delete actions will be explicitely set.

Part of: https://fedorahosted.org/freeipa/ticket/6052

Reviewed-By: Lenka Doudova <ldoudova@redhat.com>
2016-07-27 19:23:28 +02:00
Pavel Vomacka
73ef15ccb4 Fix test which checks removing of user
The name of delete action is now 'delete_active_user' not just 'delete' therefore
tests needs to be fixed.

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

Reviewed-By: Lenka Doudova <ldoudova@redhat.com>
2016-07-27 19:22:30 +02:00
Pavel Vomacka
9f94a5f7ba Fix test_navigation tests
Some menu item names has changed. This commit sets the correct names.

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

Reviewed-By: Lenka Doudova <ldoudova@redhat.com>
2016-07-27 19:21:11 +02:00
Pavel Vomacka
8c07568c0b Remove navigation using breadcrumb menus
https://fedorahosted.org/freeipa/ticket/6054

Reviewed-By: Lenka Doudova <ldoudova@redhat.com>
2016-07-27 19:18:40 +02:00
Lenka Doudova
6468a39850 WebUI: Test creating user without private group
Test for option to create a user without private group in web UI.

Covers ticket https://fedorahosted.org/freeipa/ticket/5804

Reviewed-By: Pavel Vomacka <pvomacka@redhat.com>
2016-04-15 10:17:20 +02:00
Martin Basti
da0318d4d7 Pylint: remove unnecessary-semicolon
Reviewed-By: Petr Spacek <pspacek@redhat.com>
Reviewed-By: Lukas Slebodnik <lslebodn@redhat.com>
2016-03-22 10:20:51 +01:00
Lenka Doudova
904db149e9 WebUI test: ID views
Provides missing test coverage for ID views web UI.

Reviewed-By: Pavel Vomacka <pvomacka@redhat.com>
2016-03-11 11:52:25 +01:00
Lenka Doudova
a3f8e8e71f WebUI tests: fix failing of tests due to unclicable label
Checkbox label is no longer clickable, most tests fail with error like this:

AssertionError: Can't click on checkbox label: table.table
Message: Element is not clickable at point (37, 340.3999938964844). Other element would receive the click:
<input class="standalone" id="cn18" value="itest-group" name="cn" type="checkbox">

The checkbox is clickable directly without the label, this patch provides according fix.

Reviewed-By: Petr Vobornik <pvoborni@redhat.com>
2016-02-23 10:11:22 +01:00
Martin Basti
e4075b1fe2 Remove unused imports
This patch removes unused imports, alse pylint has been configured to
check unused imports.

Reviewed-By: Jan Cholasta <jcholast@redhat.com>
2015-12-23 07:59:22 +01:00
Milan Kubik
0a64e9bd70 Applied tier0 and tier1 marks on unit tests and xmlrpc tests
Web UI tests were marked as tier1 tests.

The tier system is intended to be used together with CI system
to make sure the more complicated tests are being run only
when all of the basic functionality is working.

The system is using pytest's marker system. E.g. an invocation of
all tier1 tests with listing will look like:

    $ py.test -v -m tier1 ipatests

or in case of out of tree tests:

    $ ipa-run-tests -m tier1

Reviewed-By: Ales 'alich' Marecek <amarecek@redhat.com>
2015-11-09 11:49:17 +01:00
Petr Viktorin
70b37a956c Use six.moves.urllib instead of urllib/urllib2/urlparse
In Python 3, these modules are reorganized.

Reviewed-By: David Kupka <dkupka@redhat.com>
Reviewed-By: Jan Cholasta <jcholast@redhat.com>
Reviewed-By: Martin Basti <mbasti@redhat.com>
2015-10-07 10:27:20 +02:00
Petr Viktorin
8de13bd7dd Use the print function
In Python 3, `print` is no longer a statement. Call it as a function
everywhere, and include the future import to remove the statement
in Python 2 code as well.

Reviewed-By: Christian Heimes <cheimes@redhat.com>
Reviewed-By: Jan Cholasta <jcholast@redhat.com>
2015-09-01 11:42:01 +02:00
Petr Viktorin
3bf91eab25 Use Python3-compatible dict method names
Python 2 has keys()/values()/items(), which return lists,
iterkeys()/itervalues()/iteritems(), which return iterators,
and viewkeys()/viewvalues()/viewitems() which return views.

Python 3 has only keys()/values()/items(), which return views.
To get iterators, one can use iter() or a for loop/comprehension;
for lists there's the list() constructor.

When iterating through the entire dict, without modifying the dict,
 the difference between Python 2's items() and iteritems() is
negligible, especially on small dicts (the main overhead is
extra memory, not CPU time). In the interest of simpler code,
this patch changes many instances of iteritems() to items(),
iterkeys() to keys() etc.

In other cases, helpers like six.itervalues are used.

Reviewed-By: Christian Heimes <cheimes@redhat.com>
Reviewed-By: Jan Cholasta <jcholast@redhat.com>
2015-09-01 11:42:01 +02:00
Petr Viktorin
27dabb4528 Modernize 'except' clauses
The 'as' syntax works from Python 2 on, and Python 3 will
drop the "comma" syntax.

Reviewed-By: Tomas Babej <tbabej@redhat.com>
2015-08-12 18:17:23 +02:00
Petr Vobornik
5fadee969c webui-ci: fix type error in host_tasks inicializations
host_tasks initializations were not modified along with pytest migration

Reviewed-By: Martin Babinsky <mbabinsk@redhat.com>
2015-05-12 12:47:45 +02:00
Petr Vobornik
a1ccdc33df webui-ci: do not open 2 browser windows
Reviewed-By: Milan Kubik <mkubik@redhat.com>
2015-05-07 10:45:48 +02:00
Gabe
d1a0474d18 Unsaved changes dialog internally inconsistent
https://fedorahosted.org/freeipa/ticket/4926

Reviewed-By: Petr Vobornik <pvoborni@redhat.com>
2015-05-07 10:38:26 +02:00
Petr Vobornik
f70d859b39 webui: use domain name instead of domain SID in idrange adder dialog
It's more user friendly. Almost nobody remembers SIDs.

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

Reviewed-By: Tomas Babej <tbabej@redhat.com>
2014-11-24 14:43:09 +01:00
Petr Viktorin
82e41dc7a4 test_webui: Don't use __init__ for test classes
https://fedorahosted.org/freeipa/ticket/4610

Reviewed-By: Tomas Babej <tbabej@redhat.com>
2014-11-21 12:14:44 +01:00
Petr Viktorin
375e9f7c4b tests: Use PEP8-compliant setup/teardown method names
The setUp/dearDown names are used in the unittest module, but there is no reason
to use them in non-`unittest` test cases.
Nose supports both styles (but mixing them can cause trouble when
calling super()'s methods).
Pytest only supports the new ones.

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

Reviewed-By: Tomas Babej <tbabej@redhat.com>
2014-11-21 12:14:44 +01:00
Petr Vobornik
81e4cac5cd webui-ci: adjust dnszone-add test to recent DNS changes
'idnssoamname', 'ip_address' and 'force' fields were removed from DNS zone adder dialog in #4149

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

Reviewed-By: Martin Kosek <mkosek@redhat.com>
2014-10-03 12:21:16 +02:00
Petr Vobornik
dafdd68a6e webui-ci: case-insensitive record check
Indirect association are no longer lower cased, which caused a issue in CI.

Reviewed-By: Endi Sukma Dewata <edewata@redhat.com>
2014-09-25 10:27:31 +02:00
Petr Vobornik
a3c51e2383 webui-ci: fix table widget add
add_table_record call used old selector for add button which
caused 3 fails in CI:
- ERROR: Test automember rebuild membership feature for hosts
- ERROR: Test automember rebuild membership feature for users
- ERROR: Basic CRUD: dns

related to:
https://fedorahosted.org/freeipa/ticket/4258

Reviewed-By: Endi Sukma Dewata <edewata@redhat.com>
2014-08-20 10:42:57 +02:00
Petr Vobornik
80733bff15 webui-ci: fix reset password check
After login, CI checks if password needs a reset by checking if
reset password fields are displayed. This check failed since
login facet was removed from DOM after successful auth. Weakening
the selector fixes it.

Reviewed-By: Petr Viktorin <pviktori@redhat.com>
2014-07-31 12:02:58 +02:00
Petr Vobornik
3966417779 webui: replace action_buttons with action_widget
Simplify code base by reuse of 'disable' feature of button_widget. All
occurrences of action-button which were disabled/enabled were replaced
by button-widget.

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

Reviewed-By: Endi Sukma Dewata <edewata@redhat.com>
2014-07-28 10:24:21 +02:00
Petr Vobornik
b68f819de7 webui: improve usability of attributes widget
Attributes widget layour was changed from tiny table which allowed
to display only few options to a checkbox list with multiple
columns (depends on container).

Check all attributes option was removed to force the user
to read through the attributes which he selects.

Initial version authored by: Adam Misnyovszki

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

Reviewed-By: Endi Sukma Dewata <edewata@redhat.com>
2014-07-21 10:47:06 +02:00
Petr Vobornik
0b0e77cf99 webui: new navigation structure
https://fedorahosted.org/freeipa/ticket/4418

Reviewed-By: Fraser Tweedale <ftweedal@redhat.com>
Reviewed-By: Martin Kosek <mkosek@redhat.com>
Reviewed-By: Petr Spacek <pspacek@redhat.com>
2014-07-04 16:31:38 +02:00
Petr Vobornik
35d3f03843 webui: support unlock user command
Call user-unlock command from Web UI.

It will unlock displayed user on current master.

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

Reviewed-By: Endi Sukma Dewata <edewata@redhat.com>
2014-06-30 13:11:53 +02:00
Petr Vobornik
029649c05c webui-ci: fix action list action visibility and enablement assertion
The new html structure was not addressed properly.

Reviewed-By: Endi Sukma Dewata <edewata@redhat.com>
2014-06-30 13:00:13 +02:00
Petr Vobornik
c7c13965e3 webui-ci: dns forward zone tests
Selenium CI sanity tests for DNS Forward Zones

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

Reviewed-By: Endi Sukma Dewata <edewata@redhat.com>
2014-06-27 14:18:34 +02:00
Petr Vobornik
870db2f677 webui: rebase user password dialog on password dialog and add otp support
https://fedorahosted.org/freeipa/ticket/4262

Reviewed-By: Endi Sukma Dewata <edewata@redhat.com>
2014-06-26 12:37:39 +02:00
Petr Vobornik
15374cf58f webui-ci: adjust tests to dns changes
All DNS Zone names must be fully qualified.

Reviewed-By: Endi Sukma Dewata <edewata@redhat.com>
2014-06-25 16:23:14 +02:00
Tomas Babej
4d2ef43f28 ipaplatform: Move all filesystem paths to ipaplatform.paths module
https://fedorahosted.org/freeipa/ticket/4052

Reviewed-By: Petr Viktorin <pviktori@redhat.com>
2014-06-16 19:48:20 +02:00
Petr Vobornik
f1b83198da webui: control sudo rule deny command tables by category switch
`memberdenycmd_sudocmd` and `memberdenycmd_sudocmdgroup` tables are now
enabled/disabled based on `cmdcategory` as well.

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

Reviewed-By: Nathaniel McCallum <npmccallum@redhat.com>
2014-06-12 09:56:49 +02:00
Petr Vobornik
e3840eef09 webui: fix regression: enabled gid field on group add
GID field should be enabled by default since the default group is posix.

Was caused by option_widget_base not properly reporting value change while
selecting the default value. It has to be notified with delay otherwise the
event is consumed by FieldBinder.

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

Reviewed-By: Endi Sukma Dewata <edewata@redhat.com>
2014-06-11 10:47:27 +02:00
Petr Vobornik
dd69557f4e webui: use normal buttons instead of link buttons in multivalued widget
Reviewed-By: Endi Sukma Dewata <edewata@redhat.com>
2014-06-10 10:23:30 +02:00