From dc9a7d39dc4cfe4c752704ffb4d1f02990da2dd1 Mon Sep 17 00:00:00 2001 From: cyBerta Date: Fri, 15 Sep 2017 01:38:39 +0200 Subject: vpn certificate gets renewed 3 month before current certificate expires --- .../bitmaskclient/test/TestVpnCertificateValidator.java | 15 +++++++-------- .../se/leap/bitmaskclient/test/VpnTestController.java | 2 +- 2 files changed, 8 insertions(+), 9 deletions(-) (limited to 'app/src/androidTest') 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); } -- cgit v1.2.3