summaryrefslogtreecommitdiff
path: root/tests
diff options
context:
space:
mode:
authorJW Wang <wangchun@google.com>2020-03-02 14:39:56 +0800
committerJW Wang <wangchun@google.com>2020-03-02 14:57:56 +0800
commit6033dd2c58a375604b15612eba7a10f5bd5767bc (patch)
tree3f8522bf4c34e49df19fbfa2d33fb840d355d0a3 /tests
parent2f9f7cf3179279892770d5cb7995dfa5dccb1d73 (diff)
Override phenotype flags during tests
https://g3doc.corp.google.com/experiments/g3doc/mobile/phenotype/android/testing.md?cl=head#hermetic Phenotype talks to a server to override the device config changes made by the tests. Therefore, watchdog timeout didn't happen as expected and caused tests to fail. We need to override the flags on our own during tests so the device config values ('watchdog_request_timeout_millis' in this case) won't be changed in an unexpected way. See b/148042585#comment21 for more details. Bug: 148042585 Test: atest NetworkStagedRollbackTest Change-Id: I4d8944f7fef93445de8f971c6a96fef7c71872db
Diffstat (limited to 'tests')
-rw-r--r--tests/RollbackTest/NetworkStagedRollbackTest.xml6
1 files changed, 6 insertions, 0 deletions
diff --git a/tests/RollbackTest/NetworkStagedRollbackTest.xml b/tests/RollbackTest/NetworkStagedRollbackTest.xml
index a465a4fe578b..2ab907a59298 100644
--- a/tests/RollbackTest/NetworkStagedRollbackTest.xml
+++ b/tests/RollbackTest/NetworkStagedRollbackTest.xml
@@ -19,6 +19,12 @@
<option name="cleanup-apks" value="true" />
<option name="test-file-name" value="RollbackTest.apk" />
</target_preparer>
+ <target_preparer class="com.android.tradefed.targetprep.RunCommandTargetPreparer">
+ <option name="run-command" value="am broadcast -a 'com.google.android.gms.phenotype.FLAG_OVERRIDE' --es package &quot;com.google.android.gms.platformconfigurator&quot; --es user '\\*' --esa flags &quot;ModuleConfig__immediate_commit_packages&quot; --esa types &quot;bytes&quot; --esa values &quot;CgA=&quot; com.google.android.gms" />
+ <option name="run-command" value="am broadcast -a 'com.google.android.gms.phenotype.FLAG_OVERRIDE' --es package &quot;com.google.android.gms.platformconfigurator&quot; --es user '\\*' --esa flags &quot;ModuleConfig__versioned_immediate_commit_packages&quot; --esa types &quot;bytes&quot; --esa values &quot;Cm5vdGFwYWNrYWdlOgA=&quot; com.google.android.gms" />
+ <option name="teardown-command" value="am broadcast -a 'com.google.android.gms.phenotype.FLAG_OVERRIDE' --es action delete --es package &quot;com.google.android.gms.platformconfigurator&quot; --es user '\*' --esa flag &quot;ModuleConfig__immediate_commit_packages&quot; com.google.android.gms" />
+ <option name="teardown-command" value="am broadcast -a 'com.google.android.gms.phenotype.FLAG_OVERRIDE' --es action delete --es package &quot;com.google.android.gms.platformconfigurator&quot; --es user '\*' --esa flag &quot;ModuleConfig__versioned_immediate_commit_packages&quot; com.google.android.gms" />
+ </target_preparer>
<test class="com.android.tradefed.testtype.HostTest" >
<option name="class" value="com.android.tests.rollback.host.NetworkStagedRollbackTest" />
</test>