shill: remove dependency for ProfileDBusPropertyExporter
Currently, Profile.GetEntry uses ProfileDBusPropertyExporter to
retrieve entry settings for a service entry that's not registered to the
manager or loaded from a different profile. ProfileDBusPropertyExporter
duplicates logics from Service and its subclasses for loading settings
from the profile.
Instead, create a temporary service for profile to load entry settings
into for such service entry, and then retrieve the service settings
(properties) directly. When creating a temporary service, the profile entry
will be validated for fields required by the corresponding service type.
Also added couple test scripts for testing purpose.
BUG=chromium:208736
TEST=USE="asan clang wimax" FEATURES=test emerge-$BOARD shill
Manual Test:
1. Bootup a DUT (wolf) without logging in, connect to a wifi network
WiFi-A.
2. Logged in with an user account, connect to a different managed wifi
network WiFi-B.
3. Invoke command "/usr/local/lib/flimflam/test/list-profiles", verify
there is an entry in both default profile "/profile/default" and
user profile "/profile/chronos/shill".
3. Use the get-profile-entry command to retrieve entry from both default
and user profile, verify entries are retrieved successfully.
"/usr/local/lib/flimflam/test/get-profile-entry default <entry_name>"
"/usr/local/lib/flimflam/test/get-profile-entry shill <entry_name>"
Change-Id: If6c22fbca0e4e47dd42761b047d57fff14c2e658
Reviewed-on: https://chromium-review.googlesource.com/266751
Tested-by: Zeping Qiu <zqiu@chromium.org>
Reviewed-by: Paul Stewart <pstew@chromium.org>
Commit-Queue: Zeping Qiu <zqiu@chromium.org>
diff --git a/manager.h b/manager.h
index 47ab976..7a47093 100644
--- a/manager.h
+++ b/manager.h
@@ -246,6 +246,13 @@
const ProfileRefPtr &profile,
const std::string &entry_name,
Error *error);
+ // Create a temporary service for an entry |entry_name| within |profile|.
+ // Callers must not register this service with the Manager or connect it
+ // since it was never added to the provider's service list.
+ virtual ServiceRefPtr CreateTemporaryServiceFromProfile(
+ const ProfileRefPtr &profile,
+ const std::string &entry_name,
+ Error *error);
// Return a reference to the Service associated with the default connection.
// If there is no such connection, this function returns a reference to NULL.
virtual ServiceRefPtr GetDefaultService() const;