Skip to content

Commit

Permalink
Call c.setPath() with --unused
Browse files Browse the repository at this point in the history
  • Loading branch information
hknutzen committed Aug 4, 2023
1 parent 15a9c7a commit a88c228
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 1 deletion.
1 change: 1 addition & 0 deletions go/pkg/pass1/print-group.go
Original file line number Diff line number Diff line change
Expand Up @@ -215,6 +215,7 @@ func (c *spoc) printGroup(
// Prepare finding unused objects by marking used objects.
used := make(map[groupObj]bool)
if showUnused {
c.setPath()
sRules := c.normalizeServices()
c.stopOnErr()
process := func(rules []*serviceRule) {
Expand Down
15 changes: 14 additions & 1 deletion go/testdata/print-group/group.t
Original file line number Diff line number Diff line change
Expand Up @@ -107,7 +107,7 @@ router:r1 = {
}
router:r2 = {
managed;
model = ASA;
model = IOS;
routing = manual;
interface:n2 = { ip = 10.1.2.2; hardware = n2; }
interface:n3 = { ip = 10.1.3.2; hardware = n3; }
Expand All @@ -129,6 +129,19 @@ service:s = {
=OPTIONS=--unused
=PARAM=host:[network:n1, network:n3]
############################################################
=TITLE=Find unused interface when [auto] is in use
=INPUT=
[[topo]]
service:s = {
user = interface:r2.[auto];
permit src = network:n1; dst = user; prt = udp 161;
}
=OUTPUT=
10.1.3.2 interface:r2.n3
=OPTIONS=--unused
=PARAM=interface:r2.[all]
############################################################
=TITLE=Find unused hosts, ignore host of automatic group
# If host is only referenced in automatic group, it should be substituted
Expand Down

0 comments on commit a88c228

Please sign in to comment.