Skip to content

Commit

Permalink
Updating tests
Browse files Browse the repository at this point in the history
  • Loading branch information
Shivani-gslab committed Jul 31, 2023
1 parent 20e2d6a commit a0a2540
Show file tree
Hide file tree
Showing 5 changed files with 69 additions and 323 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
import_playbook: test_apply_detach_configlet.yml

- name: Test cv_device_v3 module
import_playbook: test_decommission_factory_reset_provisioning_reset.yml
import_playbook: test_apply_detach_bundle.yml

- name: Test cv_device_v3 module
import_playbook: test_apply_detach_bundle.yml
import_playbook: test_decommission_factory_reset_provisioning_reset.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,27 +4,53 @@
connection: local
gather_facts: no
vars:
ansible_command_timeout: 1200
ansible_connect_timeout: 600

CVP_CONFIGLETS:
configlet1: '! This is first configlet'

IMAGE_NAME: "vEOS-lab.swi"

BUNDLE_NAME: "Test_bundle"

CVP_DEVICES_BUNDLE_ATTACHED:
- serialNumber: JPE504a004ea054
parentContainerName: L2_Leaf
- fqdn: leaf1.atd.lab
parentContainerName: ""
configlets:
- 'AVD_Ipmi3'
imageBundle: leaf_bundle
- 'configlet1'
imageBundle: Test_bundle

CVP_DEVICES_BUNDLE_DETACHED:
- serialNumber: JPE504a004ea054
parentContainerName: L2_Leaf
- fqdn: leaf1.atd.lab
parentContainerName: ""
configlets:
- 'AVD_Ipmi3'
- 'configlet1'

CVP_DEVICES_DETACH_CONFIGLET:
- fqdn: leaf1.atd.lab
parentContainerName: "pod1"

tasks:
- name: "Push config"
arista.cvp.cv_configlet_v3:
configlets: "{{CVP_CONFIGLETS}}"
state: present

- name: "Upload EOS image to {{inventory_hostname}}"
arista.cvp.cv_image_v3:
mode: image
action: add
image: "{{IMAGE_NAME}}"

- name: "Create bundle {{inventory_hostname}}"
arista.cvp.cv_image_v3:
mode: bundle
action: add
bundle_name: "{{BUNDLE_NAME}}"
image_list:
- "{{IMAGE_NAME}}"

- name: "Attach bundle on {{inventory_hostname}}"
arista.cvp.cv_device_v3:
devices: '{{CVP_DEVICES_BUNDLE_ATTACHED}}'
Expand Down Expand Up @@ -57,3 +83,22 @@
- DETACH_BUNDLE.bundle_detached.bundle_detached_count == 1
- DETACH_BUNDLE.bundle_detached.bundle_detached_list != []
- DETACH_BUNDLE.bundle_detached.success == true

- name: "Delete bundle {{inventory_hostname}}"
arista.cvp.cv_image_v3:
mode: bundle
action: remove
bundle_name: "{{BUNDLE_NAME}}"
image_list:
- "{{IMAGE_NAME}}"

- name: "Detach configlet from {{inventory_hostname}}"
arista.cvp.cv_device_v3:
devices: '{{CVP_DEVICES_DETACH_CONFIGLET}}'
state: present
apply_mode: strict

- name: "Delete configlet"
arista.cvp.cv_configlet_v3:
configlets: "{{CVP_CONFIGLETS}}"
state: absent
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,6 @@
arista.cvp.cv_configlet_v3:
configlets: "{{CVP_CONFIGLETS}}"
state: present
register: CV_CONFIGLET

- name: "Apply configlet on {{inventory_hostname}}"
arista.cvp.cv_device_v3:
Expand Down Expand Up @@ -80,4 +79,3 @@
arista.cvp.cv_configlet_v3:
configlets: "{{CVP_CONFIGLETS}}"
state: absent
register: DELETE_CONFIGLET_RESULT
Loading

0 comments on commit a0a2540

Please sign in to comment.