-
Notifications
You must be signed in to change notification settings - Fork 45
[Enabler][2097]Add_template_for_test_with_privilege_escalation #2118
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
base: dev
Are you sure you want to change the base?
Conversation
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.
Minor grammar issue. Because these are in tests, I'm assuming this should not have a changelog entry.
| Add CLI options and modify options for pytest-ansible where needed. | ||
| Note: Set the default to to None, otherwise when evaluating with `request.config.getoption("--zinventory"):` | ||
| will always return true because a default will be returned. | ||
| New option have been added to the execution of the command to allow the become method. |
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.
New option has been added (not have) to allow the become method to apply to the command.
| "--user_adm", | ||
| action="store", | ||
| default=None, | ||
| help="Str " |
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.
Don't forget to add the rest of the help mesasage for all the new options
| help="Str " | ||
| ) | ||
| parser.addoption( | ||
| "--ansible_promp", |
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.
I would change this one to --ansible-prompt
| help="Str - dictionary with values {'host': 'ibm.com', 'user': 'root', 'zoau': '/usr/lpp/zoau', 'pyz': '/usr/lpp/IBM/pyz'}", | ||
| ) | ||
| parser.addoption( | ||
| "--user_adm", |
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.
Maybe this one could also be --super-user
| help="Str " | ||
| ) | ||
| parser.addoption( | ||
| "--password", |
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.
Do we really need both password and ssh-key? It looks like they are basically the same, a way to give tests access to an ssh key file
SUMMARY
Create template on test suite and helper of user to test the next become support.
Fixes #2097
ISSUE TYPE
COMPONENT NAME
execute_managed_user_become_testFunction added to the helper/users to test the managed user with limited permissions by adding the options on command line avoiding to be written direct on the code and be hardcoded.ADDITIONAL INFORMATION
To be able to execute a playbook on the test suite with manage user required to add new functions.
Add new options to the command line to get options flexibility and avoid hard coded content.
Functions to read the new configuration file for user managed test cases.
And function to store the options added on commands.
Add python interpreter for ansible playbooks with become method and not the pyz.