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

Force options tests implentation #2151

Conversation

palaciosjeremias
Copy link
Contributor

Related issue
#2057

Description

This PR implements all the expected test cases for the force_options configuration block.
It's divided in:

  • test_authd_force_options.py to test all the different valid configurations, the expected log, and the expected responses from the request.
  • test_authd_force_options_invalid_options.py to test all the invalid configurations and the expected log.

The valid configurations tests are divided into the following YAML files:

  • enablement_force_options.yaml
  • after_registration_time.yaml
  • disconnected_time.yaml
  • key_mismatch.yaml

To implement these changes:

  • validate_authd_logs() was relocated
  • override_authd_force_conf helper methods were relocated
  • restart_authd() now accepts failed attempts to restart Authd
  • insert_pre_existent_agents() logic was improved.
  • The different configurations with the different enrollment scenarios were covered.

Tests

  • Proven that tests pass when they have to pass.
  • Proven that tests fail when they have to fail.
  • Python codebase satisfies PEP-8 style style guide. pycodestyle --max-line-length=120 --show-source --show-pep8 file.py.

@palaciosjeremias
Copy link
Contributor Author

Successful execution of force_options tests:

image

@palaciosjeremias palaciosjeremias force-pushed the dev-2057-force_options-tests-implentation branch 3 times, most recently from a5b4a69 to a4077eb Compare November 3, 2021 19:33
@palaciosjeremias palaciosjeremias force-pushed the dev-2057-force_options-tests-implentation branch from a4077eb to ca0f773 Compare November 3, 2021 20:08
@palaciosjeremias
Copy link
Contributor Author

Jenkins successful execution:
https://ci.wazuh.info/job/Test_integration/14948/

@palaciosjeremias palaciosjeremias force-pushed the dev-2057-force_options-tests-implentation branch from 8fc9587 to 017a1d1 Compare November 4, 2021 12:10
@DProvinciani DProvinciani self-requested a review November 4, 2021 13:59
Copy link
Contributor

@DProvinciani DProvinciani left a comment

Choose a reason for hiding this comment

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

Looks good

@DProvinciani DProvinciani merged commit 24c222b into dev-9550-authd-replacement-configurations-improvement Nov 4, 2021
@DProvinciani DProvinciani deleted the dev-2057-force_options-tests-implentation branch November 4, 2021 14:06
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Implement a test to cover the different force_options scenarios
3 participants