-
Notifications
You must be signed in to change notification settings - Fork 72
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Fix ntp_global servers config commands (#439)
* Fix ntp_global servers config commands Signed-off-by: rohitthakur2590 <[email protected]> * Update integration tests Signed-off-by: rohitthakur2590 <[email protected]> * Update integration tests Signed-off-by: rohitthakur2590 <[email protected]> * fix command section Signed-off-by: rohitthakur2590 <[email protected]> * add unit tests Signed-off-by: rohitthakur2590 <[email protected]> * update integration test Signed-off-by: rohitthakur2590 <[email protected]> * fix tests Signed-off-by: rohitthakur2590 <[email protected]> * update tests Signed-off-by: rohitthakur2590 <[email protected]> --------- Signed-off-by: rohitthakur2590 <[email protected]>
- Loading branch information
1 parent
2b6a1b7
commit eb7f548
Showing
5 changed files
with
141 additions
and
3 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
--- | ||
bugfixes: | ||
- Fix command generated for local-interface with in ntp server attribute. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
72 changes: 72 additions & 0 deletions
72
tests/integration/targets/eos_ntp_global/tests/common/update.yaml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,72 @@ | ||
--- | ||
- ansible.builtin.debug: | ||
msg: Start eos_ntp_global update integration tests ansible_connection={{ | ||
ansible_connection }} | ||
|
||
- block: | ||
- name: merge given ntp_global configuration | ||
become: true | ||
register: result | ||
arista.eos.eos_ntp_global: &update | ||
config: | ||
authenticate: | ||
enable: true | ||
authentication_keys: | ||
- algorithm: "sha1" | ||
encryption: 7 | ||
id: 2 | ||
key: "123456" | ||
- algorithm: "md5" | ||
encryption: 7 | ||
id: 23 | ||
key: "123456" | ||
local_interface: "Ethernet1" | ||
qos_dscp: 10 | ||
serve: | ||
access_lists: | ||
- acls: | ||
- acl_name: "acl01" | ||
direction: "in" | ||
afi: "ip" | ||
- acls: | ||
- acl_name: "acl02" | ||
direction: "in" | ||
afi: "ipv6" | ||
servers: | ||
- burst: true | ||
prefer: true | ||
server: "10.1.1.1" | ||
vrf: "vrf01" | ||
- burst: true | ||
minpoll: 13 | ||
prefer: true | ||
server: "11.21.1.1" | ||
vrf: "vrf01" | ||
- key_id: 2 | ||
maxpoll: 15 | ||
server: "25.1.1.1" | ||
vrf: "vrf01" | ||
- server: "1.1.1.1" | ||
vrf: "vrf01" | ||
local_interface: "Management1" | ||
trusted_key: "23" | ||
|
||
- ansible.builtin.assert: | ||
that: | ||
- result.commands|length == 12 | ||
- result.changed == true | ||
- result.commands|symmetric_difference(updated.commands) == [] | ||
- result.after == updated.after | ||
- result.before == {} | ||
|
||
- name: Idempotency check | ||
become: true | ||
register: result | ||
arista.eos.eos_ntp_global: *update | ||
|
||
- ansible.builtin.assert: | ||
that: | ||
- result.commands|length == 0 | ||
- result.changed == false | ||
always: | ||
- ansible.builtin.include_tasks: _remove_config.yaml |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters