updated sys-fw tests

This commit is contained in:
Gustavo Iñiguez Goia 2023-12-20 23:02:45 +01:00
parent 54ac5a3549
commit 090bb0e2a4
Failed to generate hash of commit
2 changed files with 27 additions and 0 deletions

View file

@ -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)
}
}

View file

@ -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