-
Notifications
You must be signed in to change notification settings - Fork 59
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
(PCP-169) Acceptance tests should not use sed #247
Conversation
Move config strings (e.g. SSL certs, broker URI) into a helper file, so that test and pre-suite code is neater and easier to maintain.
Add helper methods to generate JSON for pxp-agent config. Replace sed commands in SSL config test case with beaker create_remote_file using generated JSON.
Add helper method to get the path to the pxp-agent log file. Updated the SSL config acceptance test to use this.
Use the config_helper file to get the path to pxp-agent.conf instead of determining it in the test case.
# @param agent the agent machine that this config is for | ||
# @param client_number which client cert 01-05 to use | ||
# @return pxp-agent config, with ssl ca cert intentionally not matching its ssl cert and key, as a hash | ||
def pxp_invalid_config_wrong_ca_hash(broker, agent, client_number) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The creation of the values here seems too tightly coupled to static files supplied. Can we just have strings passed in for these here to allow for user supplied values? When this is tested against an running puppetserver, it would be preferable to use the servers ca infrastructure.
…files Updating according to PR feedback: the methods in config_helper assume that the standard test-resource ssl files are being used. This commit: * adds a general purpose pxp_config_json that can have all config values passed as strings * rename the existing config methods to reflect that they use our standard test-resource files * removed the methods for generating alternative or intentionally faulty config JSON - test cases can use the general purpose pxp_config_json for this
Hi @johnduarte - I updated this PR so that the pxp_config_json method is totally configurable and not tied to our test certs. I renamed the existing methods to reflect that they use our test certs. |
(PCP-169) Acceptance tests should not use sed
Tests fail on some supported platforms due to the use of 'sed -i'.
This PR adds a helper lib file to provide constants and helper methods for pxp-agent. This includes helper methods to generate pxp-agent config JSON.
The sed statements that altered pxp-agent.conf have been replaced with beaker helper methods that replace the config file's content with generated JSON.