Skip to content

Commit

Permalink
test(integration): docs and setup minor update for integration tests
Browse files Browse the repository at this point in the history
  • Loading branch information
alperenkose committed Sep 23, 2024
1 parent 0fdd990 commit 2375a93
Show file tree
Hide file tree
Showing 3 changed files with 21 additions and 12 deletions.
11 changes: 8 additions & 3 deletions tests/integration/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,11 @@ Test playbooks assume that firewalls have the following initial configuration:
- DHCP management configuration
- a CA certificate with key named `local-ca` marked as `forward trust`

And panoramas to have:

- `Test-DG` device group
- `Test-Template` template

Add firewalls to `firewall` group in inventory, Panorama instances to
`panoramas` group (see `inventory.example`):

Expand All @@ -28,13 +33,13 @@ booted, and save a copy of the config into `blank.xml` on the device.
### Run a single test

```
ansible-playbook -i inventory run_single_test.yml -e test=test_panos_address_object
ansible-playbook -i inventory.ini run_single_test.yml -e test=test_panos_address_object
```

### Run all tests

```
ansible-playbook -i inventory run_all_tests.yml
ansible-playbook -i inventory.ini run_all_tests.yml
```

## Writing a test
Expand Down Expand Up @@ -140,4 +145,4 @@ template: '{{ template | default(omit) }}'
```

The built-in Ansible module [assert](https://docs.ansible.com/ansible/latest/collections/ansible/builtin/assert_module.html)
is used to check results.
is used to check results.
21 changes: 12 additions & 9 deletions tests/integration/inventory.example
Original file line number Diff line number Diff line change
@@ -1,15 +1,18 @@
[firewalls]
panos-10 ansible_host=192.168.55.10
panos-10 ansible_host=192.168.55.10 ip_address=192.168.55.10

[panoramas]
panorama-10 ip_address=192.168.55.5

[all:vars]
ansible_user=admin
ansible_password=something

ansible_network_os=mrichardson03.panos.panos
ansible_connection=httpapi
ansible_httpapi_port=443
ansible_httpapi_use_ssl=True
ansible_httpapi_validate_certs=False
username=admin
password=something

# ansible_user=admin
# ansible_password=something

# ansible_network_os=mrichardson03.panos.panos
# ansible_connection=httpapi
# ansible_httpapi_port=443
# ansible_httpapi_use_ssl=True
# ansible_httpapi_validate_certs=False
1 change: 1 addition & 0 deletions tests/integration/setup.yml
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@
until: result is not failed and (result.stdout | from_json).response.result == 'yes'
retries: 5
delay: 300
when: inventory_hostname in groups['firewalls']

- name: Save copy of blank config
paloaltonetworks.panos.panos_op:
Expand Down

0 comments on commit 2375a93

Please sign in to comment.