• Home
Name Date Size #Lines LOC

..--

src/03-May-2024-2918

READMED03-May-20243.6 KiB7456

controlD03-May-20241.5 KiB4431

policy_RestoreOnStartupURLs.pyD03-May-20244.3 KiB10469

README

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