bf77dbb9e5ebf2e840f8aaafa18d8282803270e5 |
|
12-Nov-2016 |
Katherine Threlkeld <kathrelkeld@chromium.org> |
[Autotest] Tweaks for enterprise_policy_base to improve ARC++ testing Since the ARC++ enterprise_cheets_base cannot reach the initialize() of this class, move all functionality to a separate function that the ARC++ base class can call. Call this function from initialize(). Move some stray self.VAR = None calls together and into initialize(). They're to prevent self.cleanup() from throwning an error if cleanup happens before these variables are actually set. Rename _initialize_context to reflect its purpose: enforcing variable restrictions. Move the setting of dms_is_fake out of this function and back to initialize() so that all major self variables are set in the same place. Remove restrictions on and default value for case. The only way it can be None is if the test author sets it that way. The only place that TEST_CASES is referenced is the _get_policy_data_for_case function, which got removed for a point listed below. The default control file will still fail if one does not pass in a value for case, and passing an incorrect value will cause a key exception. Move code which fails the test if expected policy value doesn't match the one shown on chrome://policy into a separate function, verify_policy_value. Tests can use this function if needed, hopefully preventing anyone from trying this complex move on their own. Internally pass around python lists/dicts/strs/ints instead of JSON strings whenever possible. Have the verify_policy function sort out comparing chrome://policy values to Python objects. Move encoding/decoding JSON to separate functions, and handle all of the unicode -> ascii hiccups there. Make policy blob function take mandatory/supporting policies in {policy: value} format, and then construct the top-level dict of {mode: policy_dict} format within the function. Have setup_case take the policy's name, value, and optionally dicts of mandatory or suggested policies, instead of constructing an object in each test. Move the setup_case calls in each test out of the main test functions so that test_*() only handles testing for a given policy value. Modify each existing test to reflect these changes. initialize_chrome_extra_flags where they're needed, and not in initialize (since ARC++ won't be using this function). TEST=ran new ARC++ test and existing policy tests BUG=b:32839846 Change-Id: I3fdec37568f980c55d1e3b4e0ecea537b9b14370 Reviewed-on: https://chromium-review.googlesource.com/411945 Commit-Ready: Katherine Threlkeld <kathrelkeld@chromium.org> Tested-by: Katherine Threlkeld <kathrelkeld@chromium.org> Reviewed-by: danny chan <dchan@chromium.org>
/external/autotest/client/site_tests/policy_JavaScriptAllowedForUrls/policy_JavaScriptAllowedForUrls.py
|
bad82c186e61393d0af34a5a814e105c93c0d782 |
|
04-Oct-2016 |
Scott Cunningham <scunningham@chromium.org> |
Move shared resources into cros/enterprise directory. Move all resources that are shared by two or more tests into a common directory, located in cros/enterprise. To do this, the changes changes are made: 1) Rename directory cros/policy to cros/enterprise. 2) Create an empty __init__.py file in the enterprise directory, so AutoTest can find it. 3) Replace cros_policy_dir() method with class variable in enterprise_policy_base.py. Update variable to point to "cros/enterprise". 4) Replace all imports of enterprise_policy_base and enterprise_fake_dmserver from 'autotest_lib.client.cros' with 'autotest_lib.client.cros.enterprise'. 5) Move all shared resources (*.html, *.swf, *.jpg, etc) into the common directory (cros/enterprise). 6) Move _get_checkbox_properties() from policy_SearchSuggestEnable to enterprise_policy_base.py. Rename _get_setting_checkbox_properties(). 7) Remove cros/enterprise_base file, which is now obsolete. Not covered here: replace same import as #4 in the ARC++ base class, located at autotest-tests-cheets/client/common_lib/cros/ enterprise_cheets_base.py). See CL 294576. BUG=chromium:652466 TEST=None CQ-DEPEND=CL:*294576 Change-Id: Ia75a6eb8932a6bc7c0b87caa5932aeab61142bee Reviewed-on: https://chromium-review.googlesource.com/392351 Commit-Ready: Scott Cunningham <scunningham@chromium.org> Tested-by: Scott Cunningham <scunningham@chromium.org> Reviewed-by: Scott Cunningham <scunningham@chromium.org>
/external/autotest/client/site_tests/policy_JavaScriptAllowedForUrls/policy_JavaScriptAllowedForUrls.py
|
8b20510d28820d2b788a4e7446d9ba282e4e9d13 |
|
29-Jul-2016 |
Scott Cunningham <scunningham@chromium.org> |
Split test cases into separate control.case files. Instead of running all the test cases defined in a test class for a policy, create separate control files for each test case. This will provide more precise test result reporting. For now, the default control files will continue work as is, so the CPanel E2E test framework can continue to pass args into the test. However, remove the ATTRIBUTES property from them, so the default test is not scheduled to run in the hardware lab. Also, move args_to_dict from base class into the default control files. BUG=chromium:629357 TEST=Run test_that <IP> policy_<test>.<case> for each test case of each policy test. Also, policy_<test> with --args for each test case, to ensure that passing args thru the default control file still works with existing framework. Change-Id: I432d3c112a0de1a7f8fdf4cb4819128506406fc8 Reviewed-on: https://chromium-review.googlesource.com/364340 Commit-Ready: Scott Cunningham <scunningham@chromium.org> Tested-by: Scott Cunningham <scunningham@chromium.org> Reviewed-by: Scott Cunningham <scunningham@chromium.org> Reviewed-by: Katherine Threlkeld <kathrelkeld@chromium.org>
/external/autotest/client/site_tests/policy_JavaScriptAllowedForUrls/policy_JavaScriptAllowedForUrls.py
|
f5ac2571588478039a79b5dbc8723fe9e9de1717 |
|
03-Jun-2016 |
Scott Cunningham <scunningham@chromium.org> |
Update early policy_* tests to use class methods. Many of the early policy_* tests had their own internal methods for cleanup, run_once, run_test_case, and _get_policy_data_for_case. These methods are now available in the class. Update the tests to use the class methods. policy_CookiesAllowedForUrls policy_CookiesBlockedForUrls policy_EditBookmarksEnabled policy_ImagesAllowedForUrls policy_ImagesBlockedForUrls policy_JavaScriptAllowedForUrls policy_JavaScriptBlockedForUrls policy_ManagedBookmarks policy_PopupsAllowedForUrls policy_PopupsBlockedForUrls policy_ProxySettings policy_RestoreOnStartupURLs policy_URLBlacklist policy_URLWhitelist BUG=chromium:616960 TEST=Run test_that <IP> <test> for each policy_* test. Change-Id: I98aa0727a6594891def20444dfae694974e8df64 Reviewed-on: https://chromium-review.googlesource.com/349671 Commit-Ready: Scott Cunningham <scunningham@chromium.org> Tested-by: Scott Cunningham <scunningham@chromium.org> Reviewed-by: Scott Cunningham <scunningham@chromium.org> Reviewed-by: Krishna Gavini <krishnargv@chromium.org>
/external/autotest/client/site_tests/policy_JavaScriptAllowedForUrls/policy_JavaScriptAllowedForUrls.py
|
d07ace98b0bab4cac0a134cb7f808b7af4539ad2 |
|
10-Nov-2015 |
Scott Cunningham <scunningham@chromium.org> |
Implement policy_JavaScriptAllowedForUrls test This test verifies the effect of the JavaScriptAllowedForUrls user policy on Chrome OS client behavior and appearance, when policy DefaultJavaScriptSetting=2 (block all but allowed). It exercises a range of policy values using four unique test cases, named: NotSet_BlockJS, SingleUrl_AllowJS, MultipleUrls_BlockJS, and MultipleUrls_AllowJS. The test shall pass if the browser runs JavaScript on a test page matching a pattern listed in the JavaScriptAllowedForUrls policy. The test shall fail if the browser does not run JavaScript on said test page. BUG=chromium:554216 TEST=Run test_that <IP> policy_JavaScriptAllowedForUrls Change-Id: I4e12d745527e385a0a316b5e8f90e87b0255a1fb Reviewed-on: https://chromium-review.googlesource.com/312090 Commit-Ready: Scott Cunningham <scunningham@chromium.org> Tested-by: Scott Cunningham <scunningham@chromium.org> Reviewed-by: Achuith Bhandarkar <achuith@chromium.org> Reviewed-by: Jacob Dufault <jdufault@chromium.org>
/external/autotest/client/site_tests/policy_JavaScriptAllowedForUrls/policy_JavaScriptAllowedForUrls.py
|