Skip to content

Commit

Permalink
updated sys-fw tests
Browse files Browse the repository at this point in the history
  • Loading branch information
gustavo-iniguez-goya committed Dec 20, 2023
1 parent 54ac5a3 commit 090bb0e
Show file tree
Hide file tree
Showing 2 changed files with 27 additions and 0 deletions.
26 changes: 26 additions & 0 deletions daemon/firewall/config/config_test.go
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
package config

import (
"testing"
)

func preloadConfCallback() {
}

func reloadConfCallback() {
}

func TestNftLoadFromDisk(t *testing.T) {
/*skipIfNotPrivileged(t)
conn, newNS = OpenSystemConn(t)
defer CleanupSystemConn(t, newNS)
nft.conn = conn
*/
cfg := &Config{}
cfg.NewSystemFwConfig("", preloadConfCallback, reloadConfCallback)
cfg.SetConfigFile("../nftables/testdata/test-sysfw-conf.json")
if err := cfg.LoadDiskConfiguration(false); err != nil {
t.Errorf("Error loading config from disk: %s", err)
}
}
1 change: 1 addition & 0 deletions daemon/firewall/nftables/monitor_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -85,6 +85,7 @@ func TestMonitorReload(t *testing.T) {
defer nftest.CleanupSystemConn(t, newNS)
nftest.Fw.Conn = conn

nftest.Fw.SetRulesCheckerInterval("10s")
nftest.Fw.EnableInterception()

// test that rules are reloaded after being deleted, but also
Expand Down

0 comments on commit 090bb0e

Please sign in to comment.