add client tests

This commit is contained in:
bakito
2021-04-11 14:56:33 +02:00
parent e7a2604268
commit 4921af09a5
13 changed files with 390 additions and 15 deletions

4
testdata/blockedservices-list.json vendored Normal file
View File

@@ -0,0 +1,4 @@
[
"9gag",
"dailymotion"
]

81
testdata/clients.json vendored Normal file
View File

@@ -0,0 +1,81 @@
{
"clients": [
{
"ids": [
"192.168.1.3"
],
"tags": [
"device_pc"
],
"name": "PC",
"use_global_settings": true,
"filtering_enabled": false,
"parental_enabled": false,
"safesearch_enabled": false,
"safebrowsing_enabled": false,
"use_global_blocked_services": true,
"blocked_services": null,
"upstreams": null,
"whois_info": null,
"disallowed": false,
"disallowed_rule": ""
},
{
"ids": [
"192.168.1.2"
],
"tags": [
"device_phone"
],
"name": "Phone LAN",
"use_global_settings": true,
"filtering_enabled": false,
"parental_enabled": false,
"safesearch_enabled": false,
"safebrowsing_enabled": false,
"use_global_blocked_services": false,
"blocked_services": [
"facebook",
"ok",
"vk",
"mail_ru",
"qq"
],
"upstreams": [],
"whois_info": null,
"disallowed": false,
"disallowed_rule": ""
}
],
"auto_clients": [
{
"ip": "127.0.0.1",
"name": "localhost",
"source": "etc/hosts",
"whois_info": {}
}
],
"supported_tags": [
"device_audio",
"device_camera",
"device_gameconsole",
"device_laptop",
"device_nas",
"device_other",
"device_pc",
"device_phone",
"device_printer",
"device_securityalarm",
"device_tablet",
"device_tv",
"os_android",
"os_ios",
"os_linux",
"os_macos",
"os_other",
"os_windows",
"user_admin",
"user_child",
"user_regular"
]
}

3
testdata/parental-status.json vendored Normal file
View File

@@ -0,0 +1,3 @@
{
"enabled": true
}

5
testdata/querylog_info.json vendored Normal file
View File

@@ -0,0 +1,5 @@
{
"enabled": true,
"interval": 90,
"anonymize_client_ip": false
}

10
testdata/rewrite-list.json vendored Normal file
View File

@@ -0,0 +1,10 @@
[
{
"domain": "foo.com",
"answer": "192.168.1.10"
},
{
"domain": "bar.com",
"answer": "192.168.1.12"
}
]

3
testdata/safebrowsing-status.json vendored Normal file
View File

@@ -0,0 +1,3 @@
{
"enabled": true
}

3
testdata/safesearch-status.json vendored Normal file
View File

@@ -0,0 +1,3 @@
{
"enabled": true
}

3
testdata/stats_info.json vendored Normal file
View File

@@ -0,0 +1,3 @@
{
"interval": 1
}

12
testdata/status.json vendored Normal file
View File

@@ -0,0 +1,12 @@
{
"dns_addresses": [
"192.168.1.2"
],
"dns_port": 53,
"http_port": 45158,
"protection_enabled": true,
"dhcp_available": true,
"running": true,
"version": "v0.105.2",
"language": "en"
}