Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Rewrite kerberos security integration and unit tests #28092

Merged
merged 1 commit into from Dec 5, 2022

Conversation

Taragolis
Copy link
Contributor

@Taragolis Taragolis commented Dec 4, 2022

This PR rewrite almost all tests/security/test_kerberos.py:

  1. Migrate to pytest
  2. Rename TestKerberos to TestKerberosIntegrity and add @pytest.mark.integration("kerberos") decorator
  3. Rename TestKerberosUnit to TestKerberos

Seems like previously kerberos integrity test not run for a long period because it contain something which never pass in current airflow environment, for example if [kerberos] include_ip or [kerberos] forwardable set to "" and test actually run than an error should be raised because conf.getboolean couldn't parse empty string and convert it to boolean.


Local breeze result

================================================== test session starts ==================================================
platform linux -- Python 3.7.15, pytest-6.2.5, py-1.11.0, pluggy-1.0.0 -- /usr/local/bin/python
cachedir: .pytest_cache
rootdir: /opt/airflow, configfile: pytest.ini
plugins: cov-4.0.0, rerunfailures-9.1.1, instafail-0.4.2, anyio-3.6.2, timeouts-1.2.1, requests-mock-1.10.0, flaky-3.7.0, xdist-3.0.2, httpx-0.21.2, asyncio-0.20.2
asyncio: mode=strict
setup timeout: 0.0s, execution timeout: 0.0s, teardown timeout: 0.0s
collected 15 items                                                                                                      

tests/security/test_kerberos.py::TestKerberosIntegration::test_renew_from_kt[default-config] PASSED               [  6%]
tests/security/test_kerberos.py::TestKerberosIntegration::test_renew_from_kt[explicit-include-ip] PASSED          [ 13%]
tests/security/test_kerberos.py::TestKerberosIntegration::test_renew_from_kt[explicit-not-include-ip] PASSED      [ 20%]
tests/security/test_kerberos.py::TestKerberosIntegration::test_renew_from_kt[explicit-forwardable] PASSED         [ 26%]
tests/security/test_kerberos.py::TestKerberosIntegration::test_renew_from_kt[explicit-not-forwardable] PASSED     [ 33%]
tests/security/test_kerberos.py::TestKerberosIntegration::test_args_from_cli[exit-on-fail] PASSED                 [ 40%]
tests/security/test_kerberos.py::TestKerberosIntegration::test_args_from_cli[return-code-of-fail] PASSED          [ 46%]
tests/security/test_kerberos.py::TestKerberos::test_renew_from_kt[kerberos_config0-expected_cmd0] PASSED          [ 53%]
tests/security/test_kerberos.py::TestKerberos::test_renew_from_kt[kerberos_config1-expected_cmd1] PASSED          [ 60%]
tests/security/test_kerberos.py::TestKerberos::test_renew_from_kt[kerberos_config2-expected_cmd2] PASSED          [ 66%]
tests/security/test_kerberos.py::TestKerberos::test_renew_from_kt_without_workaround PASSED                       [ 73%]
tests/security/test_kerberos.py::TestKerberos::test_renew_from_kt_failed PASSED                                   [ 80%]
tests/security/test_kerberos.py::TestKerberos::test_renew_from_kt_failed_workaround PASSED                        [ 86%]
tests/security/test_kerberos.py::TestKerberos::test_run_without_keytab PASSED                                     [ 93%]
tests/security/test_kerberos.py::TestKerberos::test_run PASSED                                                    [100%]

================================================== 15 passed in 7.96s ===================================================

@potiuk
Copy link
Member

potiuk commented Dec 5, 2022

NAAAAJS

@potiuk potiuk merged commit e0bb6be into apache:main Dec 5, 2022
ephraimbuddy pushed a commit that referenced this pull request Jan 13, 2023
ephraimbuddy pushed a commit that referenced this pull request Jan 14, 2023
@Taragolis Taragolis deleted the rewrite-kerberos-security-tests branch January 14, 2023 18:29
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants