Skip to content

Commit 331d188

Browse files
committed
Add unit test for ansible-collections#512
1 parent 269c3cc commit 331d188

File tree

2 files changed

+62
-0
lines changed

2 files changed

+62
-0
lines changed
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
ip access-list TEST-LIST-1
2+
10 remark test
3+
20 permit tcp 192.0.2.0/24 any eq https log
4+
!
5+
ip access-list TEST-LIST-2
6+
10 remark test
7+
20 permit tcp 192.0.2.0/24 any eq https log
8+
!
9+
ip access-list TEST-LIST-3
10+
10 remark test
11+
20 permit tcp 192.0.2.0/24 any eq https log
12+
!

tests/unit/modules/network/eos/test_eos_acls.py

+50
Original file line numberDiff line numberDiff line change
@@ -397,6 +397,56 @@ def test_eos_acls_deletedafis(self):
397397
commands = ["no ip access-list test1"]
398398
self.execute_module(changed=True, commands=commands)
399399

400+
def test_eos_two_acls_idempotent(self):
401+
set_module_args(
402+
dict(
403+
config=[
404+
dict(
405+
afi="ipv4",
406+
acls=[
407+
dict(
408+
name="TEST-LIST-1",
409+
aces=[
410+
dict(
411+
sequence="10",
412+
remark="test",
413+
),
414+
dict(
415+
sequence="20",
416+
grant="permit",
417+
source=dict(subnet_address="192.0.2.0/24"),
418+
destination=dict(any="true", port_protocol=dict(eq="https")),
419+
protocol="tcp",
420+
log="true",
421+
),
422+
],
423+
),
424+
dict(
425+
name="TEST-LIST-2",
426+
aces=[
427+
dict(
428+
sequence="10",
429+
remark="test",
430+
),
431+
dict(
432+
sequence="20",
433+
grant="permit",
434+
log="true",
435+
destination=dict(any="true", port_protocol=dict(eq="https")),
436+
protocol="tcp",
437+
source=dict(subnet_address="192.0.2.0/24"),
438+
),
439+
],
440+
),
441+
],
442+
),
443+
],
444+
state="replaced",
445+
),
446+
)
447+
self.execute_module(changed=False, commands=[], filename="eos_acls_idempotent.cfg")
448+
449+
400450
def test_eos_acls_gathered(self):
401451
set_module_args(dict(config=[], state="gathered"))
402452
result = self.execute_module(

0 commit comments

Comments
 (0)