Commit Graph

215 Commits

Author SHA1 Message Date
JW Wang
6a126d836d Use system properties to log rollback events
Sometimes logcat messages are missing and causing rollback tests
to fail which check logcat messages to confirm some particular
rollback events have happened.

Let's use system properties as a reliable way to log rollback
events.

Bug: 171853854
Test: atest StagedRollbackTest NetworkStagedRollbackTest
Change-Id: Ia74da915811978008eed501049f5f44029e5c81a
2020-11-02 11:06:47 +08:00
JW Wang
1e8dfaf18a Enable root when accessing files (3/n)
See b/170689774#comment9.

We need root privileges to read/write files under /data/misc_ce and the
like.

Bug: 170689774
Test: atest StagedRollbackTest
Change-Id: I3504e96e965bba5d640dba08ac5d11cf31c0ddba
2020-10-19 10:30:43 +08:00
JW Wang
7367aa8c8f Enable root before calling INativeDevice#pushString
1. We need root to push files to folders like
   /data/user_de or /data/misc_ce successfully.

2. Disable root at the end of each helper method so
   we don't accidentally run the following code as root.

Bug: 170804667
Test: atest StagedRollbackTest
Change-Id: Icfa8054eafa9230a1893bde33b8f0005f8b6c69d
2020-10-15 09:56:48 +08:00
JW Wang
cde1a0fce0 Don't fail #getSnapshotDirectories siliently (2/n)
Let's verify the theory in b/170689774#comment4 where the 'after'
list is incorrectly calculated because the 1st #getSnapshotDirectories
fails.

Bug: 170689774
Test: atest StagedRollbackTest
Change-Id: I0570df4642e923d69092bd66125520cb30253863
2020-10-14 16:35:07 +08:00
JW Wang
e24a2c454e Assert there is only one data folder created during test (1/n)
See b/170689774#comment2.

If the assertion fails, it will log the content of the 'after' list
which gives us more information for debugging.

Bug: 170689774
Test: atest StagedRollbackTest
Change-Id: Ib4ccd1be6f39c1d4c2556cbf6a06cfdf14240220
2020-10-13 13:59:19 +08:00
JW Wang
7a2ba1d188 Tests APK De directory is restored correctly (2/n)
This test reveals a bug where the De directory of a staged-installed
apk (including the case of apk-in-apex) is not restored correctly.

The bug is fixed by aosp/1450376.

Bug: 169594054
Test: atest StagedRollbackTest#testRollbackApkDataDirectories_De
Change-Id: Ib5179a25446a7ea03f6a4436fe1623f57a013eaf
2020-10-07 17:57:54 +08:00
Colin Cross
082aec6c84 Revert "Snap for 6793014 from bbbccc3c2b7fc7c5780f6c415c4223e1d0..."
Revert "Snap for 6793014 from 44725f06b7f7d6407b5ee82d989bdd6c7a..."

Revert "Snap for 6793014 from f22ad3164937a8f2e309965c102b6366d5..."

Revert "Snap for 6793014 from 11467102abddb6026aaa164c1361439c2d..."

Revert "Snap for 6793014 from 265280bf5cb4bc14e132c3a35ae5f7ae65..."

Revert "Snap for 6793014 from f2989f9c65556d5155dbd57f82f0c93a16..."

Revert "Snap for 6793014 from 8b8bf0a07b0521bbe8483fbbab1222ffd6..."

Revert "Snap for 6793014 from 3777d883a3857b1a1589181c436d9018d7..."

Revert "Snap for 6793014 from 3157b4ee4325286f0c2ab0f26528460c8b..."

Revert "Snap for 6793014 from a43295d1825da62af038d345a7a861ed7a..."

Revert "Snap for 6793014 from 2076be4d27078d6ebc0a6b5e5ceb386109..."

Revert "Snap for 6793014 from d0e31526c62b2aeb35c293ac96feb180fc..."

Revert "Snap for 6793014 from 7a3a8c6351d5167a6ae0b33bc376efabd2..."

Revert "Snap for 6793014 from 41471cb21bb16b5c3bcc92f84293b79684..."

Revert "Snap for 6793014 from 42e5cca3cfb829690c9d8c6aca57a8e7d5..."

Revert "Snap for 6793014 from 4f81304963d19f4511b1e8e7d0aad87a67..."

Revert "Snap for 6793014 from 07602cdacf5bcc835db41f7eaa24af9964..."

Revert "Snap for 6793014 from 14cb57e107a3abce8b14937b1f92c28d18..."

Revert "Snap for 6793014 from ab1e4a81d09a540a5f927059e5bc03a606..."

Revert "Snap for 6793014 from 8c65adad0bcdfb3acc561063b4048dca24..."

Revert "Snap for 6793014 from b3061942700265e2bf04af9997775dcbbb..."

Revert "Snap for 6793014 from 551c5953fc62e339e4ee884ec2cd0ac3be..."

Revert "Snap for 6793014 from 4919273b2ac5c6347a18e17c5ec70d8da6..."

Revert "Snap for 6793014 from 988d4244914e0c749655e8cb6db18ba44f..."

Revert submission 12465146-release-request-6b259cbc-1f45-4b05-bc7e-c9b893b79d68-for-git_main-busytown-release-6793014

Reason for revert: b/166531456
Reverted Changes:
I5ff7a6c0d:Snap for 6793014 from f2989f9c65556d5155dbd57f82f0...
I77bdff943:Snap for 6793014 from a43295d1825da62af038d345a7a8...
I2ac5c520a:Snap for 6793014 from c3f124cca05579acf0a6cb589ebd...
I023b9702f:Snap for 6793014 from 98756d6d3e2bb0ba28eb125caa7a...
Ibc7893d72:Snap for 6793014 from fd1ad6750ef332d3f50f218f4d5d...
Ic27847bee:Snap for 6793014 from 8c65adad0bcdfb3acc561063b404...
If20bc9352:Snap for 6793014 from 7a3a8c6351d5167a6ae0b33bc376...
I6542d17e8:Snap for 6793014 from 3777d883a3857b1a1589181c436d...
I66e6bb8a9:Snap for 6793014 from 8b8bf0a07b0521bbe8483fbbab12...
I3cd190b6b:Snap for 6793014 from 424180bdc4aa18249e678daebfd0...
If92db7402:Snap for 6793014 from ab1e4a81d09a540a5f927059e5bc...
Iaced03c87:Snap for 6793014 from d0e31526c62b2aeb35c293ac96fe...
I5d28c6b4b:Snap for 6793014 from 4f81304963d19f4511b1e8e7d0aa...
I30d07bea3:Snap for 6793014 from 7594ec6384c4da320726def34f47...
I473205f48:Snap for 6793014 from 551c5953fc62e339e4ee884ec2cd...
I0656b41af:Snap for 6793014 from 44725f06b7f7d6407b5ee82d989b...
I0f9796067:Snap for 6793014 from 4919273b2ac5c6347a18e17c5ec7...
I9a38cda8f:Snap for 6793014 from 2076be4d27078d6ebc0a6b5e5ceb...
I876a82f51:Snap for 6793014 from 11467102abddb6026aaa164c1361...
I749d7d023:Snap for 6793014 from 41471cb21bb16b5c3bcc92f84293...
I038daea41:Snap for 6793014 from 07602cdacf5bcc835db41f7eaa24...
I47aa3131c:Snap for 6793014 from 14cb57e107a3abce8b14937b1f92...
I32dba8a95:Snap for 6793014 from 3157b4ee4325286f0c2ab0f26528...
I2ebc9f9db:Snap for 6793014 from 988d4244914e0c749655e8cb6db1...
Iae7c3370f:Snap for 6793014 from 9ffb8852294e06e2d387dc1fb868...
I6467a7f1b:Snap for 6793014 from 42e5cca3cfb829690c9d8c6aca57...
I8c6375203:Snap for 6793014 from b3061942700265e2bf04af999777...
I843b2e1f3:Snap for 6793014 from 265280bf5cb4bc14e132c3a35ae5...
Ie254f7079:Snap for 6793014 from f22ad3164937a8f2e309965c102b...
I01e0974ed:Snap for 6793014 from bbbccc3c2b7fc7c5780f6c415c42...

