From b0a0805ab81aaa4e204ecfc77d3a6a7f7ed66b2f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Parm=C3=A9nides=20GV?= Date: Mon, 8 Jun 2015 19:56:43 +0200 Subject: s/buildtype/flavor, changed riseup's pin Riseup's EE certificate expired (EE = End-Entity, the commercial certificate signed by the issuer), and we weren't able to fetch provider.json because the pin wasn't valid. This problem needs to be avoided in the future, using HKPK (https://tools.ietf.org/html/rfc7469), which Micah's implementing on Riseup. Switching from build types from flavors enables us to run tests against production apk, not just debug. I didn't detect this pinning problem because tests were run only against the debug apk, which trusted preseeded providers by default (thus bypassing pinning issue). --- .../leap/bitmaskclient/test/ConnectionManager.java | 2 +- .../leap/bitmaskclient/test/testVpnFragment.java | 29 ++++++++++++++++------ 2 files changed, 23 insertions(+), 8 deletions(-) (limited to 'app/src/androidTest/java/se/leap') diff --git a/app/src/androidTest/java/se/leap/bitmaskclient/test/ConnectionManager.java b/app/src/androidTest/java/se/leap/bitmaskclient/test/ConnectionManager.java index a664c885..f7ab4b1e 100644 --- a/app/src/androidTest/java/se/leap/bitmaskclient/test/ConnectionManager.java +++ b/app/src/androidTest/java/se/leap/bitmaskclient/test/ConnectionManager.java @@ -16,7 +16,7 @@ public class ConnectionManager { try { method.invoke(conman, enabled); } catch (InvocationTargetException | IllegalAccessException e) { - e.printStackTrace(); + //e.printStackTrace(); } } } diff --git a/app/src/androidTest/java/se/leap/bitmaskclient/test/testVpnFragment.java b/app/src/androidTest/java/se/leap/bitmaskclient/test/testVpnFragment.java index 106d5cf2..d23be601 100644 --- a/app/src/androidTest/java/se/leap/bitmaskclient/test/testVpnFragment.java +++ b/app/src/androidTest/java/se/leap/bitmaskclient/test/testVpnFragment.java @@ -54,13 +54,28 @@ public class testVpnFragment extends BaseTestDashboard { } public void testVpnEveryProvider() { - String[] providers = {"demo.bitmask.net", "riseup.net", "calyx.net"}; - for(String provider : providers) { - changeProviderAndLogIn(provider); - vpn_controller.sleepSeconds(1); - vpn_controller.turnVpnOndAndOff(provider); - vpn_controller.sleepSeconds(1); - } + testDemoBitmaskNet(); + testRiseupNet(); + testCalyxNet(); + } + + private void testDemoBitmaskNet() { + testProvider("demo.bitmask.net"); + } + + private void testRiseupNet() { + testProvider("riseup.net"); + } + + private void testCalyxNet() { + testProvider("calyx.net"); + } + + private void testProvider(String provider) { + changeProviderAndLogIn(provider); + vpn_controller.sleepSeconds(1); + vpn_controller.turnVpnOndAndOff(provider); + vpn_controller.sleepSeconds(1); } public void testVpnIconIsDisplayed() { -- cgit v1.2.3