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

Test: New cvp integration molecule test #3500

Merged
merged 60 commits into from
Apr 10, 2024
Merged
Show file tree
Hide file tree
Changes from 59 commits
Commits
Show all changes
60 commits
Select commit Hold shift + click to select a range
702d12a
basic molecule test
sugetha24 Jan 15, 2024
566fc57
assert statements
sugetha24 Jan 18, 2024
b2b959b
trimmed newline from response
sugetha24 Jan 18, 2024
28a0c28
added tags to module
sugetha24 Jan 18, 2024
f95f207
changed password in configs
sugetha24 Jan 18, 2024
0785035
Use relative path in playbook and formatting
ClausHolbechArista Jan 19, 2024
d878fec
dict of response configlet and request configlet
sugetha24 Jan 20, 2024
86437d0
added test for tags
sugetha24 Jan 23, 2024
05d4281
assert CC completed
sugetha24 Jan 24, 2024
3ed456b
get and verify device tags
sugetha24 Jan 25, 2024
9d181cc
removed comments
sugetha24 Jan 25, 2024
7448e91
assert interface tags
sugetha24 Jan 26, 2024
6a31439
added missing device test
sugetha24 Jan 26, 2024
47547a9
Test for strict tags function
sugetha24 Feb 2, 2024
546b125
changed task name
sugetha24 Feb 2, 2024
1396d68
added test for changing tag value
sugetha24 Feb 13, 2024
e6f9340
added workflow; token as github secret
sugetha24 Feb 13, 2024
cb4363e
changed test name
sugetha24 Feb 13, 2024
4abd7ba
added workflow_dispatch to test manually
sugetha24 Feb 13, 2024
eb871bf
bugfix
sugetha24 Feb 13, 2024
ffe5bc0
bugfix needs
sugetha24 Feb 13, 2024
2e8cc28
removed if
sugetha24 Feb 13, 2024
09b9cb6
bugfix: typo secrets
sugetha24 Feb 13, 2024
5affbfc
bugfix: lookup
sugetha24 Feb 13, 2024
ecfc01d
added -vvv for molecule test
sugetha24 Feb 13, 2024
97f20b4
bugfix: load token from secrets
sugetha24 Feb 13, 2024
cf4d9db
removed -vvv from workflow
sugetha24 Feb 13, 2024
9f651be
added check for secrets
sugetha24 Feb 13, 2024
c2de3ea
bugfix
sugetha24 Feb 14, 2024
a5e49c3
changed name of env var
sugetha24 Feb 14, 2024
169f25f
check if env var is read
sugetha24 Feb 14, 2024
839a491
fix: env var name
sugetha24 Feb 14, 2024
dd14287
fix: env var lookup
sugetha24 Feb 14, 2024
db3f0b4
check if env var is injected
sugetha24 Feb 14, 2024
5254551
env var injected before calling molecule
sugetha24 Feb 14, 2024
b7fbad7
changed test artifacts
sugetha24 Feb 14, 2024
cbd152a
changed artifacts
sugetha24 Feb 14, 2024
0a06d7a
added cleanup task
sugetha24 Feb 14, 2024
7550914
adding cleanup files
sugetha24 Feb 14, 2024
2746dfb
changed device hostnames to work with aawg-ci tenant
sugetha24 Feb 15, 2024
8b9e946
fix: changed dev name
sugetha24 Feb 15, 2024
3eed278
added token for aawg ci
sugetha24 Feb 21, 2024
a938f0b
injecting aawg ci token
sugetha24 Feb 21, 2024
d796152
bugfix: tyop
sugetha24 Feb 21, 2024
596aa26
Removed extraneous configs
sugetha24 Feb 22, 2024
ed20152
moved configs into folders
sugetha24 Feb 28, 2024
5de5ea2
fix: token location
sugetha24 Feb 28, 2024
40b13a1
dotted hostname test
sugetha24 Mar 2, 2024
ff7b9e4
removing token
sugetha24 Mar 6, 2024
35fe878
Added readme
sugetha24 Mar 23, 2024
aa190c1
Applying suggestions from code review
sugetha24 Mar 27, 2024
c80209f
name change
sugetha24 Mar 28, 2024
0e55a83
change module name in cleanup
sugetha24 Mar 28, 2024
d4ec994
fixed typos
sugetha24 Mar 29, 2024
761df46
cc state completed
sugetha24 Apr 3, 2024
bfbd191
fix typo on workspace name
sugetha24 Apr 3, 2024
017120c
Moved workflow file to seperate PR/3829
sugetha24 Apr 9, 2024
ab9c77e
Rename molecule scenario
ClausHolbechArista Apr 10, 2024
7c18e5a
Merge branch 'devel' into new-cvp-integration
ClausHolbechArista Apr 10, 2024
47d7515
Apply suggestions from code review
ClausHolbechArista Apr 10, 2024
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
24 changes: 24 additions & 0 deletions ansible_collections/arista/avd/molecule/cv_workflow/Readme.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
## How to test