Change-Id: I9160aa1ae5523d8e92c618ae1922576bb70a7ac8
2020-08-27 04:12:26 +00:00
Chun-Wei Wang
e076ada0c7 Merge "Update language to comply with Android's inclusive language guidance" am: a5d1ef9837 am: 51ded68601 am: 9b0cd12ce4 am: cb6b00197d am: 2bc333e497
Original change: https://android-review.googlesource.com/c/platform/frameworks/base/+/1397950

Change-Id: I8ca087405168151c31c04bc5fa0f74ccf3f007bb
2020-08-12 13:28:02 +00:00
Chun-Wei Wang
9b0cd12ce4 Merge "Update language to comply with Android's inclusive language guidance" am: a5d1ef9837 am: 51ded68601
Original change: https://android-review.googlesource.com/c/platform/frameworks/base/+/1397950

Change-Id: Icb2ab0cfc29c8822d5e7f833622fa17357b1bbe9
2020-08-12 12:30:01 +00:00
JW Wang
b1e1a42305 Update language to comply with Android's inclusive language guidance
See https://source.android.com/setup/contribute/respectful-code for
reference.

Bug: 162536543
Test: m
Change-Id: I30ca0bf2f77015637a0f36a7083f4044cd29d3b1
2020-08-12 16:47:53 +08:00
JW Wang
3bf53c6092 getVersionedPackage can't see packages installed on the 2nd user
See b/161410257#comment1 for the details.

We need to pass MATCH_ANY_USER to ensure packages installed on the
2nd user are visiable to PackageWatchdog so it can observe packages
with rollback enabled correctly.

Bug: 161410257
Test: atest MultiUserRollbackTest#testBadUpdateRollback
Change-Id: Ie06eadfe14e003675b1898208f907ba7bb1d86b7
2020-07-16 18:10:30 +08:00
JW Wang
838dea54ca Pass correct install user when creating sessions
This CL passes the correct install user when creating sessions in
StagingManager and effectively reverts ag/6901350.

Add a test to ensure b/129397974 is not regressed as described in
b/158222747#comment11.

Fix: 129744602
Fix: 158222747
Test: atest MultiUserRollbackTest#testStagedRollback
Change-Id: I718992240aa76898ff9e4220ea6a769ee8cd61f5
2020-07-16 18:10:02 +08:00
JW Wang
11894cace7 Merge "Delete APEX CE snapshots when a rollbck is deleted (2/n)" 2020-07-10 00:58:03 +00:00
JW Wang
3ac333f2d2 Rewrite how we abandon sessions
The original code is flawed in that `pm install-abandon` only abandons
the 1st session returned by `pm get-stagedsessions ...`.

1. move AbandonSessionsRule to be shared by multiple host tests
2. use AbandonSessionsRule to do the job

Bug: 160754072
Test: StagedInstallInternalTest
Change-Id: Ib7b32fbd7b1133ac6a8e6782234a4fe2c5a782bd
2020-07-08 18:57:24 +08:00
JW Wang
18d0cfb251 Delete APEX CE snapshots when a rollbck is deleted (2/n)
Now we delete APEX CE snapshots immediately when a rollback is deleted.
If the user is locked, the deletion will fail, but that's OK. The
orphaned snapshots will be cleaned when the user is unlocked.

