summaryrefslogtreecommitdiffstats
path: root/chromeos/test/data/network
diff options
context:
space:
mode:
authorpneubeck <pneubeck@chromium.org>2014-09-09 03:46:01 -0700
committerCommit bot <commit-bot@chromium.org>2014-09-09 10:48:00 +0000
commitfaf50c40335fd2055c8beed69c0f630bd442d880 (patch)
tree0dfdfbb72d3bb1b0f098122ebf92d08a538c8574 /chromeos/test/data/network
parent457b0a1c94129337a08d0efcc3fd016205a981b4 (diff)
downloadchromium_src-faf50c40335fd2055c8beed69c0f630bd442d880.zip
chromium_src-faf50c40335fd2055c8beed69c0f630bd442d880.tar.gz
chromium_src-faf50c40335fd2055c8beed69c0f630bd442d880.tar.bz2
ONC: Fix Static-/Saved-/IPConfig.
Before commit 41ec57e48ebd467c7a3b169a5598fb8038f54232, IPConfigs was the field in ONC meant for configuring ip configuration of a network. This was changed to: - IPConfigs is the set of currently active ip configurations (it can be more than one if IPv4 and IPv6 are coexisting in parallel) reported by ChromeOS - StaticIPConfig (note that it's a single configuration, not multiple as before) is the writable field that the user or policy can set - SavedIPConfig is the configuration received via DHCP and reported by ChromeOS. This change updates the different ONC functions to these new field definitions. Effectively this also allows setting the IPConfig of a network through ONC import, the networkingPrivate API, and through policy (there's no server support though). BUG=410877 Review URL: https://codereview.chromium.org/540333002 Cr-Commit-Position: refs/heads/master@{#293915}
Diffstat (limited to 'chromeos/test/data/network')
-rw-r--r--chromeos/test/data/network/augmented_merge.json68
-rw-r--r--chromeos/test/data/network/device_policy.onc8
-rw-r--r--chromeos/test/data/network/ethernet.onc10
-rw-r--r--chromeos/test/data/network/invalid_settings_with_repairs.json33
-rw-r--r--chromeos/test/data/network/managed_toplevel1.onc15
-rw-r--r--chromeos/test/data/network/managed_vpn.onc10
-rw-r--r--chromeos/test/data/network/managed_vpn_without_recommended.onc10
-rw-r--r--chromeos/test/data/network/repaired_toplevel_partially_invalid.onc10
-rw-r--r--chromeos/test/data/network/shill_ethernet.json4
-rw-r--r--chromeos/test/data/network/toplevel_partially_invalid.onc10
-rw-r--r--chromeos/test/data/network/translation_of_shill_ethernet.onc10
-rw-r--r--chromeos/test/data/network/translation_of_shill_ethernet_with_ipconfig.onc2
-rw-r--r--chromeos/test/data/network/user.onc12
-rw-r--r--chromeos/test/data/network/vpn_active_settings.onc21
14 files changed, 159 insertions, 64 deletions
diff --git a/chromeos/test/data/network/augmented_merge.json b/chromeos/test/data/network/augmented_merge.json
index 6ebbf04..48322b2 100644
--- a/chromeos/test/data/network/augmented_merge.json
+++ b/chromeos/test/data/network/augmented_merge.json
@@ -5,24 +5,58 @@
},
"GUID": "123",
"IPConfigs": {
- "DevicePolicy": [ {
- "IPAddress": "127.0.0.1",
- "Type": "IPv4"
+ "Active": [ {
+ "Gateway": "2001:db8:85a3::7a2e:370:7331",
+ "IPAddress": "2001:0db8:85a3:0000:0000:8a2e:0370:7334",
+ "NameServers": [ ],
+ "RoutingPrefix": 12,
+ "Type": "IPv6"
} ],
- "Effective": "UserPolicy",
- "UserPolicy": [ {
- "IPAddress": "127.0.0.1",
- "RoutingPrefix": 32,
- "Type": "IPv4"
- } ],
- "UserSetting": [ {
- "IPAddress": "127.0.0.1",
- "SearchDomains": [ "acme.org" ],
- "Type": "IPv4"
- }, {
- "IPAddress": "1.2.3.4",
- "Type": "IPv4"
- } ]
+ "Effective": "Unmanaged"
+ },
+ "SavedIPConfig": {
+ "Gateway": {
+ "Active": "1.1.1.4",
+ "Effective": "Unmanaged"
+ },
+ "IPAddress": {
+ "Active": "124.124.124.124",
+ "Effective": "Unmanaged"
+ },
+ "NameServers": {
+ "Active": [ "1.1.1.5", "1.1.1.6" ],
+ "Effective": "Unmanaged"
+ },
+ "RoutingPrefix": {
+ "Active": 25,
+ "Effective": "Unmanaged"
+ },
+ "Type": {
+ "Active": "IPv4",
+ "Effective": "Unmanaged"
+ }
+ },
+ "StaticIPConfig": {
+ "IPAddress": {
+ "DevicePolicy": "127.0.0.1",
+ "Effective": "UserPolicy",
+ "UserPolicy": "127.0.0.1",
+ "UserSetting": "1.2.3.4"
+ },
+ "RoutingPrefix": {
+ "Effective": "UserPolicy",
+ "UserPolicy": 32
+ },
+ "SearchDomains": {
+ "Effective": "UserPolicy",
+ "UserSetting": [ "acme.org" ]
+ },
+ "Type": {
+ "DevicePolicy": "IPv4",
+ "Effective": "UserPolicy",
+ "UserPolicy": "IPv4",
+ "UserSetting": "IPv4"
+ }
},
"Name": {
"Active": "testopenvpn",
diff --git a/chromeos/test/data/network/device_policy.onc b/chromeos/test/data/network/device_policy.onc
index 663af5b..afcedc5 100644
--- a/chromeos/test/data/network/device_policy.onc
+++ b/chromeos/test/data/network/device_policy.onc
@@ -1,10 +1,10 @@
{ "GUID": "123",
"Type": "VPN",
"Name": "testopenvpn",
- "IPConfigs": [
- { "Type": "IPv4",
- "IPAddress": "127.0.0.1" }
- ],
+ "StaticIPConfig": {
+ "Type": "IPv4",
+ "IPAddress": "127.0.0.1"
+ },
"VPN": {
"Host": "device policys host",
"Recommended": ["Host"],
diff --git a/chromeos/test/data/network/ethernet.onc b/chromeos/test/data/network/ethernet.onc
index 56828bc..b842999 100644
--- a/chromeos/test/data/network/ethernet.onc
+++ b/chromeos/test/data/network/ethernet.onc
@@ -3,5 +3,15 @@
"Name": "name",
"Ethernet": {
"Authentication": "None"
+ },
+ "StaticIPConfig":{
+ "Gateway":"1.1.1.7",
+ "IPAddress":"125.125.125.125",
+ "NameServers":[
+ "1.1.1.8",
+ "125.1.1.3"
+ ],
+ "RoutingPrefix":26,
+ "Type":"IPv4"
}
}
diff --git a/chromeos/test/data/network/invalid_settings_with_repairs.json b/chromeos/test/data/network/invalid_settings_with_repairs.json
index e95c698..365bb25 100644
--- a/chromeos/test/data/network/invalid_settings_with_repairs.json
+++ b/chromeos/test/data/network/invalid_settings_with_repairs.json
@@ -89,11 +89,11 @@
"GUID": "guid",
"Type": "Ethernet",
"Name": "name",
- "IPConfigs": [
- { "Type": "IPv4",
- "IPAddress": "127.0.0.1",
- "RoutingPrefix": 123 }
- ],
+ "StaticIPConfig": {
+ "Type": "IPv4",
+ "IPAddress": "127.0.0.1",
+ "RoutingPrefix": 123
+ },
"Ethernet": {
"Authentication": "None"
}
@@ -170,11 +170,11 @@
"GUID": "guid",
"Type": "Ethernet",
"Name": "name",
- "IPConfigs": [
- { "Type": "IPv4",
- "IPAddress": "127.0.0.1",
- "RoutingPrefix": 123 }
- ],
+ "StaticIPConfig": {
+ "Type": "IPv4",
+ "IPAddress": "127.0.0.1",
+ "RoutingPrefix": 123
+ },
"Ethernet": {
"Authentication": "None"
}
@@ -224,6 +224,19 @@
"Authentication": "None"
}
},
+ "network-with-ipconfigs": {
+ "GUID": "guid",
+ "Type": "Ethernet",
+ "Name": "name",
+ "Ethernet": {
+ "Authentication": "None"
+ },
+ "IPConfigs": [ {
+ "Type": "IPv4",
+ "IPAddress": "127.0.0.1",
+ "RoutingPrefix": 123
+ } ],
+ },
"network-with-client-cert-pattern": {
"GUID": "guid",
"Type": "WiFi",
diff --git a/chromeos/test/data/network/managed_toplevel1.onc b/chromeos/test/data/network/managed_toplevel1.onc
index 1f0d127..712877dd 100644
--- a/chromeos/test/data/network/managed_toplevel1.onc
+++ b/chromeos/test/data/network/managed_toplevel1.onc
@@ -3,11 +3,16 @@
[ { "GUID": "123",
"Type": "VPN",
"Name": "testopenvpn",
- "IPConfigs": [
- { "Type": "IPv4",
- "IPAddress": "127.0.0.1",
- "RoutingPrefix": 32 }
- ],
+ "StaticIPConfig": {
+ "Gateway":"1.1.1.1",
+ "IPAddress": "127.0.0.1",
+ "NameServers":[
+ "1.1.1.2",
+ "1.1.1.3"
+ ],
+ "RoutingPrefix": 32,
+ "Type": "IPv4"
+ },
"VPN": {
"Host": "policys host",
"Recommended": ["Host"],
diff --git a/chromeos/test/data/network/managed_vpn.onc b/chromeos/test/data/network/managed_vpn.onc
index c12bfc9..d90338a 100644
--- a/chromeos/test/data/network/managed_vpn.onc
+++ b/chromeos/test/data/network/managed_vpn.onc
@@ -1,11 +1,11 @@
{ "GUID": "123",
"Type": "VPN",
"Name": "testopenvpn",
- "IPConfigs": [
- { "Type": "IPv4",
- "IPAddress": "127.0.0.1",
- "RoutingPrefix": 32 }
- ],
+ "StaticIPConfig": {
+ "Type": "IPv4",
+ "IPAddress": "127.0.0.1",
+ "RoutingPrefix": 32
+ },
"VPN": {
"Host": "policys host",
"Recommended": ["Host"],
diff --git a/chromeos/test/data/network/managed_vpn_without_recommended.onc b/chromeos/test/data/network/managed_vpn_without_recommended.onc
index 471ff23..eaa6795 100644
--- a/chromeos/test/data/network/managed_vpn_without_recommended.onc
+++ b/chromeos/test/data/network/managed_vpn_without_recommended.onc
@@ -1,11 +1,11 @@
{ "GUID": "123",
"Type": "VPN",
"Name": "testopenvpn",
- "IPConfigs": [
- { "Type": "IPv4",
- "IPAddress": "127.0.0.1",
- "RoutingPrefix": 32 }
- ],
+ "StaticIPConfig": {
+ "Type": "IPv4",
+ "IPAddress": "127.0.0.1",
+ "RoutingPrefix": 32
+ },
"VPN": {
"Host": "policys host",
"Type": "OpenVPN",
diff --git a/chromeos/test/data/network/repaired_toplevel_partially_invalid.onc b/chromeos/test/data/network/repaired_toplevel_partially_invalid.onc
index a2bce87..5c1c516 100644
--- a/chromeos/test/data/network/repaired_toplevel_partially_invalid.onc
+++ b/chromeos/test/data/network/repaired_toplevel_partially_invalid.onc
@@ -3,11 +3,11 @@
[ { "GUID": "123",
"Type": "VPN",
"Name": "testopenvpn",
- "IPConfigs": [
- { "Type": "IPv4",
- "IPAddress": "127.0.0.1",
- "RoutingPrefix": 32 }
- ],
+ "StaticIPConfig": {
+ "Type": "IPv4",
+ "IPAddress": "127.0.0.1",
+ "RoutingPrefix": 32
+ },
"VPN": {
"Host": "policys host",
"Recommended": ["Host"],
diff --git a/chromeos/test/data/network/shill_ethernet.json b/chromeos/test/data/network/shill_ethernet.json
index 19e0cc4..e342d13 100644
--- a/chromeos/test/data/network/shill_ethernet.json
+++ b/chromeos/test/data/network/shill_ethernet.json
@@ -1,3 +1,7 @@
{ "GUID": "guid",
"Type": "ethernet",
+ "StaticIP.Address":"125.125.125.125",
+ "StaticIP.Gateway":"1.1.1.7",
+ "StaticIP.NameServers":"1.1.1.8,125.1.1.3",
+ "StaticIP.Prefixlen":26
}
diff --git a/chromeos/test/data/network/toplevel_partially_invalid.onc b/chromeos/test/data/network/toplevel_partially_invalid.onc
index f9c0f55..7bb1fb8 100644
--- a/chromeos/test/data/network/toplevel_partially_invalid.onc
+++ b/chromeos/test/data/network/toplevel_partially_invalid.onc
@@ -3,11 +3,11 @@
[ { "GUID": "123",
"Type": "VPN",
"Name": "testopenvpn",
- "IPConfigs": [
- { "Type": "IPv4",
- "IPAddress": "127.0.0.1",
- "RoutingPrefix": 32 }
- ],
+ "StaticIPConfig": {
+ "Type": "IPv4",
+ "IPAddress": "127.0.0.1",
+ "RoutingPrefix": 32
+ },
"VPN": {
"Host": "policys host",
"Recommended": ["Host"],
diff --git a/chromeos/test/data/network/translation_of_shill_ethernet.onc b/chromeos/test/data/network/translation_of_shill_ethernet.onc
index 8b568bf..34507b0 100644
--- a/chromeos/test/data/network/translation_of_shill_ethernet.onc
+++ b/chromeos/test/data/network/translation_of_shill_ethernet.onc
@@ -4,5 +4,15 @@
},
"GUID":"guid",
"Name":"",
+ "StaticIPConfig":{
+ "Gateway":"1.1.1.7",
+ "IPAddress":"125.125.125.125",
+ "NameServers":[
+ "1.1.1.8",
+ "125.1.1.3"
+ ],
+ "RoutingPrefix":26,
+ "Type":"IPv4"
+ },
"Type":"Ethernet"
}
diff --git a/chromeos/test/data/network/translation_of_shill_ethernet_with_ipconfig.onc b/chromeos/test/data/network/translation_of_shill_ethernet_with_ipconfig.onc
index f65ca62..296ae45 100644
--- a/chromeos/test/data/network/translation_of_shill_ethernet_with_ipconfig.onc
+++ b/chromeos/test/data/network/translation_of_shill_ethernet_with_ipconfig.onc
@@ -32,6 +32,7 @@
"1.1.1.6"
],
"RoutingPrefix":25,
+ "Type":"IPv4"
},
"StaticIPConfig":{
"Gateway":"1.1.1.7",
@@ -40,6 +41,7 @@
"1.1.1.8"
],
"RoutingPrefix":26,
+ "Type":"IPv4"
},
"Type":"Ethernet"
}
diff --git a/chromeos/test/data/network/user.onc b/chromeos/test/data/network/user.onc
index bd97bb3..d95bc76 100644
--- a/chromeos/test/data/network/user.onc
+++ b/chromeos/test/data/network/user.onc
@@ -11,11 +11,9 @@
"ProxySettings": {
"Type": "Direct"
},
- "IPConfigs": [
- { "Type": "IPv4",
- "IPAddress": "127.0.0.1",
- "SearchDomains": [ "acme.org" ] },
- { "Type": "IPv4",
- "IPAddress": "1.2.3.4" }
- ]
+ "StaticIPConfig": {
+ "Type": "IPv4",
+ "IPAddress": "1.2.3.4",
+ "SearchDomains": [ "acme.org" ]
+ }
}
diff --git a/chromeos/test/data/network/vpn_active_settings.onc b/chromeos/test/data/network/vpn_active_settings.onc
index 62b3c21..f3c6f78 100644
--- a/chromeos/test/data/network/vpn_active_settings.onc
+++ b/chromeos/test/data/network/vpn_active_settings.onc
@@ -1,5 +1,24 @@
{ "Type": "VPN",
"Name": "testopenvpn",
"ConnectionState": "Connected",
- "GUID": "123"
+ "GUID": "123",
+ "IPConfigs":[
+ {
+ "Gateway":"2001:db8:85a3::7a2e:370:7331",
+ "IPAddress":"2001:0db8:85a3:0000:0000:8a2e:0370:7334",
+ "NameServers":[],
+ "RoutingPrefix":12,
+ "Type":"IPv6"
+ }
+ ],
+ "SavedIPConfig":{
+ "Gateway":"1.1.1.4",
+ "IPAddress":"124.124.124.124",
+ "NameServers":[
+ "1.1.1.5",
+ "1.1.1.6"
+ ],
+ "RoutingPrefix":25,
+ "Type":"IPv4"
+ }
}