Skip to content

Commit

Permalink
Update Refresh tests
Browse files Browse the repository at this point in the history
  • Loading branch information
devzbysiu committed Dec 18, 2024
1 parent 186e608 commit ea4b2a7
Showing 1 changed file with 13 additions and 1 deletion.
14 changes: 13 additions & 1 deletion networker/networker_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -1872,7 +1872,19 @@ func TestCombined_Refresh(t *testing.T) {
for _, rule := range fw.rules {
ruleNames = append(ruleNames, rule.Name)
}
assert.Equal(t, 6, len(fw.rules), "%d firewall rules were configured, expected 5, rules content: \n%s",

// fileshare is forbidden here, so no new fileshare rules were added
assert.Equal(t, 5, len(fw.rules), "%d firewall rules were configured, expected 5, rules content: \n%s",
len(fw.rules),
strings.Join(ruleNames, "\n"))

// permit fileshare
netw.isFilesharePermitted = true

netw.Refresh(machineMap)

// now, after refresh, fileshare rules are also added
assert.Equal(t, 6, len(fw.rules), "%d firewall rules were configured, expected 6, rules content: \n%s",
len(fw.rules),
strings.Join(ruleNames, "\n"))

Expand Down

0 comments on commit ea4b2a7

Please sign in to comment.