Skip to content

Commit 74fa62d

Browse files
committed
Create naming definitions needed for tests vs. relying on defaults.
1 parent ee044dd commit 74fa62d

1 file changed

Lines changed: 7 additions & 3 deletions

File tree

tests/lib/paloaltofw_test.py

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -885,7 +885,11 @@ def testPanPorts(self):
885885
destination-port:: NTP
886886
"""
887887

888-
pol = policy.ParsePolicy(POL % T)
888+
definitions = naming.Naming()
889+
definitions._ParseLine('NTP = 123/tcp 123/udp', 'services')
890+
definitions._ParseLine('DNS = 53/tcp 53/udp', 'services')
891+
892+
pol = policy.ParsePolicy(POL % T, definitions)
889893
paloalto = paloaltofw.PaloAltoFW(pol, EXP_INFO)
890894
output = str(paloalto)
891895
name = "service-rule-1-udp"
@@ -901,7 +905,7 @@ def testPanPorts(self):
901905
source-port:: NTP
902906
"""
903907

904-
pol = policy.ParsePolicy(POL % T)
908+
pol = policy.ParsePolicy(POL % T, definitions)
905909
paloalto = paloaltofw.PaloAltoFW(pol, EXP_INFO)
906910
output = str(paloalto)
907911
name = "service-rule-1-udp"
@@ -918,7 +922,7 @@ def testPanPorts(self):
918922
destination-port:: NTP DNS
919923
"""
920924

921-
pol = policy.ParsePolicy(POL % T)
925+
pol = policy.ParsePolicy(POL % T, definitions)
922926
paloalto = paloaltofw.PaloAltoFW(pol, EXP_INFO)
923927
output = str(paloalto)
924928
name = "service-rule-1-tcp"

0 commit comments

Comments
 (0)