Commit Graph

16 Commits

Author SHA1 Message Date
Christian Heimes
24161a6190
Move remaining util functions to tasks module
https://pagure.io/freeipa/issue/6798
Signed-off-by: Christian Heimes <cheimes@redhat.com>
Reviewed-By: Milan Kubik <mkubik@redhat.com>
2017-03-22 13:42:04 +01:00
Christian Heimes
313ae46b57
Move tasks module to ipatests.pytest_plugins.integration.tasks
https://pagure.io/freeipa/issue/6798
Signed-off-by: Christian Heimes <cheimes@redhat.com>
Reviewed-By: Milan Kubik <mkubik@redhat.com>
2017-03-22 13:42:04 +01:00
Lenka Doudova
e3b7d235d5 Tests: Fix integration sudo test
Tests with sudorules using only RunAsGroups attributes with empty RunAsUsers
attribute fail due to different expected value than is really returned. This is
caused by improper behaviour of sudo in versions before 1.8.18 (see [1]), to
which the tests were originally fitted. Changing the expected value to proper
one.

[1] - https://www.sudo.ws/pipermail/sudo-workers/2016-November/001025.html

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

Reviewed-By: Lukas Slebodnik <lslebodn@redhat.com>
2016-11-07 12:39:06 +01:00
Lenka Doudova
7cac839203 Tests: Fix integration sudo tests setup and checks
Adding 'defaults' sudorule to prevent requesting further user authentication.
Adding checks that if a user should be rejected access, a proper error message
is displayed.

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

Reviewed-By: Lukas Slebodnik <lslebodn@redhat.com>
2016-09-14 12:49:02 +02:00
Martin Babinsky
94a836dd46 CI tests: use old schema when testing hostmask-based sudo rules
Newer versions of sssd use native IPA schema to process sudo rules.
However, this schema currently has no support for hostmask-based rules
and causes some sudo CI tests to fail. We have to temporarily set
sssd.conf to use ou=sudoers,$SUFFIX as a sudo rule search base when
executing them.

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

Reviewed-By: Tomas Babej <tbabej@redhat.com>
2016-02-25 13:37:16 +01:00
Tomas Babej
a02f83ff9c tests: Add hostmask detection for sudo rules validating on hostmask
IPA sudo tests worked under the assumption that the clients
that are executing the sudo commands have their IPs assigned
within 255.255.255.0 hostmask.

Removes this (invalid) assumption and adds a
dynamic detection of the hostmask of the IPA client.

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

Reviewed-By: Lukas Slebodnik <lslebodn@redhat.com>
Reviewed-By: Oleg Fayans <ofayans@redhat.com>
Reviewed-By: Ales 'alich' Marecek <amarecek@redhat.com>
2015-12-11 14:25:50 +01:00
Tomas Babej
3507bcd3df ipatests: Invoke class install methods properly with respect to pytest-multihost
Multihost object was is not passed to the install method in the super construction.
This fixes setup errors in AD Trust, Forced client reenrollment, CALess and Sudo
tests.

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

Reviewed-By: Petr Viktorin <pviktori@redhat.com>
2014-12-16 12:20:44 +01:00
Petr Viktorin
d42c26c542 test_integration: Adjust tests for pytest
- Customize install() instead of setup_class()
- Use pytest parametrization instead of test generators

Reviewed-By: Tomas Babej <tbabej@redhat.com>
2014-11-21 12:14:44 +01:00
Petr Viktorin
0cdaf2c48f sudo integration test: Remove the local user test
SSSD does not support sudo rules for local users;
these should be added in a local sudoers file.

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

Reviewed-By: Martin Kosek <mkosek@redhat.com>
2014-10-03 14:19:42 +02:00
Tomas Babej
e7969f5af5 ipatests: test_sudo: Expect root listed out if no RunAsUser available
Reviewed-By: Petr Viktorin <pviktori@redhat.com>
2014-06-25 20:14:52 +02:00
Tomas Babej
701f1fc8ba ipatests: test_sudo: Do not expect enumeration of runasuser groups
Reviewed-By: Petr Viktorin <pviktori@redhat.com>
2014-06-25 20:14:52 +02:00
Tomas Babej
e0fd2695ca ipatests: test_sudo: Fix assertions not assuming runasgroupcat set to ALL
Reviewed-By: Petr Viktorin <pviktori@redhat.com>
2014-06-25 20:14:52 +02:00
Tomas Babej
ec2050b7df ipatests: test_sudo: Add coverage for category ALL validation
Makes sure sudorules behave correctly both when adding new entries
with corresponding category set to ALL, and when setting the
category to all when corresponding entries exist.

The only exception of deny commands with cmdcategory ALL is
covered as well.

Reviewed-By: Petr Viktorin <pviktori@redhat.com>
2014-06-25 20:14:52 +02:00
Tomas Babej
c50d190549 ipatests: test_sudo: Add coverage for external entries
Covers functionality of external entries for:
* users
* runAsUsers
* groups of RunAsUsers
* runAsGroups

Reviewed-By: Petr Viktorin <pviktori@redhat.com>
2014-06-25 20:14:52 +02:00
Tomas Babej
d537da8b8a ipatests: test_sudo: Add tests for allowing hosts via hostmasks
Reviewed-By: Petr Viktorin <pviktori@redhat.com>
2014-06-25 20:14:51 +02:00
Tomas Babej
5ce88a1f89 ipatests: Add Sudo integration test
Reviewed-By: Jakub Hrozek <jhrozek@redhat.com>
Reviewed-By: Alexander Bokovoy <abokovoy@redhat.com>
2014-05-09 13:57:04 +03:00