Bug: 158712947
Test: atest StagedRollbackTest RollbackUnitTest
Change-Id: I3e3eef4c52f281d28a6a6ac6735c27ef8b83ddc2
2020-07-07 18:25:06 +08:00
JW Wang
be2c3fc558 Abandon sessions before/after running tests
See b/160281947#comment2 for the analysis.

Let's clean up staged sessions to improve test isolation.

Bug: 160281947
Test: atest StagedRollbackTest
Change-Id: I3ad6317eaee3ffb4c6351c630460dd8f1d27e644
2020-07-01 17:44:04 +08:00
JW Wang
eef14795db Merge "findNetworkStackApk returns an array of files (2/n)" into rvc-dev am: bba5d59a4e am: 89a6147d2f am: 7d1ddd7e94 am: 9d43f9d8d7
Original change: https://googleplex-android-review.googlesource.com/c/platform/frameworks/base/+/12004938

Change-Id: Id169b2b4de7ec06ba75a2b88d0524c7fcae3b9cd
2020-06-30 14:56:30 +00:00
JW Wang
f3a85cdee9 findNetworkStackApk returns an array of files (2/n)
This change handles the case of split APKs. All files starting with
"NetworkStack" will be returned as split APKs.

See b/159978937#comment6. NetworkStack is changed from a single APK to
split APKs. We need this change for install to succeed.

Bug: 159978937
Test: atest NetworkStagedRollbackTest
Change-Id: I20f5fee08ea208ba4dc7711d82a1718239c647c2
2020-06-29 16:16:10 +08:00
JW Wang
50aa93d6af Disable the test (1/n)
Disable the test because it is blocking pre-submit.

The analysis is at b/159569441#comment2. Waiting for the NetworkStack
team to figure out what's going wrong.

Bug: 159569441
Test: m
Change-Id: Ibb921b8e718c5c9cd86c5580010cb163125d8fae
2020-06-22 10:11:39 +08:00
TreeHugger Robot
fe8ee3926a Merge "Clean up rollbacks and test apps" into rvc-dev am: babc302595 am: c9d61439d2 am: 281b760ec2 am: 713b3e61fc
Original change: https://googleplex-android-review.googlesource.com/c/platform/frameworks/base/+/11716087

Change-Id: I1b505c9ca1c92e7fd9e70932f4ea1cc51b0f1cb6
2020-06-05 18:08:31 +00:00
JW Wang
42c73d932a Add tests for snapshot-deletion (4/n)
Tests that CE snapshots for APK are deleted after restoration.

Bug: 151805360
Test: atest StagedRollbackTest
Change-Id: I0e03909b4ac52ea60e399adf5e5a0066d71cb257
2020-06-05 14:15:19 +08:00
JW Wang
864d59ed70 Clean up rollbacks and test apps
See comment#6.

Clean up rollbacks and test apps before and after running tests.
This ensure we are in a good and expected condition when running tests.

Bug: 154080003
Test: atest RollbackTest
Test: atest MultiUserRollbackTest
Test: atest NetworkStagedRollbackTest
Test: atest StagedRollbackTest

Change-Id: If10fc8865e644611f1cf6a9db9d6dca6c7f11aee
2020-06-04 14:45:11 +08:00
JW Wang
84a83a5681 Merge "Add tests for snapshot-deletion (2/n)" into rvc-dev am: be052c6abe am: 553fdee39d am: a50f3f69e6 am: ab848f95e3
Change-Id: I78b26979bb6db902fc2a68413509fa6072827fab
2020-05-30 14:18:03 +00:00
JW Wang
e90db5aba3 Add tests for snapshot-deletion (2/n)
1. Document behavior changes due to ag/11475396
2. Test snapshots are deleted after restoration

See go/rollbackmanager-snapshot-deletion for more details.

Bug: 151805360
Test: atest StagedRollbackTest

