summaryrefslogtreecommitdiffstats
path: root/chromeos/test
diff options
context:
space:
mode:
authorpneubeck@chromium.org <pneubeck@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2013-01-24 18:15:51 +0000
committerpneubeck@chromium.org <pneubeck@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2013-01-24 18:15:51 +0000
commitbb6152d36916b0b258387fd86f210c5ce3c10e5f (patch)
tree56c9628509bc54004c436d9ea08ac21b0fcb1d14 /chromeos/test
parent2c14542aa8d9099f61e3f918883df9330b8ab097 (diff)
downloadchromium_src-bb6152d36916b0b258387fd86f210c5ce3c10e5f.zip
chromium_src-bb6152d36916b0b258387fd86f210c5ce3c10e5f.tar.gz
chromium_src-bb6152d36916b0b258387fd86f210c5ce3c10e5f.tar.bz2
Adding a type check for properties with a shill_name in the ONC signature.
The translator is applied to input from Shill that is outside of Chrome. Thus we should guarantee validity of the resulting ONC. TBR=stevenjb@chromium.org (Added test files to chromeos only) BUG=171240 TEST=New unit test. Review URL: https://chromiumcodereview.appspot.com/12036008 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@178611 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'chromeos/test')
-rw-r--r--chromeos/test/data/network/shill_openvpn_with_errors.json27
-rw-r--r--chromeos/test/data/network/translation_of_shill_openvpn_with_errors.onc31
2 files changed, 58 insertions, 0 deletions
diff --git a/chromeos/test/data/network/shill_openvpn_with_errors.json b/chromeos/test/data/network/shill_openvpn_with_errors.json
new file mode 100644
index 0000000..322eda4
--- /dev/null
+++ b/chromeos/test/data/network/shill_openvpn_with_errors.json
@@ -0,0 +1,27 @@
+{
+ // Missing GUID.
+ "Type": "vpn",
+ "Name": "my vpn",
+ // String instead of Int.
+ "SaveCredentials": "false",
+ "Provider.Type": "openvpn",
+ "Provider.Host": "vpn.my.domain.com",
+ "OpenVPN.AuthRetry": "interact",
+ "OpenVPN.User": "abc ${LOGIN_EMAIL} def",
+ "OpenVPN.Password": "some password",
+ "OpenVPN.StaticChallenge": "Please enter token OTP",
+ "OpenVPN.CompLZO": "true",
+ // Int instead of String.
+ "OpenVPN.ServerPollTimeout": 10,
+ "OpenVPN.RemoteCertKU": "e0",
+ "OpenVPN.CACertNSS": "{14ff4d51-64c1-4c86-a622-054xyz}",
+ "OpenVPN.RemoteCertTLS": "server",
+ "OpenVPN.Port": "443",
+ "OpenVPN.TLSRemote": "my.domain.com",
+ "OpenVPN.KeyDirection": "1",
+ "OpenVPN.RenegSec": "0",
+ "OpenVPN.RemoteCertEKU": "TLS Web Server Authentication",
+ "OpenVPN.Proto": "udp",
+ "OpenVPN.PushPeerInfo": "true",
+ "OpenVPN.TLSAuthContents": "-----BEGIN OpenVPN Static key V1-----\n83f8e7ccd99be189b4663e18615f9166\nd885cdea6c8accb0ebf5be304f0b8081\n5404f2a6574e029815d7a2fb65b83d0c\n676850714c6a56b23415a78e06aad6b1\n34900dd512049598382039e4816cb5ff\n1848532b71af47578c9b4a14b5bca49f\n99e0ae4dae2f4e5eadfea374aeb8fb1e\na6fdf02adc73ea778dfd43d64bf7bc75\n7779d629498f8c2fbfd32812bfdf6df7\n8cebafafef3e5496cb13202274f2768a\n1959bc53d67a70945c4c8c6f34b63327\nfb60dc84990ffec1243461e0b6310f61\ne90aee1f11fb6292d6f5fcd7cd508aab\n50d80f9963589c148cb4b933ec86128d\ned77d3fad6005b62f36369e2319f52bd\n09c6d2e52cce2362a05009dc29b6b39a\n-----END OpenVPN Static key V1-----\n"
+}
diff --git a/chromeos/test/data/network/translation_of_shill_openvpn_with_errors.onc b/chromeos/test/data/network/translation_of_shill_openvpn_with_errors.onc
new file mode 100644
index 0000000..87ffdfb
--- /dev/null
+++ b/chromeos/test/data/network/translation_of_shill_openvpn_with_errors.onc
@@ -0,0 +1,31 @@
+{
+ // "GUID" missing because it was missing in the Shill dict.
+ "Name": "my vpn",
+ "Type": "VPN",
+ "VPN": {
+ "Host": "vpn.my.domain.com",
+ "Type": "OpenVPN",
+ "OpenVPN": {
+ "AuthRetry": "interact",
+ "CompLZO": "true",
+ "KeyDirection": "1",
+ "Password": "some password",
+ "Port": 443,
+ "Proto": "udp",
+ "PushPeerInfo": true,
+ "RemoteCertEKU": "TLS Web Server Authentication",
+ "RemoteCertKU": [
+ "e0"
+ ],
+ "RemoteCertTLS": "server",
+ "RenegSec": 0,
+ // "SaveCredentials" missing because of wrong type in the Shill dict.
+ "ServerCARef": "{14ff4d51-64c1-4c86-a622-054xyz}",
+ // "ServerPollTimeout" missing because of wrong type in the Shill dict.
+ "StaticChallenge": "Please enter token OTP",
+ "TLSAuthContents": "-----BEGIN OpenVPN Static key V1-----\n83f8e7ccd99be189b4663e18615f9166\nd885cdea6c8accb0ebf5be304f0b8081\n5404f2a6574e029815d7a2fb65b83d0c\n676850714c6a56b23415a78e06aad6b1\n34900dd512049598382039e4816cb5ff\n1848532b71af47578c9b4a14b5bca49f\n99e0ae4dae2f4e5eadfea374aeb8fb1e\na6fdf02adc73ea778dfd43d64bf7bc75\n7779d629498f8c2fbfd32812bfdf6df7\n8cebafafef3e5496cb13202274f2768a\n1959bc53d67a70945c4c8c6f34b63327\nfb60dc84990ffec1243461e0b6310f61\ne90aee1f11fb6292d6f5fcd7cd508aab\n50d80f9963589c148cb4b933ec86128d\ned77d3fad6005b62f36369e2319f52bd\n09c6d2e52cce2362a05009dc29b6b39a\n-----END OpenVPN Static key V1-----\n",
+ "TLSRemote": "my.domain.com",
+ "Username": "abc ${LOGIN_EMAIL} def",
+ }
+ }
+}