Skip to content

Commit

Permalink
Test: Update install script (#600)
Browse files Browse the repository at this point in the history
Co-authored-by: Carl Buchmann <carl.buchmann@arista.com>
  • Loading branch information
sugetha24 and carlbuchmann authored Mar 28, 2023
1 parent 6714340 commit 7b77d87
Show file tree
Hide file tree
Showing 3 changed files with 14 additions and 21 deletions.
11 changes: 9 additions & 2 deletions tests/PR_testing/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
- `wget https://raw.githubusercontent.com/aristanetworks/ansible-cvp/devel/tests/PR_testing/install.sh`
- `sh install.sh <pr-number>`
- This script would place the ansible-cvp PR code base under `persist/arista-ansible` and example playbooks under `persist/PR_testing/examples`
- Edit `persist/PR_testing/inventory.yaml`
- Edit `persist/PR_testing/inventory.yml`
- Update the `ansible_password` variables under `CloudVision`

```yaml
Expand All @@ -21,6 +21,13 @@

- `cd persist/PR_testing`
- Run the desired playbook:
- `ansible-playbook cv_device_v3/device_validate_config_valid.yaml -i inventory.yaml`
- `ansible-playbook cv_device_v3/device_validate_config_valid.yaml -i inventory.yml`
- Run molecule tests:
- Edit `persist/arista-ansible/ansible_collection/arista/cvp/examples/inventory.yml`
- Update `ansible_password` variable under `CloudVision`
- Run:
- Navigate to `/home/coder/project/persist/arista-ansible/ansible-cvp/ansible_collections/arista/cvp` and run
- `/home/coder/.local/bin/molecule converge -s <molecule-scenario>`
- eg: `/home/coder/.local/bin/molecule converge -s cv_device_v3`

HAPPY TESTING!
7 changes: 5 additions & 2 deletions tests/PR_testing/install.sh
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,6 @@ if [ ! -d "${_ROOT_INSTALLATION_DIR}" ]; then
echo "copying ansible workspace"
mkdir -p ${_LOCAL_EXAMPLE_PLAYBOOKS}
cp ${_LOCAL_CVP}/tests/PR_testing/ansible.cfg ${_LOCAL_EXAMPLE_PLAYBOOKS}
cp ${_LOCAL_CVP}/tests/PR_testing/inventory.yaml ${_LOCAL_EXAMPLE_PLAYBOOKS}

echo "copying example playbooks from ${_REPO_CVP} to /persist"
cp -r ${_LOCAL_CVP}/ansible_collections/arista/cvp/examples/* ${_LOCAL_EXAMPLE_PLAYBOOKS}
Expand All @@ -72,9 +71,13 @@ if [ ! -d "${_ROOT_INSTALLATION_DIR}" ]; then
ansible-galaxy collection install ansible.netcommon
ansible-galaxy collection install arista.eos

echo "install molecule package"
pip install -r ${_LOCAL_CVP}/ansible_collections/arista/cvp/requirements-dev.txt

info_installation_done
else
echo " ! local installation folder already exists - ${_ROOT_INSTALLATION_DIR}"

echo "install molecule package"
pip install -r ${_LOCAL_CVP}/ansible_collections/arista/cvp/requirements-dev.txt
exit 1
fi
17 changes: 0 additions & 17 deletions tests/PR_testing/inventory.yaml

This file was deleted.

0 comments on commit 7b77d87

Please sign in to comment.