summaryrefslogtreecommitdiff
path: root/main/src/test/java/de/blinkt/openvpn
diff options
context:
space:
mode:
Diffstat (limited to 'main/src/test/java/de/blinkt/openvpn')
-rw-r--r--main/src/test/java/de/blinkt/openvpn/core/TestConfigParser.kt19
1 files changed, 19 insertions, 0 deletions
diff --git a/main/src/test/java/de/blinkt/openvpn/core/TestConfigParser.kt b/main/src/test/java/de/blinkt/openvpn/core/TestConfigParser.kt
index 0830c32c..53bfd00a 100644
--- a/main/src/test/java/de/blinkt/openvpn/core/TestConfigParser.kt
+++ b/main/src/test/java/de/blinkt/openvpn/core/TestConfigParser.kt
@@ -106,6 +106,25 @@ class TestConfigParser {
Assert.assertEquals(vp.mExcludedRoutes.trim(), "8.8.8.8/32");
}
+ @Test
+ fun testOneDNSImport()
+ {
+ val config = "client\n" +
+ "tun-mtu 1234\n" +
+ "<connection>\n" +
+ "remote foo.bar\n" +
+ "tun-mtu 1222\n" +
+ "</connection>\n" +
+ "route 8.8.8.8 255.255.255.255 net_gateway\n" +
+ "dhcp-option DNS 1.2.3.4\n"
+
+ val cp = ConfigParser()
+ cp.parseConfig(StringReader(config))
+ val vp = cp.convertProfile()
+
+ Assert.assertEquals("1.2.3.4", vp.mDNS1)
+ Assert.assertEquals("" , vp.mDNS2)
+ }
@Test
fun testCipherImport() {