mirror of
https://github.com/evilsocket/opensnitch.git
synced 2025-03-04 08:34:40 +01:00
daemon/ui tests updated
This commit is contained in:
parent
6622df9d38
commit
5fa561607f
2 changed files with 8 additions and 3 deletions
|
@ -22,6 +22,9 @@ var (
|
||||||
DefaultDuration: "once",
|
DefaultDuration: "once",
|
||||||
InterceptUnknown: false,
|
InterceptUnknown: false,
|
||||||
Firewall: "nftables",
|
Firewall: "nftables",
|
||||||
|
Rules: config.RulesOptions{
|
||||||
|
Path: "/etc/opensnitchd/rules",
|
||||||
|
},
|
||||||
}
|
}
|
||||||
)
|
)
|
||||||
|
|
||||||
|
@ -75,6 +78,7 @@ func TestClientConfigReloading(t *testing.T) {
|
||||||
reloadConfig.DefaultAction = string(rule.Deny)
|
reloadConfig.DefaultAction = string(rule.Deny)
|
||||||
reloadConfig.InterceptUnknown = true
|
reloadConfig.InterceptUnknown = true
|
||||||
reloadConfig.Firewall = iptables.Name
|
reloadConfig.Firewall = iptables.Name
|
||||||
|
reloadConfig.FwOptions.QueueBypass = true
|
||||||
reloadConfig.Server.Address = "unix:///run/user/1000/opensnitch/osui.sock"
|
reloadConfig.Server.Address = "unix:///run/user/1000/opensnitch/osui.sock"
|
||||||
|
|
||||||
plainJSON, err := json.Marshal(reloadConfig)
|
plainJSON, err := json.Marshal(reloadConfig)
|
||||||
|
@ -84,7 +88,8 @@ func TestClientConfigReloading(t *testing.T) {
|
||||||
if err = config.Save(configFile, string(plainJSON)); err != nil {
|
if err = config.Save(configFile, string(plainJSON)); err != nil {
|
||||||
t.Errorf("error saving config to disk: %s", err)
|
t.Errorf("error saving config to disk: %s", err)
|
||||||
}
|
}
|
||||||
time.Sleep(time.Second * 3)
|
// wait for the config to load
|
||||||
|
time.Sleep(time.Second * 10)
|
||||||
|
|
||||||
validateConfig(t, uiClient, &reloadConfig)
|
validateConfig(t, uiClient, &reloadConfig)
|
||||||
})
|
})
|
||||||
|
|
4
daemon/ui/testdata/default-config.json.orig
vendored
4
daemon/ui/testdata/default-config.json.orig
vendored
|
@ -26,10 +26,10 @@
|
||||||
"FwOptions": {
|
"FwOptions": {
|
||||||
"ConfigPath": "/etc/opensnitchd/system-fw.json",
|
"ConfigPath": "/etc/opensnitchd/system-fw.json",
|
||||||
"MonitorInterval": "25s",
|
"MonitorInterval": "25s",
|
||||||
"ActionOnOverflow": "drop"
|
"QueueBypass": false
|
||||||
},
|
},
|
||||||
"Rules": {
|
"Rules": {
|
||||||
"Path": "",
|
"Path": "/etc/opensnitchd/rules",
|
||||||
"EnableChecksums": true
|
"EnableChecksums": true
|
||||||
},
|
},
|
||||||
"Ebpf": {
|
"Ebpf": {
|
||||||
|
|
Loading…
Add table
Reference in a new issue