daemon/ui tests updated

This commit is contained in:
Gustavo Iñiguez Goia 2024-10-19 20:43:45 +02:00
parent 6622df9d38
commit 5fa561607f
Failed to generate hash of commit
2 changed files with 8 additions and 3 deletions

View file

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

View file

@ -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": {