Change-Id: Ia8993f82073a145889243bcefc74b6336bf71749
2020-05-29 15:49:54 +08:00
JW Wang
56e942aa7c Add tests for rollback data policy specified in the manifest (4/n)
Test that the user data is wiped out correctly when
rollbackDataPolicy="wipe" is specified in the manifest.

Bug: 148098864
Test: atest RollbackTest StagedRollbackTest
Change-Id: I1de723951009ec8e1417a23845d34fcd8786f687
2020-04-28 16:26:05 +08:00
JW Wang
89325cf2cd Search more NetworkStack paths
The test failed because it can't find the apk file for NetworkStack.
Let's include more names for search.

Bug: 154792230
Test: atest NetworkStagedRollbackTest
Change-Id: I0909e531fcd0e99fcedb8d07ba0be01f4e762914
2020-04-23 17:34:46 +08:00
JW Wang
ac9dac6a9d Remove the workaround
Bug: 153832351
Test: atest MultiUserRollbackTest
Change-Id: I0718632fe9c81884965f0cc10a302155d434c621
2020-04-13 15:03:13 +08:00
JW Wang
65a7eeee7b Skip the test if no mainline modules installed
The test failed because we failed to enable rollback for
ModuleMetadataGoogle which is not a module on AOSP builds.

Let's skip the test for builds which have no mainline modules
installed.

Bug: 152721401
Test: atest StagedRollbackTest
Change-Id: Iaf75dea5388e2a751a26f983a79924c4358d4833
2020-04-03 21:42:55 +08:00
JW Wang
19f128bf9f Fix a flaky test
See b/152840581#comment2 for the analysis.

1. call #waitForDeviceNotAvailable to wait for reboot reliably.
2. reduce watchdog timeout to 120s which works well for me and speeds up
   the test.

Bug: 152840581
Test: atest StagedRollbackTest
Merged-In: Ibbc9998c74681b1b8fc29b90ea66406f39ae7443
Change-Id: Ic791fbc00c231a5f24751b36e99515cfad13b7e7
2020-04-01 18:39:52 +08:00
JW Wang
350c26a4bf Fix a flaky test.
See b/152840581#comment2 for the analysis.

call #waitForDeviceNotAvailable to wait for reboot reliably.

Bug: 152840581
Test: atest NetworkStagedRollbackTest
Change-Id: Ibbc9998c74681b1b8fc29b90ea66406f39ae7443
2020-04-01 18:33:20 +08:00
JW Wang
9f8407b0aa Run expiration when rollback lifetime is changed. DO NOT MERGE
See b/151890602#comment6 for the detail.

When rollback lifetime is changed, we need to re-schedule the
expiration algorithm so rollbacks can expire at the correct time.

Note we combine #runExpiration and #scheduleExpiration so there is only
one entrance to schedule the expiration algorithm.

See
https://googleplex-android-review.git.corp.google.com/c/platform/frameworks/base/+/10899294/1/services/core/java/com/android/server/rollback/RollbackManagerServiceImpl.java#672
for the rationale.

Bug: 151890602
Test: atest RollbackTest
Change-Id: I10355143dedc0af92e0b2adfedb5f008e160cbb3
2020-03-31 18:52:29 +08:00
JW Wang
5b163cfcee Add logs for debugging
See b/151890602#comment4.

If the assumption is true, we will see logs that the rollback for
testappA is exipred happens slightly after the call to #getAvailableRollbacks.

Also move assertions below so the test runs to the end and we have a
better picture for what happened during the test.

(Cherry-picked from eab998a9af)

Bug: 151890602
Test: m
Merged-In: I85adb8c3c5598ef4ce11550b51f22d1ce3c282a6
Change-Id: I85adb8c3c5598ef4ce11550b51f22d1ce3c282a6
2020-03-31 11:01:23 +08:00
JW Wang
28310268d9 Fix an NPE in WatchdogEventLogger#stop
See b/152550404#comment15.

