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

Improve NAP DoS tests #2996

Merged
merged 6 commits into from Sep 20, 2022
Merged

Improve NAP DoS tests #2996

merged 6 commits into from Sep 20, 2022

Conversation

pasmant
Copy link
Contributor

@pasmant pasmant commented Aug 31, 2022

Make dos tests more robust

@pasmant pasmant marked this pull request as draft August 31, 2022 13:51
@codecov-commenter
Copy link

codecov-commenter commented Sep 7, 2022

Codecov Report

Merging #2996 (6e2502f) into main (c6eac4d) will decrease coverage by 0.02%.
The diff coverage is n/a.

@@            Coverage Diff             @@
##             main    #2996      +/-   ##
==========================================
- Coverage   52.31%   52.29%   -0.03%     
==========================================
  Files          58       58              
  Lines       15965    15995      +30     
==========================================
+ Hits         8352     8364      +12     
- Misses       7335     7352      +17     
- Partials      278      279       +1     
Impacted Files Coverage Δ
internal/k8s/configuration.go 95.39% <0.00%> (-0.37%) ⬇️
internal/configs/configurator.go 37.38% <0.00%> (-0.08%) ⬇️
internal/k8s/controller.go 11.11% <0.00%> (-0.07%) ⬇️
pkg/apis/configuration/validation/virtualserver.go 94.38% <0.00%> (+0.02%) ⬆️
internal/k8s/utils.go 14.70% <0.00%> (+0.42%) ⬆️
internal/configs/configmaps.go 20.21% <0.00%> (+2.00%) ⬆️

📣 We’re building smart automated test selection to slash your CI/CD build times. Learn more

@pasmant pasmant marked this pull request as ready for review September 8, 2022 13:05
@@ -206,6 +215,12 @@ def test_dos_vs_logs(
print(f"log_loc: {log_loc} syslog_pod: {syslog_pod} namespace: {ingress_controller_prerequisites.namespace}")
log_contents = get_file_contents(kube_apis.v1, log_loc, syslog_pod, ingress_controller_prerequisites.namespace)

# print("\n===================== ADMD Logs Start =====================")
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@pasmant can you please remove the commented code if not needed?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

There is any log level in pytest?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Remove the logs

@github-actions github-actions bot added the tests Pull requests that update tests label Sep 14, 2022
@pasmant pasmant marked this pull request as draft September 14, 2022 13:49
@pasmant pasmant marked this pull request as ready for review September 15, 2022 07:08
@@ -133,6 +141,7 @@ def fin():
delete_dos_policy(kube_apis.custom_objects, pol_name, test_namespace)
delete_dos_logconf(kube_apis.custom_objects, log_name, test_namespace)
delete_dos_protected(kube_apis.custom_objects, protected_name, test_namespace)
clean_good_bad_clients()
# delete_items_from_yaml(kube_apis, src_webapp_yaml, test_namespace)
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@pasmant more commented code here, can you please have a look?

Copy link
Contributor Author

@pasmant pasmant Sep 18, 2022

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Removed

@@ -233,74 +243,6 @@ def test_dos_sec_logs_on(
assert f'vs_name="{test_namespace}/dos-protected/name"' in log_contents
assert "bad_actor" in log_contents

def test_dos_under_attack_no_learning(
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

we don't need this anymore?

@lucacome lucacome merged commit 7ab666e into nginxinc:main Sep 20, 2022
@lucacome lucacome changed the title Dos tests Improve NAP DoS tests Sep 20, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
tests Pull requests that update tests
Projects
Status: Done 🚀
Development

Successfully merging this pull request may close these issues.

None yet

5 participants