[freeipa PR#3783][opened] Migrate xunit-style setups to fixtures
by stanislavlevin
URL: https://github.com/freeipa/freeipa/pull/3783
Author: stanislavlevin
Title: #3783: Migrate xunit-style setups to fixtures
Action: opened
PR body:
"""
This converts `setup*`/`teardown*` functions/methods to the
powerfull pytest fixtures:
```
The purpose of test fixtures is to provide a fixed baseline upon
which tests can reliably and repeatedly execute. pytest fixtures
offer dramatic improvements over the classic xUnit style of
setup/teardown functions:
- fixtures have explicit names and are activated by declaring their
use from test functions, modules, classes or whole projects.
- fixtures are implemented in a modular manner, as each fixture name
triggers a fixture function which can itself use other fixtures.
- fixture management scales from simple unit to complex functional
testing, allowing to parametrize fixtures and tests according to
configuration and component options, or to re-use fixtures across
function, class, module or whole test session scopes.
```
One of the transition patterns is as follows:
```diff
class TestFooBar(XMLRPC_test):
- @classmethod
- def setup_class(cls):
- super(TestFooBar, cls).setup_class()
+ @pytest.fixture(autouse=True, scope="class")
+ def foo_bar_setup(self, request, xmlrpc_setup):
+ cls = request.cls
cls.beforemethod()
- @classmethod
- def teardown_class(cls):
- cls.aftermethod()
- super(TestFooBar, cls).teardown_class()
+ def fin():
+ cls.aftermethod()
+ request.addfinalizer(fin)
```
To achieve predictable results for initialization and destroy of
Pytest fixtures, ones have to employ the fixtures' interdependencies.
This is the first part of the work to remove the mixing of test idioms in the
IPA test suite.
Related: https://pagure.io/freeipa/issue/7989
"""
To pull the PR as Git branch:
git remote add ghfreeipa https://github.com/freeipa/freeipa
git fetch ghfreeipa pull/3783/head:pr3783
git checkout pr3783
4 years, 2 months
[freeipa PR#2812][opened] Require secure-binds for password login
by tiran
URL: https://github.com/freeipa/freeipa/pull/2812
Author: tiran
Title: #2812: Require secure-binds for password login
Action: opened
PR body:
"""
nsslapd-require-secure-binds restricts password based simple binds to
secure connections. It does not prevent a careless user from
transmitting a password in plain text. But it makes it obvious that he
did something bad. Password based bind attempts over an insecure
connections are refused with:
Confidentiality required: Operation requires a secure connection
Secure connections are:
* LDAP connections on port 389 with STARTTLS
* LDAPS connections in port 636
* LDAPI connections to a local Unix sockets
Anonymous bind (simple_bind with empty DN and password) and GSSAPI
bind operations are not affected.
nsslapd-require-secure-binds is enabled after 389-DS is configured for
TLS/SSL.
Signed-off-by: Christian Heimes <cheimes(a)redhat.com>
**NOTE** The change may cause compatibility issues with applications that don't perform secure binds.
"""
To pull the PR as Git branch:
git remote add ghfreeipa https://github.com/freeipa/freeipa
git fetch ghfreeipa pull/2812/head:pr2812
git checkout pr2812
4 years, 5 months
[freeipa PR#3672][opened] Make sure to have storage space for tag
by simo5
URL: https://github.com/freeipa/freeipa/pull/3672
Author: simo5
Title: #3672: Make sure to have storage space for tag
Action: opened
PR body:
"""
ber_scanf expects a pointer to a ber_tag_t to return the tag pointed at
by "t", if that is not provided the pointer will be store in whatever
memory location is pointed by the stack at that time causeing a crash.
Note that this is effectively unused code because in ipa-kdb the only
party that can write a key_data structure to be stored is te kdb_driver
itself and we never encode these s2kparam data.
But we need to handle this for future proofing.
Fixes #8071
"""
To pull the PR as Git branch:
git remote add ghfreeipa https://github.com/freeipa/freeipa
git fetch ghfreeipa pull/3672/head:pr3672
git checkout pr3672
4 years, 5 months