ansible/test/integration/targets/incidental_vyos_config/tests/cli/save.yaml
Matt Clay 4e571248a9
First batch of incidental integration tests. (#67717)
* Initial copy of incidental network tests.

* Update incidental test aliases.

* Add incidental tests to CI.

* Rewrite module references in tests.

This should not be necessary once module redirection is supported.

* Rewrite target references for renamed targets.

* Add support collections for incidental tests.

* Add ignores for test support code.

* Remove echo used for debugging.
2020-02-24 17:31:14 -08:00

54 lines
1.1 KiB
YAML

---
- debug: msg="START cli/save.yaml on connection={{ ansible_connection }}"
- name: setup
vyos.vyos.vyos_config:
lines: set system host-name {{ inventory_hostname_short }}
match: none
- name: configure hostaname and save
vyos.vyos.vyos_config:
lines: set system host-name foo
save: true
register: result
- assert:
that:
- "result.changed == true"
- "'set system host-name foo' in result.commands"
- name: configure hostaname and don't save
vyos.vyos.vyos_config:
lines: set system host-name bar
register: result
- assert:
that:
- "result.changed == true"
- "'set system host-name bar' in result.commands"
- name: save config
vyos.vyos.vyos_config:
save: true
register: result
- assert:
that:
- "result.changed == true"
- name: save config again
vyos.vyos.vyos_config:
save: true
register: result
- assert:
that:
- "result.changed == false"
- name: teardown
vyos.vyos.vyos_config:
lines: set system host-name {{ inventory_hostname_short }}
match: none
save: true
- debug: msg="END cli/simple.yaml on connection={{ ansible_connection }}"