1 Usage Guide 2 =========== 3 From chroot, run the test remotely with test_that: 4 $ test_that <IPAddress> policy_RestoreOnStartupURLs <arguments> 5 6 On your Chrome OS device, run the test locally from the command line: 7 $ /usr/local/autotest/bin/autotest /usr/local/autotest/tests/ 8 policy_RestoreOnStartupURLs/control <arguments> 9 10 When no arguments are given, all test cases defined in the test are run using 11 the local AutoTest fake DM Server to download policies, and production GAIA to 12 authenticate the user. 13 14 Use the mode=single argument to run a single test case, and the case argument 15 to specify the test case to run. E.g.: 16 --args="mode=single case=1URL" 17 --args="mode=single case=3URLs" 18 --args="mode=single case=NotSet" 19 20 Use the env argument to select the environment parameters used during the test. 21 The env argument determines which GAIA login server and DMServer will be used 22 by Chrome OS to authenticate user sign-ins and to download policies. Use the 23 dm-fake environment for your test to set up policies on the local AutoTest 24 fake DM Server. Note that your tests cannot set up policies on the DMServer in 25 the production, staging, or test environments. 26 27 Valid values for env are: 28 prod: production - DMServer and GAIA in production 29 cr-dev: staging - DMServer (cros-dev) and GAIA in staging 30 cr-auto: staging - DMServer (cros-auto) and GAIA in staging 31 dm-test: test - Python server on chromium-dm-test.appspot.com and 32 GAIA in production 33 dm-fake (default): AutoTest - fake AutoTest DMServer and GAIA in production. 34 35 When you select an environment other than the default 'dm-fake' AutoTest, 36 you must provide the user credentials for that environment. E.g.: 37 --args="env=cr-auto username=tester1 (a] testdomain.com password=test1234" 38 39 When you select an environment other than dm-fake, and you specify a single 40 test case to run, you may optionally specify the policy value that the test 41 case expects to be shown on the chrome://policy page. This is uncommon usage, 42 but is provided to support situations where a single test method is used by 43 multiple test cases, but with different policy values pre-set by the user on 44 an external DM Server. 45 46 When using env=dm-test, you must specify the dms_name for your instance of the 47 chromium-dm-test service. E.g.: 48 --args="env=dm-test dms_name=xot-dmst username=..." 49 50 51 Argument Examples for policy_RestoreOnStartupURLs tests 52 ======================================================= 53 54 Local Command Line Args 55 ------------------------ 56 Fake, mode=All: 57 /usr/local/autotest/bin/autotest /usr/local/autotest/tests/policy_RestoreOnStartupURLs/control --args="mode=all env=dm-fake" 58 59 Production, mode=Single (1URL), with expected policy value: 60 /usr/local/autotest/bin/autotest /usr/local/autotest/tests/policy_RestoreOnStartupURLs/control --args="mode=single case=1URL env=prod username=sal1 (a] crosprqa1.com password=sal1Pt001 value=None" 61 62 YAPS, mode=Single (3URLs): 63 /usr/local/autotest/bin/autotest /usr/local/autotest/tests/policy_RestoreOnStartupURLs/control --args="mode=single case=3URLs env=dm-test dms_name=xot-dmst username=dadm (a] crosprqa3.com password=ad3pky001" 64 65 Remote Command Line Ags 66 ------------------------ 67 For comparision, here are equivalent commands to run using test_that (from within chroot): 68 test_that 100.96.49.89 policy_RestoreOnStartupURLs --args="mode=all env=dm-fake" 69 70 test_that 100.96.49.89 policy_RestoreOnStartupURLs --args="mode=single case=1URL env=prod username=sal1 (a] crosprqa1.com password=sal1Pt001 value=None" 71 72 test_that 100.96.49.89 policy_RestoreOnStartupURLs --args="mode=single case=3URLs env=dm-test dms_name=xot-dmst username=dadm (a] crosprqa3.com password=ad3pky001" 73 74