Skip to content
Snippets Groups Projects
Commit 14bd2c13 authored by Carlos Natalino Da Silva's avatar Carlos Natalino Da Silva
Browse files

Fixing the conditional that triggers response.

parent e6cf4df7
No related branches found
No related tags found
2 merge requests!235Release TeraFlowSDN 3.0,!210Fixing issues with the WebUI and the optical cybersecurity module
......@@ -221,7 +221,7 @@ class OpticalAttackDetectorServiceServicerImpl(OpticalAttackDetectorServiceServi
monitoring_client.IncludeKpi(kpi)
# if -1 in response.cluster_indices: # attack detected
if kpi.kpi_value.int32Val == -1:
if kpi.kpi_value.int32Val == 1:
attack = AttackDescription()
attack.cs_id.uuid = request.service_id.service_uuid.uuid
with HISTOGRAM_DURATION.labels(step="mitigation", **METRIC_LABELS).time():
......
......@@ -63,8 +63,6 @@ def test_detect_attack(
"opticalattackdetector.service.OpticalAttackDetectorServiceServicerImpl.monitoring_client.IncludeKpi",
) as monitoring, patch(
"opticalattackdetector.service.OpticalAttackDetectorServiceServicerImpl.dbscanserving_client.Detect",
# TODO: return dumb object with "cluster_indices" attribute
# idea: create new response object
return_value=message,
) as dbscanserving:
for _ in range(10):
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment