mirror of
https://github.com/evilsocket/opensnitch.git
synced 2025-03-04 00:24:40 +01:00
updated sys-fw tests
This commit is contained in:
parent
54ac5a3549
commit
090bb0e2a4
2 changed files with 27 additions and 0 deletions
26
daemon/firewall/config/config_test.go
Normal file
26
daemon/firewall/config/config_test.go
Normal 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)
|
||||
}
|
||||
}
|
|
@ -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
|
||||
|
|
Loading…
Add table
Reference in a new issue