summaryrefslogtreecommitdiff
path: root/main/src/testui
diff options
context:
space:
mode:
authorArne Schwabe <arne@rfc2549.org>2021-10-08 02:22:07 +0200
committerArne Schwabe <arne@rfc2549.org>2021-10-08 02:22:07 +0200
commit9ca2ff6f0688ae6c987f0fa6fe50f1b2fc2425d7 (patch)
treea7195b5a82f7d829c5671fb379046a774d882c86 /main/src/testui
parent34be3fa975cc7693e8f0203e7dbe5a60df8525a2 (diff)
Add red warnings if a profile uses deprecated/insecure options
Diffstat (limited to 'main/src/testui')
-rw-r--r--main/src/testui/java/de/blinkt/openvpn/core/TestUiUtils.kt13
1 files changed, 13 insertions, 0 deletions
diff --git a/main/src/testui/java/de/blinkt/openvpn/core/TestUiUtils.kt b/main/src/testui/java/de/blinkt/openvpn/core/TestUiUtils.kt
index 8bc2e4fa..040606cf 100644
--- a/main/src/testui/java/de/blinkt/openvpn/core/TestUiUtils.kt
+++ b/main/src/testui/java/de/blinkt/openvpn/core/TestUiUtils.kt
@@ -1,3 +1,4 @@
+import de.blinkt.openvpn.VpnProfile
import de.blinkt.openvpn.fragments.Utils
import org.junit.Assert
import org.junit.Test
@@ -9,4 +10,16 @@ class TestUiUtils {
Assert.assertEquals(0, Utils.mapCompatVer(20707))
Assert.assertEquals(3, Utils.mapCompatVer(11723))
}
+
+ @Test
+ fun testWarnings() {
+ val vp = VpnProfile("unittest")
+ vp.mUseCustomConfig = true;
+ vp.mCustomConfigOptions = "\ntls-cipher DEFAULT:@SECLEVEL=0\n"
+
+ val warnings = mutableListOf<String>()
+ Utils.addSoftWarnings(warnings, vp)
+ Assert.assertTrue(warnings.size >= 1)
+
+ }
} \ No newline at end of file