NOTE: Can only be run on aawg-ci tenant.

1. Create a service account token on cvaas
2. Load the token as environment variable on your local machine
3. `bash# export CVAAS_AAWG_CI=<your token here>`
4. `bash# cd avd/ansible_collections/arista/avd`
5. `bash# molecule test -s deploy_to_cv`
ClausHolbechArista marked this conversation as resolved.
Show resolved Hide resolved
6. You can add the `-vvv` option to get extended logs
ClausHolbechArista marked this conversation as resolved.
Show resolved Hide resolved
7. Verify that the molecule test completes without any errors

## Test Suite

1. Use deploy_to_cv plugin to deploy configs to CV with the following options
ClausHolbechArista marked this conversation as resolved.
Show resolved Hide resolved
1. `ws_req_state: submitted`
2. `cc_requested_state: running`
2. Test strict tags functionality with
1. `strict_tags: true`
3. Test tags value change
1. Change the value an already existing tag
4. Dotted hostname
1. Change hostname of the switch to have dots in it
2. use `deploy_to_cv` to deploy configs to CV
ClausHolbechArista marked this conversation as resolved.
Show resolved Hide resolved
59 changes: 59 additions & 0 deletions ansible_collections/arista/avd/molecule/cv_workflow/cleanup.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,59 @@
---
- name: Converge - Configuration deployment with CVP
hosts: localhost
connection: local
gather_facts: false
vars:
cv_server: www.cv-staging.corp.arista.io
# token: "{{ lookup('file', playbook_dir ~ '/token-aawg-ci.tok')}}"
token: "{{ lookup('env', 'CVAAS_AAWG_CI') }}"
configuration_dir: "{{ playbook_dir }}/intended/configs/base_configs"
structured_config_dir: "{{ playbook_dir }}/intended/structured_configs/base_configs"

tasks:
- name: Generate random string
ansible.builtin.set_fact:
r: "{{ lookup('password', '/dev/null chars=ascii_lowercase,digits length=4') }}"
run_once: true

- name: Set facts
ansible.builtin.set_fact:
ws_name: avd-static-studio-cleanup-{{ r }}
ws_description: sample description
ws_req_state: submitted
ws_force: true
cc_name: cc_avd_studio-cleanup-{{ r }}
cc_requested_state: completed
cc_description: sample description
run_once: true

- name: Clean up and provision CVP with with base AVD configuration
run_once: true
delegate_to: localhost
arista.avd.cv_workflow:
configuration_dir: "{{ configuration_dir }}"
structured_config_dir: "{{ structured_config_dir }}"
# structured_config_suffix: "yml"
# device_list: "{{ ansible_play_hosts }}"
device_list: ["ci-s1-leaf1", "ci-s1-leaf2", "ci-s1-leaf3", "ci-s1-leaf4", "ci-s1-spine1", "ci-s1-spine2"]
strict_tags: true
# skip_strict_devices: false
# configlet_name_template: "AVD-${hostname}"
cv_servers: [ '{{ cv_server }}' ]
cv_token: '{{ token }}'
# cv_verify_certs: True
workspace:
name: '{{ ws_name }}'
description: '{{ ws_description }}'
id: '{{ ws_name }}'
requested_state: '{{ ws_req_state }}'
force: '{{ ws_force }}'
change_control:
name: '{{ cc_name }}'
description: '{{ cc_description }}'
requested_state: '{{ cc_requested_state }}'
# timeouts:
# workspace_build_timeout: 300.0
# change_control_creation_timeout: 300.0
return_details: true
register: cvp_results
Loading
Loading