android_system_core/fs_mgr/libsnapshot
David Anderson 7834809350 vts_libsnapshot_test: Fix test flakiness.
This patch fixes a few lingering issues in vts_libsnapshot_test.

The most important fix is a crash in snapuserd when handler deletion
races with the merge monitor thread. Since tests issue lots of
snapshot-related requests in rapid succession, this was easy to hit in
presubmit, and resulted in a null-pointer deref.

SnapuserdClient's CloseConnection does the same thing as the destructor,
but leaves SnapuserdClient in an unusable state. This method is removed
in favor of RAII.

Fix a bug in SnapshotManager where CloseConnection could be called
without zapping snapuserd_client_.

Fix a bug where POLLHUP was checked before calling recv().

Add test name logging so presubmit failures can be diagnosed via logcat
dumps.

Bug: N/A
Test: vts_libsnapshot_test on cuttlefish
Change-Id: I8f22a45e537c24a3c6d327ac47bf8b1352108706
2022-09-07 21:58:03 -07:00
..
android/snapshot libsnapshot: Clarify the meaning of "compression.enabled". 2022-07-27 18:32:15 -07:00
corpus libsnapshot: Move ImageManager creation to DeviceInfo. 2021-05-13 11:33:38 -07:00
include/libsnapshot libsnapshot: reorder COW ops vector 2022-08-16 17:37:10 +00:00
include_test/libsnapshot libsnapshot: Switch to IPropertyFetcher. 2022-07-28 11:28:29 -07:00
scripts Add LOCAL_LICENSE_KINDS to system/core/fs_mgr 2021-09-15 10:57:11 -07:00
snapuserd vts_libsnapshot_test: Fix test flakiness. 2022-09-07 21:58:03 -07:00
update_engine libsnapshot: Retrieve COW version from update engine manifest 2021-04-30 06:46:24 +00:00
Android.bp Convert fastboot/libsnapshot to new BootControl client 2022-07-08 10:57:53 -07:00
cow_api_test.cpp libsnapshot: Add function to verify merge sequence 2021-09-24 16:03:17 -07:00
cow_decompress.cpp Add lz4 support for VABC 2022-06-29 13:10:55 -07:00
cow_decompress.h Add lz4 support for VABC 2022-06-29 13:10:55 -07:00
cow_format.cpp libsnapshot: Add function to verify merge sequence 2021-09-24 16:03:17 -07:00
cow_reader.cpp libsnapshot: reorder COW ops vector 2022-08-16 17:37:10 +00:00
cow_writer.cpp Add lz4 support for VABC 2022-06-29 13:10:55 -07:00
device_info.cpp Convert fastboot/libsnapshot to new BootControl client 2022-07-08 10:57:53 -07:00
device_info.h Convert fastboot/libsnapshot to new BootControl client 2022-07-08 10:57:53 -07:00
dm_snapshot_internals.h libsnapshot: Use std::unordered_set in DmSnapCowSizeCalculator. 2021-07-30 11:02:28 -07:00
estimate_cow_from_nonab_ota.cpp reland: Rename Flush to Finalize 2020-10-22 02:34:26 -07:00
fuzz.sh Rename native code coverage paths env. variable in libsnapshot's fuzz test. 2020-06-10 13:04:53 +01:00
fuzz_utils.cpp libsnapshot_fuzzer: use protobuf 2020-04-30 23:05:36 -07:00
fuzz_utils.h Reland "libsnapshot_fuzzer: Add tests" 2020-05-15 14:34:01 -07:00
inspect_cow.cpp inspect_cow: Print OTA ops for debugging 2022-02-28 22:05:21 +00:00
make_cow_from_ab_ota.cpp libsnapshot: Support cluster_ops in make_cow_from_ab_ota 2020-12-02 21:31:23 -08:00
OWNERS libsnapshot: Edit OWNERS file 2022-03-03 01:18:07 +00:00
partition_cow_creator.cpp libsnapshot: Clarify the meaning of "compression.enabled". 2022-07-27 18:32:15 -07:00
partition_cow_creator.h libsnapshot: Clarify the meaning of "compression.enabled". 2022-07-27 18:32:15 -07:00
partition_cow_creator_test.cpp libsnapshot: Clarify the meaning of "compression.enabled". 2022-07-27 18:32:15 -07:00
power_test.cpp libsnapshot: Add a simple script and gtest to simulate power failures during snapshot-merge. 2020-04-14 23:32:38 -07:00
PowerTest.md libsnapshot: Add a simple script and gtest to simulate power failures during snapshot-merge. 2020-04-14 23:32:38 -07:00
return.cpp libsnapshot: delete WaitForMerge. 2020-03-03 13:19:49 -08:00
run_power_test.sh libsnapshot: Add a simple script and gtest to simulate power failures during snapshot-merge. 2020-04-14 23:32:38 -07:00
run_snapshot_tests.sh libsnapshot: Unify vts_libsnapshot_test harness. 2021-12-05 22:39:50 -08:00
snapshot.cpp vts_libsnapshot_test: Fix test flakiness. 2022-09-07 21:58:03 -07:00
snapshot_fuzz.cpp Use more inclusive language for #inclusivefixit 2020-07-23 11:13:37 -07:00
snapshot_fuzz_utils.cpp fs_mgr: remove crypt_footer argument from fs_mgr_do_format() 2021-11-09 22:44:50 -08:00
snapshot_fuzz_utils.h Convert fastboot/libsnapshot to new BootControl client 2022-07-08 10:57:53 -07:00
snapshot_metadata_updater.cpp Merge "libsnapshot: Properly set partial_update_" 2020-07-31 23:02:05 +00:00
snapshot_metadata_updater.h Update libsnapshot to handle partial update 2020-06-09 12:53:45 -07:00
snapshot_metadata_updater_test.cpp libsnapshot_test: skip global setup on non-VAB devices. 2020-08-06 17:21:50 -07:00
snapshot_reader.cpp snapuserd: Add support for Xor ops in snapuserd 2021-07-30 20:44:46 -07:00
snapshot_reader.h libsnapshot: Implement OpenReader for CompressedSnapshotWriter. 2020-10-26 22:30:21 -07:00
snapshot_reader_test.cpp libsnapshot: Fix crash in MakeXorBlockString test. 2021-12-02 23:51:39 -08:00
snapshot_stats.cpp libsnapshot: Add more feature flags to SnapshotMergeReport. 2022-05-25 13:40:31 -07:00
snapshot_stub.cpp libsnapshot: Add more feature flags to SnapshotMergeReport. 2022-05-25 13:40:31 -07:00
snapshot_test.cpp vts_libsnapshot_test: Fix test flakiness. 2022-09-07 21:58:03 -07:00
snapshot_writer.cpp Add VerifyMergeOps to ISnapshotWriter 2021-09-29 10:04:11 -07:00
snapshot_writer_test.cpp Add a small testcase for snapshot writer. 2021-05-04 13:51:34 -04:00
snapshotctl.cpp Add helptext for snapshotctl map 2021-05-25 14:43:52 -04:00
test_helpers.cpp libsnapshot: Switch to IPropertyFetcher. 2022-07-28 11:28:29 -07:00
utility.cpp libsnapshot: Switch to IPropertyFetcher. 2022-07-28 11:28:29 -07:00
utility.h libsnapshot: fix -Wdefaulted-function-delete warnings. 2022-08-07 11:55:57 +00:00
vts_ota_config_test.cpp Check userspace snapshots only for API level >= T 2022-07-05 16:43:31 +05:30