Added spec for ansible code minimal unit test framework#164
Open
hkumarmk wants to merge 1 commit intoJuniper:masterfrom
hkumarmk:spec_ut
Open
Added spec for ansible code minimal unit test framework#164hkumarmk wants to merge 1 commit intoJuniper:masterfrom hkumarmk:spec_ut
hkumarmk wants to merge 1 commit intoJuniper:masterfrom
hkumarmk:spec_ut
Conversation
opencontrail-ci-admin
pushed a commit
to Juniper/contrail-ansible-internal
that referenced
this pull request
Apr 18, 2017
Partial-bug: 1682529 This is the initial patch to implement the spec documented in Juniper/contrail-docker#164. Here are the changes: * Updated internal ansible code with * Added test tag to the tasks which update the service configurations * Addded conditionals for handlers not to run when the variable ansible_test_mode is defined to avoid running the handlers during test * Added one sample test scenario directory - test scenario directories will have below files * contrailctl configuration files with configurations required for that scenario * env.yaml which containes inputs/configurations for the test scenario itself, which will be used by test.py * values.yaml - yaml file which defines what internal service configurations are expected out of the contrailctl configurations provided * Added test.py which does below things: * iterate through test scenario directories found under tests/ directory found under same directory as test.py. For each scenario, test.py execute below * Read env.yaml file to get the inputs/configurations for the test scenarios * prepare the system to run ansible * Create certain directory structure where contrailctl/internal ansible write config files * Create files if required where contrailctl/internal ansible write config entries * Create a netns with appropriate network * Run contrailctl with contrailctl configuration files found under each scenario directory with playbooks directory found in the same directory as test.py * Read values.yaml to get expected service configurations and compare those values with actual configuration entries created by contrailctl run. * Print the test status and a failed configuration report if found any * Print failures report after testing each scenario * Use tabulate module if found, if not print using str.format() Change-Id: I3d66c88d8b7172b20a3cc0ab8bc0c85fea2be88c
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
No description provided.