https://cs.corp.google.com/android/frameworks/base/tests/RollbackTest/StagedRollbackTest/src/com/android/tests/rollback/host/StagedRollbackTest.java?rcl=0b9230489ead3a2ad328d46a47194cfa9dffd25c&l=86
My theory is that somehow #setUp throws before calling mLogger.start()
and then mLogger.stop() runs into an NPE.

Let's add a null-check in the hope that the actual root cause will stand
out.

Bug: 152550404
Test: atest StagedRollbackTest
Change-Id: Ifd323e6a8707a2de19d03ecbe536feacdbb4e9c6
2020-03-30 10:19:36 +08:00
JW Wang
a09e3c0983 Fix a flaky test
It is possible to have multiple committed rollbacks which include the
same app.

Uninstalling an app will delete committed rollbacks which include
the app. However, there is a race condition between when the app is
uninstalled and when rollback manager deletes the rollback as is stated
here:

https://cs.corp.google.com/android/frameworks/base/tests/RollbackTest/RollbackTest/src/com/android/tests/rollback/RollbackTest.java?rcl=75dfeca3d40624b745f41155aa38bc5e3fa405fe&l=116

We hit the assertion in #getUniqueRollbackInfoForPackage when there are
multiple rollbacks including the same package which is caused by the
race condition above.

Let's rewrite the code by calling #hasRollbackInclude instead which will
not throw.

Also do some cleanup in the xml to improve the isolation of our tests.

Bug: 152271716
Test: atest RollbackTest
Change-Id: Iad3effe52db2a0d2d5e3914bcd08ed93926f3fd3
2020-03-24 16:09:58 +08:00
JW Wang
8cb6fe8c21 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, rollback expiration didn't happen as expected
and caused the test to fail.

We need to override the flags on our own during tests so the
device config values ('rollback_lifetime_in_millis' in this case)
won't be changed in an unexpected way.

Note this is the same fix as ag/10467568.

Bug: 151890602
Test: atest RollbackTest
Change-Id: Ie884e4807999d105f6224c46a39434e1f437ed1b
2020-03-19 11:12:36 +08:00
JW Wang
45bf445ed4 Rewrite testBadApkOnly (1/n)
When tradefed fails to run a test, it will try to recover the device
which might lead to another reboot. This interferes with our test
flow which also involves reboot. See b/150749023#comment2 for more
details.

Let's rewrite the test to prevent auto-recovery of tradefed from kicking
in. Generally, it is a bad practice to depend our test flow on a failed
test due to reboot. We should call #waitForDeviceNotAvailable to wait
for reboot to happen and then call #waitForDeviceAvailable before
continuing next tests.

Bug: 150749023
Test: atest StagedRollbackTest#testBadApkOnly
Change-Id: Ia39630585c3b7344174a8c66d0a33f05a2d80cc7
2020-03-09 10:01:23 +08:00
JW Wang
757a3bad2c Do cleanup before/after running the test
Somehow rollbacks related to testappA are not cleaned before running the
test and cause test failures. See b/150653097#comment2 for more details.

Let's clean rollbacks manually to have a clean start.

Bug: 150653097
Test: atest MultiUserRollbackTest
Change-Id: I4eb126e193f76c821d26fc62115263b86066a215
2020-03-03 16:17:57 +08:00
JW Wang
6033dd2c58 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
2020-03-02 14:57:56 +08:00
Gavin Corkery
7c46fe3663 Ensure staged rollback status is logged on boot
In the cases that a logging parent cannot be found for any packages
in a rollback, the watchdog event should still be logged. Ensure
that the state of a rollback is captured on boot by removing the
condition of only saving a rollback id if there is a logging package,
and by adding a symbolic null package to the list of logging packages
on boot if none were found. Expand tests to verify.

Bug: 149957011
Test: atest StagedRollbackTest
Test: atest NetworkStagedRollbackTest
Change-Id: I56f8afb6730e59fbe67ea8747e0da3aca19a0d8a
2020-02-23 17:23:23 +00:00
JW Wang
14168f321a Remove unused code (4/n)
Bug: 149876119
Test: m
Change-Id: I3f7c88eeb74ce5b44646fcb7a690665b78a17f2d
2020-02-20 18:52:21 +08:00
JW Wang
67eb86bb4c Pass "-g --user all" when installing apps (3/n)
'-g' to grant permissions automatically without checking the API level.
This works around the issue of b/149733368#comment2.

'--user all' to install the app on all users. This is more efficient
than calling #installPackageAsUser one by one on each user.

Bug: 149876119
Test: atest MultiUserRollbackTest
Change-Id: Ia5d85d3c13925ae969ffab9319360c1fefe1f950
2020-02-20 18:52:18 +08:00
JW Wang
f2a75879d3 No need to switch users before running tests (2/n)
My local test shows that switch-user doesn't work on my physical device.
In fact there are APIs to run tests against a particular user without
switching. It also speeds up tests without switching users from time to
time.

Bug: 149876119
Test: atest MultiUserRollbackTest
Change-Id: I34d26ddcb6a6e9cdc39228310830a3cd83212e4a
2020-02-20 18:49:59 +08:00
JW Wang
eb908a9ee1 Wait for rollback becomes available (1/n)
Sometimes RollbackManager is slow in making rollbacks available.
Let's give it enough time to do the job and make test less flaky.

Bug: 149876119
Test: atest MultiUserRollbackTest

Change-Id: I0a64e2dcde1f5e6dae618cacd6546ad953c1aca7
2020-02-20 16:25:10 +08:00
JW Wang
99c5b20bbd Speed up tests
Don't reboot the device when there is no file to delete. This saves us a
significant amount of time since each reboot takes 1 min and there are
dozens of reboot during the whole test case.

Bug: 149528114
Test: atest StagedRollbackTest

Change-Id: If3b06a304d9c87680c7cc5b7498d3b2ecf11cdfa
2020-02-17 22:08:39 +08:00
Patrick Baumann
d28bf33cf2 Adds QUERY_ALL_PACKAGES permission to rollbacktest
Test: atest com.android.tests.rollback.host.StagedRollbackTest
Bug: None
Change-Id: I499bf5f5ac8032db584aa307b2329533eb38fd36
2020-02-14 10:10:45 -08:00
JW Wang
d617d2ffbe Extract common code to a lib (4/n)
Bug: 147785893
Test: atest StagedRollbackTest NetworkStagedRollbackTest
Change-Id: I98da9f6287680691eb17afcd931b51c215da213c
2020-02-12 17:22:00 +08:00
JW Wang
332c07903a Move testNetworkPassedDoesNotRollback (3/n)
Bug: 147785893
Test: atest NetworkStagedRollbackTest
Change-Id: I16933808cc25b2c24be295b14c02c4e5fcfa600f
2020-02-11 11:16:20 +08:00
JW Wang
82228f22d4 Move testNetworkFailedRollback (2/n)
Bug: 147785893
Test: atest NetworkStagedRollbackTest
Change-Id: I801499b760e38a1eec4bab69daaa533124ad9531
2020-02-10 17:10:04 +08:00
JW Wang
6a68c9a380 Merge "Move network tests to new classes (1/n)" 2020-02-07 23:29:15 +00:00
JW Wang
ce92d6309a Move network tests to new classes (1/n)
By classifying the tests into 2 categories, we can:
1) run remaining tests with network disabled to reduce the interference
   of network crashes.
2) make it easier to identify bugs caused by network stack or
   problems in rollback infra.

Note this CL contains stubs only. We will move actual test code later.

Bug: 147785893
Test: m
Change-Id: I5ecc63a057e9a115ea3aa446970a3f20dff750d0
2020-02-07 19:49:12 +08:00