diff options
author | cyBerta <cyberta@riseup.net> | 2017-09-15 01:38:39 +0200 |
---|---|---|
committer | cyBerta <cyberta@riseup.net> | 2017-09-15 01:38:39 +0200 |
commit | dc9a7d39dc4cfe4c752704ffb4d1f02990da2dd1 (patch) | |
tree | 071f2dadae0f1cf731632d1c39eed2005484c688 /app/src/androidTest/java | |
parent | e6886df9083252282408cd1ee0149c88021ebb11 (diff) |
vpn certificate gets renewed 3 month before current certificate expires
Diffstat (limited to 'app/src/androidTest/java')
-rw-r--r-- | app/src/androidTest/java/se/leap/bitmaskclient/test/TestVpnCertificateValidator.java | 15 | ||||
-rw-r--r-- | app/src/androidTest/java/se/leap/bitmaskclient/test/VpnTestController.java | 2 |
2 files changed, 8 insertions, 9 deletions
diff --git a/app/src/androidTest/java/se/leap/bitmaskclient/test/TestVpnCertificateValidator.java b/app/src/androidTest/java/se/leap/bitmaskclient/test/TestVpnCertificateValidator.java index 2704bcad..323e7e6d 100644 --- a/app/src/androidTest/java/se/leap/bitmaskclient/test/TestVpnCertificateValidator.java +++ b/app/src/androidTest/java/se/leap/bitmaskclient/test/TestVpnCertificateValidator.java @@ -49,7 +49,6 @@ public class TestVpnCertificateValidator extends InstrumentationTestCase { } - //TODO: This test proves that the validation method is weird. Valid dates range between Nov. 2oo6 and Nov. 2017 instead of Nov. 2012 and Nov.2022 public void testIsValid() { VpnCertificateValidator validator = new VpnCertificateValidator(certificate_valid_from_nov2012_to_nov2022); Calendar calendar = Calendar.getInstance(); @@ -60,26 +59,26 @@ public class TestVpnCertificateValidator extends InstrumentationTestCase { validator.setCalendarProvider(new TestCalendarProvider(calendar.getTimeInMillis())); assertFalse(validator.isValid()); - calendar.set(Calendar.YEAR, 2010); + calendar.set(Calendar.YEAR, 2011); calendar.set(Calendar.MONTH, Calendar.NOVEMBER); calendar.set(Calendar.DAY_OF_MONTH, 6); validator.setCalendarProvider(new TestCalendarProvider(calendar.getTimeInMillis())); - assertTrue(validator.isValid()); + assertFalse(validator.isValid()); - calendar.set(Calendar.YEAR, 2011); + calendar.set(Calendar.YEAR, 2012); calendar.set(Calendar.MONTH, Calendar.NOVEMBER); calendar.set(Calendar.DAY_OF_MONTH, 6); validator.setCalendarProvider(new TestCalendarProvider(calendar.getTimeInMillis())); assertTrue(validator.isValid()); - calendar.set(Calendar.YEAR, 2017); - calendar.set(Calendar.MONTH, Calendar.NOVEMBER); + calendar.set(Calendar.YEAR, 2022); + calendar.set(Calendar.MONTH, Calendar.AUGUST); calendar.set(Calendar.DAY_OF_MONTH, 5); validator.setCalendarProvider(new TestCalendarProvider(calendar.getTimeInMillis())); assertTrue(validator.isValid()); - calendar.set(Calendar.YEAR, 2017); - calendar.set(Calendar.MONTH, Calendar.NOVEMBER); + calendar.set(Calendar.YEAR, 2022); + calendar.set(Calendar.MONTH, Calendar.AUGUST); calendar.set(Calendar.DAY_OF_MONTH, 6); validator.setCalendarProvider(new TestCalendarProvider(calendar.getTimeInMillis())); assertFalse(validator.isValid()); diff --git a/app/src/androidTest/java/se/leap/bitmaskclient/test/VpnTestController.java b/app/src/androidTest/java/se/leap/bitmaskclient/test/VpnTestController.java index 9dcb4da1..b0996032 100644 --- a/app/src/androidTest/java/se/leap/bitmaskclient/test/VpnTestController.java +++ b/app/src/androidTest/java/se/leap/bitmaskclient/test/VpnTestController.java @@ -65,7 +65,7 @@ public class VpnTestController { return iconShowsConnected(); } }; - assertTrue("condition iconShowsConnected not fulfilled within " + max_seconds_until_connected * 1000 + " seconds." , solo.waitForCondition(condition, max_seconds_until_connected * 1000)); + assertTrue("condition iconShowsConnected not fulfilled within " + max_seconds_until_connected + " seconds." , solo.waitForCondition(condition, max_seconds_until_connected * 1000)); sleepSeconds(2); } |