Verified Commit b1fc0e1a authored by Cecylia Bocovich's avatar Cecylia Bocovich
Browse files

Update with control script

parent 491e0954
......@@ -4,6 +4,8 @@ This is a collection of scripts for performing automatic reachability tests of S
Datasets from multiple probe points are published by us at: https://people.torproject.org/~cohosh/bootstrap.csv
(You may want to run the bootstrap.csv file through the analysis/compare-with-control.pl script, to list only the lines where the bridges are known to be working in our control location.)
### Setup
......
#!/usr/bin/perl
# Take in a bootstrap.csv file, and only output the lines for tests where
# the control locale reached 100 in that test (i.e. for that runid and
# nickname).
#
# The goal is to discard test results where the control couldn't fully
# reach the bridge, because those are likely to be problems with the
# bridge rather than censorship.
#
# I picked "100" as the progress the control needed to reach, to be
# conservative, but in theory we might be able to pick some number
# between 10 and 100, since those indicate a successful connection but
# perhaps we just didn't wait long enough.
@lines = <>; # read the whole file
shift @lines; # discard the header legend line
$controlstring = "local"; # which country name is the control
# First: learn which bridges were tested in the control location
foreach (@lines) {
my @pieces = split(/,/);
if ($pieces[1] eq $controlstring) {
$controlresult{$pieces[2] . $pieces[3]} = $pieces[4];
}
}
# Second: go through and look for test probes where the control worked
foreach (@lines) {
my @pieces = split(/,/);
if ($pieces[1] ne $controlstring) {
$control = $controlresult{$pieces[2] . $pieces[3]};
if ($control == 100) {
print $_; # the control worked, so this is a real result.
$used{$pieces[2] . $pieces[3]} = 1; # remember we liked this test
}
}
}
# Last: go through and print control lines with corresponding test probes
foreach (@lines) {
my @pieces = split(/,/);
if ($pieces[1] eq $controlstring and $used{$pieces[2] . $pieces[3]} == 1) {
print $_;
}
}
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment