Skip to content

Commit ba877b2

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

File tree

2 files changed

+65
-0
lines changed

2 files changed

+65
-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

+53
Original file line numberDiff line numberDiff line change
@@ -397,6 +397,59 @@ 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(
419+
any="true", port_protocol=dict(eq="https")
420+
),
421+
protocol="tcp",
422+
log="true",
423+
),
424+
],
425+
),
426+
dict(
427+
name="TEST-LIST-2",
428+
aces=[
429+
dict(
430+
sequence="10",
431+
remark="test",
432+
),
433+
dict(
434+
sequence="20",
435+
grant="permit",
436+
log="true",
437+
destination=dict(
438+
any="true", port_protocol=dict(eq="https")
439+
),
440+
protocol="tcp",
441+
source=dict(subnet_address="192.0.2.0/24"),
442+
),
443+
],
444+
),
445+
],
446+
),
447+
],
448+
state="replaced",
449+
),
450+
)
451+
self.execute_module(changed=False, commands=[], filename="eos_acls_idempotent.cfg")
452+
400453
def test_eos_acls_gathered(self):
401454
set_module_args(dict(config=[], state="gathered"))
402455
result = self.execute_module(

0 commit comments

Comments
 (0)