shill: vpn: Properly export provider properties
Provider properties should be exported as a "Provider" dict instead
of at the same toplevel as the rest of the Service properties. This
means that there is a difference between the way these properties
are stored in the keystore and accesed over DBus for writing and how
they are enumerated in "GetProperties".
Also fix VPNProvider::GetService so that all properties are applied,
even the ones that should modify Service level attributes, like GUID
and UIData, by using Service::Configure instead of passing the
KeyValueStore directly into the driver.
BUG=chromium-os:29287
TEST=New unit tests + Manual:
- Test that logging in to an ONC-enabled account creates the service
automatically. Moreover, make sure that the profile data is written
out and materially quite similar to flimflam's profile data.
- Test that logging out and logging back in maintains that data.
- Test that the VPN entry appears in the networks dropdown
Change-Id: I60a807886d17074d3f88b1475dcf42e80c0cec54
Reviewed-on: https://gerrit.chromium.org/gerrit/20046
Commit-Ready: Darin Petkov <petkov@chromium.org>
Reviewed-by: Darin Petkov <petkov@chromium.org>
Tested-by: Darin Petkov <petkov@chromium.org>
diff --git a/profile.cc b/profile.cc
index f3d7dd2..46d589d 100644
--- a/profile.cc
+++ b/profile.cc
@@ -141,8 +141,9 @@
}
bool Profile::AdoptService(const ServiceRefPtr &service) {
- if (storage_->ContainsGroup(service->GetStorageIdentifier()))
+ if (service->profile() == this) {
return false;
+ }
service->set_profile(this);
return service->Save(storage_.get()) && storage_->Flush();
}