Skip to content

Commit

Permalink
issue #46 : test case for alias re-sorting
Browse files Browse the repository at this point in the history
  • Loading branch information
zerwes committed Dec 14, 2023
1 parent 9671b1a commit fc074f2
Show file tree
Hide file tree
Showing 3 changed files with 87 additions and 0 deletions.
31 changes: 31 additions & 0 deletions test/alias-testunsorted-expect.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
<?xml version='1.0' encoding='UTF-8'?>
<opnsense>
<filter>
</filter>
<OPNsense>
<Firewall>
<Alias>
<aliases>
<alias uuid="b9ca4f72-ab35-5c48-8460-d71a7ef50184">
<name>PRIVATE_NETWORKS</name>
<type>network</type>
<enabled>1</enabled>
<description>opn alias PRIVATE_NETWORKS</description>
<content>10.0.0.0/8
172.16.0.0/12
192.168.0.0/16</content>
</alias>
<alias uuid="b948ceaa-1ca9-5009-bad1-04660a926f87">
<name>HTTP_TCP</name>
<type>port</type>
<enabled>1</enabled>
<description>tcp http(s) ports</description>
<content>80
443
8443</content>
</alias>
</aliases>
</Alias>
</Firewall>
</OPNsense>
</opnsense>
30 changes: 30 additions & 0 deletions test/alias-testunsorted.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
<?xml version='1.0' encoding='UTF-8'?>
<opnsense>
<filter>
</filter>
<OPNsense>
<Firewall>
<Alias>
<aliases>
<alias uuid="b9ca4f72-ab35-5c48-8460-d71a7ef50184">
<name>PRIVATE_NETWORKS</name>
<type>network</type>
<enabled>1</enabled>
<description>opn alias PRIVATE_NETWORKS</description>
<content>10.0.0.0/8
172.16.0.0/12
192.168.0.0/16</content>
</alias>
<alias uuid="b948ceaa-1ca9-5009-bad1-04660a926f87">
<name>HTTP_TCP</name>
<type>port</type>
<enabled>1</enabled>
<description>tcp http(s) ports</description>
<content>80
443</content>
</alias>
</aliases>
</Alias>
</Firewall>
</OPNsense>
</opnsense>
26 changes: 26 additions & 0 deletions test/alias-testunsorted.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
---

opn_alias:
- uuid: b9ca4f72-ab35-5c48-8460-d71a7ef50184
settings:
- key: name
value: PRIVATE_NETWORKS
- key: content
list:
- 172.16.0.0/12
- 192.168.0.0/16
- 10.0.0.0/8
- key: content
list:
- 192.168.0.0/16
- 172.16.0.0/12
- 10.0.0.0/8
- uuid: b948ceaa-1ca9-5009-bad1-04660a926f87
settings:
- key: name
value: HTTP_TCP
- key: content
list:
- 80
- 443
- 8443

0 comments on commit fc074f2

Please sign in to comment.