Skip to content

Commit c761c29

Browse files
committed
fix(core.py): relax riseupvpn scoring logic
This diff relaxes the riseupvpn scoring logic because we have determined in ooni/probe-cli#1125 (comment) that we want this experiment to just collect data useful to riseup. Note that I needed to change test_aggregation.py as a result of these changes because the number of ok and anomaly results changed. Closes #745.
1 parent 6ecccef commit c761c29

File tree

4 files changed

+7
-35
lines changed

4 files changed

+7
-35
lines changed

api/tests/integ/test_aggregation.py

+2-2
Original file line numberDiff line numberDiff line change
@@ -301,12 +301,12 @@ def test_aggregation_x_axis_only_hour(client, log):
301301
"dimension_count": 1,
302302
"result": [
303303
{
304-
"anomaly_count": 688,
304+
"anomaly_count": 687,
305305
"confirmed_count": 42,
306306
"failure_count": 721,
307307
"measurement_count": 9990,
308308
"measurement_start_day": "2021-07-09T00:00:00Z",
309-
"ok_count": 8539,
309+
"ok_count": 8540,
310310
},
311311
{
312312
"anomaly_count": 0,

fastpath/fastpath/core.py

+3-17
Original file line numberDiff line numberDiff line change
@@ -1432,23 +1432,9 @@ def score_riseupvpn(msm: dict) -> dict:
14321432
"""Calculate measurement scoring for RiseUp VPN
14331433
Returns a scores dict
14341434
"""
1435-
# https://github.com/ooni/backend/issues/541
1436-
scores = init_scores()
1437-
tk = g_or(msm, "test_keys", {})
1438-
tstatus = tk.get("transport_status") or {}
1439-
obfs4 = tstatus.get("obfs4")
1440-
openvpn = tstatus.get("openvpn")
1441-
anomaly = (
1442-
tk.get("api_status") == "blocked"
1443-
or tk.get("ca_cert_status") is False
1444-
or obfs4 == "blocked"
1445-
or openvpn == "blocked"
1446-
)
1447-
if anomaly:
1448-
scores["blocking_general"] = 1.0
1449-
1450-
scores["extra"] = dict(test_runtime=msm.get("test_runtime"))
1451-
return scores
1435+
# originally, there was scoring: https://github.com/ooni/backend/issues/541
1436+
# on 2023-10-17, we disabled scoring: https://github.com/ooni/backend/issues/745
1437+
return {}
14521438

14531439

14541440
def score_openvpn(msm: dict) -> dict:

fastpath/fastpath/tests/test_functional.py

+1-8
Original file line numberDiff line numberDiff line change
@@ -1217,14 +1217,7 @@ def test_score_torsf():
12171217
def test_score_riseupvpn():
12181218
for can_fn, msm in minicans("riseupvpn", date(2021, 10, 15), date(2021, 10, 16), 1):
12191219
scores = fp.score_measurement(msm)
1220-
assert scores == {
1221-
"blocking_general": 0.0,
1222-
"blocking_global": 0.0,
1223-
"blocking_country": 0.0,
1224-
"blocking_isp": 0.0,
1225-
"blocking_local": 0.0,
1226-
"extra": {"test_runtime": 3.8260852},
1227-
}
1220+
assert scores == {}
12281221
assert msm["report_id"] == "20211015T005140Z_riseupvpn_AR_7303_n1_gc8so3BXiS9thxBJ"
12291222
return
12301223

fastpath/fastpath/tests/test_unit.py

+1-8
Original file line numberDiff line numberDiff line change
@@ -505,14 +505,7 @@ def test_score_tor_list():
505505
def test_score_riseupvpn():
506506
msm = loadj("riseupvpn")
507507
scores = fp.score_measurement(msm)
508-
assert scores == {
509-
"blocking_general": 1.0,
510-
"blocking_global": 0.0,
511-
"blocking_country": 0.0,
512-
"blocking_isp": 0.0,
513-
"blocking_local": 0.0,
514-
"extra": {"test_runtime": 1.076507343},
515-
}
508+
assert scores == {}
516509

517510

518511
# # test_name: meek_fronted_requests_test

0 commit comments

Comments
 (0)