diff --git a/services/licensemanager/licensesmanager_test.go b/services/licensemanager/licensesmanager_test.go index af5b76fa..d432ca3b 100644 --- a/services/licensemanager/licensesmanager_test.go +++ b/services/licensemanager/licensesmanager_test.go @@ -124,6 +124,7 @@ func TestGetLicenseDefaults(t *testing.T) { "untangle-node-geoip", "untangle-node-captiveportal", "untangle-node-dynamic-lists", + "untangle-node-dns-filter", } assert.ElementsMatch(t, expectedKeys, serviceKeys) @@ -151,6 +152,7 @@ func TestGetLicenseDetails(t *testing.T) { "Database Services", "Device Discovery", "Captive Portal", + "DNS Filter", "Dynamic Blocklists", } @@ -387,6 +389,7 @@ func (suite *LicenseManagerTestSuite) SetupSuite() { "untangle-node-geoip": {Name: "untangle-node-geoip", State: ServiceState{AllowedState: 0}}, "untangle-node-captiveportal": {Name: "untangle-node-captiveportal", State: ServiceState{AllowedState: 0}}, "untangle-node-dynamic-lists": {Name: "untangle-node-dynamic-lists", State: ServiceState{AllowedState: 0}}, + "untangle-node-dns-filter": {Name: "untangle-node-dns-filter", State: ServiceState{AllowedState: 0}}, } if startupErr := suite.lm.Startup(); startupErr != nil { @@ -499,6 +502,12 @@ func getTestConfig() *Config { Enabled: nil, Disabled: disableDynamicLists, }, + "untangle-node-dns-filter": { + Start: func() {}, + Stop: func() {}, + Enabled: nil, + Disabled: disableDnsFilter, + }, } return &Config{ @@ -545,6 +554,11 @@ func disableDynamicLists() (interface{}, []string, error) { return false, []string{"dynamic_lists", "enabled"}, nil } +// DisableDnsFilter +func disableDnsFilter() (interface{}, []string, error) { + return false, []string{"dnsfilter", "enabled"}, nil +} + func TestSetServices(t *testing.T) { config := getTestConfig() config.ServiceStateLocation = setServicesStatesMixedFile diff --git a/services/licensemanager/testdata/allowedstates/untangle-node-dns-filter b/services/licensemanager/testdata/allowedstates/untangle-node-dns-filter new file mode 100644 index 00000000..e2746c07 --- /dev/null +++ b/services/licensemanager/testdata/allowedstates/untangle-node-dns-filter @@ -0,0 +1 @@ +{"name":"untangle-node-dns-filter","allowedState":1} \ No newline at end of file diff --git a/services/licensemanager/testdata/appstates/appstate_disabled.json b/services/licensemanager/testdata/appstates/appstate_disabled.json index 65ae0ff5..9ec8e49d 100644 --- a/services/licensemanager/testdata/appstates/appstate_disabled.json +++ b/services/licensemanager/testdata/appstates/appstate_disabled.json @@ -1 +1 @@ -[{"name":"untangle-node-sitefilter","allowedState":1},{"name":"untangle-node-geoip","allowedState":1},{"name":"untangle-node-discovery","allowedState":1},{"name":"untangle-node-classd","allowedState":1},{"name":"untangle-node-dynamic-lists","allowedState":1},{"name":"untangle-node-threat-prevention","allowedState":1},{"name":"untangle-node-captiveportal","allowedState":1}] \ No newline at end of file +[{"name":"untangle-node-sitefilter","allowedState":1},{"name":"untangle-node-geoip","allowedState":1},{"name":"untangle-node-discovery","allowedState":1},{"name":"untangle-node-classd","allowedState":1},{"name":"untangle-node-dynamic-lists","allowedState":1},{"name":"untangle-node-threat-prevention","allowedState":1},{"name":"untangle-node-captiveportal","allowedState":1},{"name":"untangle-node-dns-filter","allowedState":1}] \ No newline at end of file diff --git a/services/licensemanager/testdata/appstates/appstate_enabled.json b/services/licensemanager/testdata/appstates/appstate_enabled.json index 20a9eab3..c2db3af3 100644 --- a/services/licensemanager/testdata/appstates/appstate_enabled.json +++ b/services/licensemanager/testdata/appstates/appstate_enabled.json @@ -1 +1 @@ -[{"name":"untangle-node-sitefilter","allowedState":0},{"name":"untangle-node-geoip","allowedState":0},{"name":"untangle-node-discovery","allowedState":0},{"name":"untangle-node-classd","allowedState":0},{"name":"untangle-node-dynamic-lists","allowedState":0},{"name":"untangle-node-threat-prevention","allowedState":0},{"name":"untangle-node-captiveportal","allowedState":0}] \ No newline at end of file +[{"name":"untangle-node-sitefilter","allowedState":0},{"name":"untangle-node-geoip","allowedState":0},{"name":"untangle-node-discovery","allowedState":0},{"name":"untangle-node-classd","allowedState":0},{"name":"untangle-node-dynamic-lists","allowedState":0},{"name":"untangle-node-threat-prevention","allowedState":0},{"name":"untangle-node-captiveportal","allowedState":0},{"name":"untangle-node-dns-filter","allowedState":0}] \ No newline at end of file diff --git a/services/licensemanager/testdata/appstates/appstate_mixed.json b/services/licensemanager/testdata/appstates/appstate_mixed.json index 44d2786d..f122b7a2 100644 --- a/services/licensemanager/testdata/appstates/appstate_mixed.json +++ b/services/licensemanager/testdata/appstates/appstate_mixed.json @@ -1 +1 @@ -[{"name":"untangle-node-threat-prevention","allowedState":1},{"name":"untangle-node-sitefilter","allowedState":0},{"name":"untangle-node-geoip","allowedState":0},{"name":"untangle-node-discovery","allowedState":0},{"name":"untangle-node-classd","allowedState":1},{"name":"untangle-node-dynamic-lists","allowedState":0},{"name":"untangle-node-captiveportal","allowedState":0}] \ No newline at end of file +[{"name":"untangle-node-threat-prevention","allowedState":1},{"name":"untangle-node-sitefilter","allowedState":0},{"name":"untangle-node-geoip","allowedState":0},{"name":"untangle-node-discovery","allowedState":0},{"name":"untangle-node-classd","allowedState":1},{"name":"untangle-node-dynamic-lists","allowedState":0},{"name":"untangle-node-captiveportal","allowedState":0},{"name":"untangle-node-dns-filter","allowedState":0}] \ No newline at end of file diff --git a/services/licensemanager/testdata/appstates/appstate_service_state.json b/services/licensemanager/testdata/appstates/appstate_service_state.json index 1460f8c4..ae817b2f 100644 --- a/services/licensemanager/testdata/appstates/appstate_service_state.json +++ b/services/licensemanager/testdata/appstates/appstate_service_state.json @@ -1 +1 @@ -[{"name":"untangle-node-captiveportal","allowedState":0},{"name":"untangle-node-threat-prevention","allowedState":1},{"name":"untangle-node-sitefilter","allowedState":0},{"name":"untangle-node-geoip","allowedState":0},{"name":"untangle-node-discovery","allowedState":0},{"name":"untangle-node-classd","allowedState":1},{"name":"untangle-node-dynamic-lists","allowedState":0}] \ No newline at end of file +[{"name":"untangle-node-captiveportal","allowedState":0},{"name":"untangle-node-threat-prevention","allowedState":1},{"name":"untangle-node-sitefilter","allowedState":0},{"name":"untangle-node-geoip","allowedState":0},{"name":"untangle-node-discovery","allowedState":0},{"name":"untangle-node-classd","allowedState":1},{"name":"untangle-node-dynamic-lists","allowedState":0},{"name":"untangle-node-dns-filter","allowedState":0}] \ No newline at end of file diff --git a/services/licensemanager/testdata/licenses/licenses.json b/services/licensemanager/testdata/licenses/licenses.json index 79523db7..66373ca0 100644 --- a/services/licensemanager/testdata/licenses/licenses.json +++ b/services/licensemanager/testdata/licenses/licenses.json @@ -100,6 +100,18 @@ "name": "untangle-node-captive-portal", "javaClass": "com.untangle.uvm.node.License" }, + { + "UID": "51d50b67-460b-4450-bd29-9bf1a69f4e81", + "type": "Subscription", + "end": 1737187200, + "start": 1734422400, + "seats": 1000000, + "displayName": "DNS Filter", + "key": "b78e6899564d22686271df2ca94ccd91", + "keyVersion": 3, + "name": "untangle-node-dns-filter", + "javaClass": "com.untangle.uvm.node.License" + }, { "UID": "43f90add-dca5-415c-9530-06fa29c9b4d9", @@ -111,7 +123,7 @@ "key": "90ba3b5264b10af43a205b7493118b3b", "keyVersion": 3, "name": "untangle-node-dynamic-lists", - "javaClass": "com.untangle.uvm.node.License" + "javaClass": "com.untangle.uvm.node.License" } ] } \ No newline at end of file