From 1e3620c60a1a55f8fd37803886a661ed8f3b7fed Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Marcelina=20Ho=C5=82ub?= Date: Fri, 16 Feb 2024 23:13:19 +0100 Subject: [PATCH] chore: update test files --- daemon/firewall/nftables/monitor_test.go | 4 ++-- daemon/firewall/nftables/rules_test.go | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/daemon/firewall/nftables/monitor_test.go b/daemon/firewall/nftables/monitor_test.go index 570a1461bf..5e3202deab 100644 --- a/daemon/firewall/nftables/monitor_test.go +++ b/daemon/firewall/nftables/monitor_test.go @@ -22,10 +22,10 @@ func addInterceptionRules(nft *nftb.Nft, t *testing.T) { return } - if err, _ := nft.QueueDNSResponses(common.EnableRule, common.EnableRule); err != nil { + if err := nft.QueueDNSResponses(common.EnableRule, common.EnableRule); err != nil { t.Errorf("Error while running DNS nftables rule: %s", err) } - if err, _ := nft.QueueConnections(common.EnableRule, common.EnableRule); err != nil { + if err := nft.QueueConnections(common.EnableRule, common.EnableRule); err != nil { t.Errorf("Error while running conntrack nftables rule: %s", err) } } diff --git a/daemon/firewall/nftables/rules_test.go b/daemon/firewall/nftables/rules_test.go index e089909a91..9cd2db4389 100644 --- a/daemon/firewall/nftables/rules_test.go +++ b/daemon/firewall/nftables/rules_test.go @@ -155,8 +155,8 @@ func TestQueueConnections(t *testing.T) { t.Error("pre step add_chain() output-mangle-inet failed") } - if err1, err2 := nftest.Fw.QueueConnections(true, true); err1 != nil && err2 != nil { - t.Errorf("rule to queue connections not added: %s, %s", err1, err2) + if err := nftest.Fw.QueueConnections(true, true); err != nil { + t.Errorf("rule to queue connections not added: %v", err.AsError()) } r, _ := getRule(t, conn, exprs.NFT_CHAIN_MANGLE, exprs.NFT_HOOK_OUTPUT, nftb.InterceptionRuleKey, 0)