From 207e77d272c70d15556011fe63b0eec80d451242 Mon Sep 17 00:00:00 2001 From: Norbel Ambanumben Date: Mon, 16 Oct 2023 07:38:04 +0100 Subject: [PATCH 1/4] Updates test runner to append error messages if morethan one is recieved from the `CLI` --- .../ooniprobe/test/test/AbstractTest.java | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/app/src/main/java/org/openobservatory/ooniprobe/test/test/AbstractTest.java b/app/src/main/java/org/openobservatory/ooniprobe/test/test/AbstractTest.java index 2f66abdb7..d1e964b38 100644 --- a/app/src/main/java/org/openobservatory/ooniprobe/test/test/AbstractTest.java +++ b/app/src/main/java/org/openobservatory/ooniprobe/test/test/AbstractTest.java @@ -319,8 +319,14 @@ private void setDataUsage(EventResult.Value value, Result result) { } private void setFailureMsg(EventResult.Value value, Result result) { - if (result == null) return; - result.failure_msg = value.failure; + if (result == null) { + return; + } + if (result.failure_msg == null) { + result.failure_msg = value.failure; + } else { + result.failure_msg = String.format("%s\n\n%s", result.failure_msg, value.failure); + } result.save(); } From 4d4f6861eaf450a7e24367f5367275d9fd2364b6 Mon Sep 17 00:00:00 2001 From: Norbel Ambanumben Date: Mon, 16 Oct 2023 07:46:58 +0100 Subject: [PATCH 2/4] Updates `Overviewactivity` copy for experimental tests. --- .../openobservatory/ooniprobe/activity/OverviewActivity.java | 1 + .../openobservatory/ooniprobe/test/suite/ExperimentalSuite.java | 2 +- 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/app/src/main/java/org/openobservatory/ooniprobe/activity/OverviewActivity.java b/app/src/main/java/org/openobservatory/ooniprobe/activity/OverviewActivity.java index d7b9c4997..60d418a96 100644 --- a/app/src/main/java/org/openobservatory/ooniprobe/activity/OverviewActivity.java +++ b/app/src/main/java/org/openobservatory/ooniprobe/activity/OverviewActivity.java @@ -58,6 +58,7 @@ public static Intent newIntent(Context context, AbstractSuite testSuite) { String experimentalLinks = "\n\n* [STUN Reachability](https://github.com/ooni/spec/blob/master/nettests/ts-025-stun-reachability.md)" + "\n\n* [DNS Check](https://github.com/ooni/spec/blob/master/nettests/ts-028-dnscheck.md)" + + "\n\n* [ECH Check](https://github.com/ooni/spec/blob/master/nettests/ts-039-echcheck.md)" + "\n\n* [Tor Snowflake](https://ooni.org/nettest/tor-snowflake/) "+ String.format(" ( %s )",getString(R.string.Settings_TestOptions_LongRunningTest))+ "\n\n* [Vanilla Tor](https://github.com/ooni/spec/blob/master/nettests/ts-016-vanilla-tor.md) " + String.format(" ( %s )",getString(R.string.Settings_TestOptions_LongRunningTest)); Markwon.setMarkdown(binding.desc, getString(testSuite.getDesc1(), experimentalLinks)); diff --git a/app/src/main/java/org/openobservatory/ooniprobe/test/suite/ExperimentalSuite.java b/app/src/main/java/org/openobservatory/ooniprobe/test/suite/ExperimentalSuite.java index 6622af00c..6f887bfe6 100644 --- a/app/src/main/java/org/openobservatory/ooniprobe/test/suite/ExperimentalSuite.java +++ b/app/src/main/java/org/openobservatory/ooniprobe/test/suite/ExperimentalSuite.java @@ -40,9 +40,9 @@ public AbstractTest[] getTestList(@Nullable PreferenceManager pm) { if (super.getTestList(pm) == null) { ArrayList list = new ArrayList<>(); if (pm == null || pm.isExperimentalOn()){ - list.add(new Experimental("echcheck")); list.add(new Experimental("stunreachability")); list.add(new Experimental("dnscheck")); + list.add(new Experimental("echcheck")); if ((pm == null || pm.isLongRunningTestsInForeground()) || getAutoRun()){ list.add(new Experimental("torsf")); list.add(new Experimental("vanilla_tor")); From 22958902c69b3e14308a87901604d97ce1948114 Mon Sep 17 00:00:00 2001 From: Norbel Ambanumben Date: Tue, 17 Oct 2023 10:11:11 +0100 Subject: [PATCH 3/4] Updates experimental test suite --- .../test/suite/ExperimentalSuiteTest.java | 16 ++++++++++------ 1 file changed, 10 insertions(+), 6 deletions(-) diff --git a/app/src/test/java/org/openobservatory/ooniprobe/test/suite/ExperimentalSuiteTest.java b/app/src/test/java/org/openobservatory/ooniprobe/test/suite/ExperimentalSuiteTest.java index 3f4daac7c..8b9fbd37d 100644 --- a/app/src/test/java/org/openobservatory/ooniprobe/test/suite/ExperimentalSuiteTest.java +++ b/app/src/test/java/org/openobservatory/ooniprobe/test/suite/ExperimentalSuiteTest.java @@ -34,11 +34,13 @@ public void getTestList_experimental_on() { List tests = Arrays.asList(suite.getTestList(pm)); - assertEquals(2, tests.size()); + assertEquals(3, tests.size()); assertEquals(Experimental.class, tests.get(0).getClass()); assertEquals(Experimental.class, tests.get(1).getClass()); + assertEquals(Experimental.class, tests.get(2).getClass()); assertEquals("stunreachability", tests.get(0).getName()); assertEquals("dnscheck", tests.get(1).getName()); + assertEquals("echcheck", tests.get(2).getName()); } @Test @@ -48,15 +50,17 @@ public void getTestList_experimental_on_autorun_on() { List tests = Arrays.asList(autoRunSuite.getTestList(pm)); - assertEquals(4, tests.size()); + assertEquals(5, tests.size()); assertEquals(Experimental.class, tests.get(0).getClass()); assertEquals(Experimental.class, tests.get(1).getClass()); assertEquals(Experimental.class, tests.get(2).getClass()); assertEquals(Experimental.class, tests.get(3).getClass()); + assertEquals(Experimental.class, tests.get(4).getClass()); - assertEquals("torsf", tests.get(0).getName()); - assertEquals("vanilla_tor", tests.get(1).getName()); - assertEquals("stunreachability", tests.get(2).getName()); - assertEquals("dnscheck", tests.get(3).getName()); + assertEquals("stunreachability", tests.get(0).getName()); + assertEquals("dnscheck", tests.get(1).getName()); + assertEquals("echcheck", tests.get(2).getName()); + assertEquals("torsf", tests.get(3).getName()); + assertEquals("vanilla_tor", tests.get(4).getName()); } } From 53366241ff41da8a0fae72c59e5f066802cfdef7 Mon Sep 17 00:00:00 2001 From: Norbel Ambanumben Date: Tue, 17 Oct 2023 10:15:59 +0100 Subject: [PATCH 4/4] Updated circumventiont suite test --- .../ooniprobe/test/suite/CircumventionSuiteTest.java | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/app/src/test/java/org/openobservatory/ooniprobe/test/suite/CircumventionSuiteTest.java b/app/src/test/java/org/openobservatory/ooniprobe/test/suite/CircumventionSuiteTest.java index f2a5a2841..0e71d16c9 100644 --- a/app/src/test/java/org/openobservatory/ooniprobe/test/suite/CircumventionSuiteTest.java +++ b/app/src/test/java/org/openobservatory/ooniprobe/test/suite/CircumventionSuiteTest.java @@ -39,11 +39,10 @@ public void getTestList_full() { List tests = Arrays.asList(suite.getTestList(pm)); - // Psiphon and Tor. Riseup VPN has been temporarily disabled. - assertEquals(2, tests.size()); + assertEquals(3, tests.size()); assertTrue(findTestClass(tests, Psiphon.class)); assertTrue(findTestClass(tests, Tor.class)); -// assertTrue(findTestClass(tests, RiseupVPN.class)); + assertTrue(findTestClass(tests, RiseupVPN.class)); } private boolean findTestClass(List tests, Class klass) {