From ea4b2a773f9ff5cc5335840bbf99cb403e2e8089 Mon Sep 17 00:00:00 2001 From: Bartosz Zbytniewski Date: Wed, 18 Dec 2024 11:44:52 +0100 Subject: [PATCH] Update Refresh tests --- networker/networker_test.go | 14 +++++++++++++- 1 file changed, 13 insertions(+), 1 deletion(-) diff --git a/networker/networker_test.go b/networker/networker_test.go index 8fffd4ef..561f8a1c 100644 --- a/networker/networker_test.go +++ b/networker/networker_test.go @@ -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"))