Remove support for run-by-value and the value argument. |
||||||||
Issue descriptionThe EP Test Framework allows you to run a policy_* test case by specifying the expected policy value. But if that value is a list of strings, such as --args= 'value=chrome://settings,https://google.com'), it will fail to match the corresponding value as stored in the TEST_CASE dictionary. Thus, the test exits with error, e.g., "ERROR: No test case for value: 'chrome://settings'". The values stored in the TEST_CASE dictionary are precisely formatted to meet the requirements of the DM Server. So, we can't change them. Instead, we need a better way of converting those values into a format that can be reliably compared to policy value given by the user in the command line args. The value comparison is done in the class method _get_case_by_value(policy_value). It tries to compare a white-space stripped version of the user-given policy_value with a white-space stripped json-formatted version of the test case value. The equivalence comparison in this method needs to be replaced with a better, more robust version that can handle list-of-values, as well continue to handle all of the following types of user-entered data: 1) simple string (e.g., for EnterpriseWebStoreURL, ChromeOsReleaseChannel) 2) integer value 3) boolean value 4) CSV string (e.g., for AllowedDomainsForApps) 5) python list (e.g., for CookiesAllowedForUrls, URLBlacklist), 6) python dictionary (e.g., for ProxySettings, UserAvatarImage, WallpaperImage, PowerManagementIdleSettings) 7) list of python dictionaries (e.g., for DeviceAppPack, ManagedBookmarks, UsbDetachableWhitelist) 8) json formatted string (e.g., for OpenNetworkConfiguration, DefaultPrinterSelection). Final Word: Some have suggested removing support for run-by-value. If this suggested in adopted, then this problem goes away.
,
Aug 16 2016
Also, complete the TODO(scunningham) to remove support for case+value=None.
,
Aug 16 2016
,
Aug 16 2016
,
Aug 19 2016
The following revision refers to this bug: https://chromium.googlesource.com/chromiumos/third_party/autotest/+/dae7d8a91a244fd75f79a93b8913c0f69d290546 commit dae7d8a91a244fd75f79a93b8913c0f69d290546 Author: Scott Cunningham <scunningham@chromium.org> Date: Tue Aug 16 20:40:07 2016 Remove support for run-by-value and the value argument. Version 1 of the Enterprise Base Class allowed a caller to run a test case based on the expected policy value. This feature added unwanted complexity to the framework, and did not work reliably (the string value had to match exactly what was shown on the chrome://policy page, but was not the same as what was sent to the fake DM Server. Support for run-by-value, and entire value argument, is removed by this CL in version 2. Note that there are three tests in the EE2E test framework that still run tests BY_VALUE. These should updated to instead be run by test case name. BUG= chromium:637432 TEST=None Change-Id: I8bcc6e7ea94e1f69da6af5affb7ff52844fd3ecc Reviewed-on: https://chromium-review.googlesource.com/371563 Tested-by: Scott Cunningham <scunningham@chromium.org> Reviewed-by: Katherine Threlkeld <kathrelkeld@chromium.org> Reviewed-by: Scott Cunningham <scunningham@chromium.org> [modify] https://crrev.com/dae7d8a91a244fd75f79a93b8913c0f69d290546/client/cros/enterprise_policy_base.py
,
Aug 19 2016
The following revision refers to this bug: https://chromium.googlesource.com/chromiumos/third_party/autotest/+/dae7d8a91a244fd75f79a93b8913c0f69d290546 commit dae7d8a91a244fd75f79a93b8913c0f69d290546 Author: Scott Cunningham <scunningham@chromium.org> Date: Tue Aug 16 20:40:07 2016 Remove support for run-by-value and the value argument. Version 1 of the Enterprise Base Class allowed a caller to run a test case based on the expected policy value. This feature added unwanted complexity to the framework, and did not work reliably (the string value had to match exactly what was shown on the chrome://policy page, but was not the same as what was sent to the fake DM Server. Support for run-by-value, and entire value argument, is removed by this CL in version 2. Note that there are three tests in the EE2E test framework that still run tests BY_VALUE. These should updated to instead be run by test case name. BUG= chromium:637432 TEST=None Change-Id: I8bcc6e7ea94e1f69da6af5affb7ff52844fd3ecc Reviewed-on: https://chromium-review.googlesource.com/371563 Tested-by: Scott Cunningham <scunningham@chromium.org> Reviewed-by: Katherine Threlkeld <kathrelkeld@chromium.org> Reviewed-by: Scott Cunningham <scunningham@chromium.org> [modify] https://crrev.com/dae7d8a91a244fd75f79a93b8913c0f69d290546/client/cros/enterprise_policy_base.py
,
Aug 24 2016
,
Aug 29 2016
,
Oct 7 2016
,
Nov 14 2016
,
Mar 3 2017
|
||||||||
►
Sign in to add a comment |
||||||||
Comment 1 by scunning...@chromium.org
, Aug 12 2016Status: Assigned (was: Available)