Skip to content

Commit

Permalink
Moved riseup vpn to experimental suite and correct tests
Browse files Browse the repository at this point in the history
  • Loading branch information
aanorbel committed Oct 20, 2023
1 parent 69cc503 commit 0d4037d
Show file tree
Hide file tree
Showing 4 changed files with 12 additions and 11 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -44,8 +44,6 @@ public static CircumventionSuite initForAutoRun() {
list.add(new Psiphon());
if (pm == null || pm.isTestTor())
list.add(new Tor());
if (pm == null || pm.isTestRiseupVPN())
list.add(new RiseupVPN());
super.setTestList(Lists.transform(list, test -> {
if (getAutoRun()) test.setOrigin(AbstractTest.AUTORUN);
return test;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,7 @@ public AbstractTest[] getTestList(@Nullable PreferenceManager pm) {
if (pm == null || pm.isExperimentalOn()){
list.add(new Experimental("stunreachability"));
list.add(new Experimental("dnscheck"));
list.add(new Experimental("riseupvpn"));
list.add(new Experimental("echcheck"));
if ((pm == null || pm.isLongRunningTestsInForeground()) || getAutoRun()){
list.add(new Experimental("torsf"));
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,6 @@ public class CircumventionSuiteTest {
public void getTestList_empty() {
when(pm.isTestPsiphon()).thenReturn(false);
when(pm.isTestTor()).thenReturn(false);
when(pm.isTestRiseupVPN()).thenReturn(false);

AbstractTest[] tests = suite.getTestList(pm);

Expand All @@ -39,10 +38,9 @@ public void getTestList_full() {

List<AbstractTest> tests = Arrays.asList(suite.getTestList(pm));

assertEquals(3, tests.size());
assertEquals(2, tests.size());
assertTrue(findTestClass(tests, Psiphon.class));
assertTrue(findTestClass(tests, Tor.class));
assertTrue(findTestClass(tests, RiseupVPN.class));
}

private boolean findTestClass(List<AbstractTest> tests, Class<? extends AbstractTest> klass) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -34,13 +34,15 @@ public void getTestList_experimental_on() {

List<AbstractTest> tests = Arrays.asList(suite.getTestList(pm));

assertEquals(3, tests.size());
assertEquals(4, 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("stunreachability", tests.get(0).getName());
assertEquals("dnscheck", tests.get(1).getName());
assertEquals("echcheck", tests.get(2).getName());
assertEquals("riseupvpn", tests.get(2).getName());
assertEquals("echcheck", tests.get(3).getName());
}

@Test
Expand All @@ -50,17 +52,19 @@ public void getTestList_experimental_on_autorun_on() {

List<AbstractTest> tests = Arrays.asList(autoRunSuite.getTestList(pm));

assertEquals(5, tests.size());
assertEquals(6, 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(Experimental.class, tests.get(5).getClass());

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());
assertEquals("riseupvpn", tests.get(2).getName());
assertEquals("echcheck", tests.get(3).getName());
assertEquals("torsf", tests.get(4).getName());
assertEquals("vanilla_tor", tests.get(5).getName());
}
}

0 comments on commit 0d4037d

Please sign in to comment.