Skip to content

Commit

Permalink
Merge pull request #454 from untangle/MFW-5962
Browse files Browse the repository at this point in the history
MFW-5962: Added dns filter license
version: bug
  • Loading branch information
sumedha-game authored Dec 23, 2024
2 parents 3bd3420 + 045e85c commit be3d87e
Show file tree
Hide file tree
Showing 7 changed files with 32 additions and 5 deletions.
14 changes: 14 additions & 0 deletions services/licensemanager/licensesmanager_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down Expand Up @@ -151,6 +152,7 @@ func TestGetLicenseDetails(t *testing.T) {
"Database Services",
"Device Discovery",
"Captive Portal",
"DNS Filter",
"Dynamic Blocklists",
}

Expand Down Expand Up @@ -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 {
Expand Down Expand Up @@ -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{
Expand Down Expand Up @@ -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
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
{"name":"untangle-node-dns-filter","allowedState":1}
Original file line number Diff line number Diff line change
@@ -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}]
[{"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}]
Original file line number Diff line number Diff line change
@@ -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}]
[{"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}]
Original file line number Diff line number Diff line change
@@ -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}]
[{"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}]
Original file line number Diff line number Diff line change
@@ -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}]
[{"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}]
14 changes: 13 additions & 1 deletion services/licensemanager/testdata/licenses/licenses.json
Original file line number Diff line number Diff line change
Expand Up @@ -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",
Expand All @@ -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"
}
]
}

0 comments on commit be3d87e

Please sign in to comment.