From cc2bf6b9d3bff216f04ad3263265fb96ef1674bb Mon Sep 17 00:00:00 2001 From: David Anderson Date: Mon, 27 Apr 2020 14:44:03 -0700 Subject: [PATCH] libfiemap: Ignore userdata requirements in fiemap_writer_test when running a DSU. The test is guaranteed to fail because userdata is itself a fiemap-backed device. Bug: 154447105 Test: fiemap_writer_test on DSU Change-Id: Ied35da0eb7aba3daca7ed430f006bf1e90e21dca --- fs_mgr/libfiemap/Android.bp | 1 + fs_mgr/libfiemap/fiemap_writer_test.cpp | 6 +++++- 2 files changed, 6 insertions(+), 1 deletion(-) diff --git a/fs_mgr/libfiemap/Android.bp b/fs_mgr/libfiemap/Android.bp index 9d18a442b..bde9d0a70 100644 --- a/fs_mgr/libfiemap/Android.bp +++ b/fs_mgr/libfiemap/Android.bp @@ -69,6 +69,7 @@ cc_test { "libdm", "libfs_mgr", "liblog", + "libgsi", ], data: [ diff --git a/fs_mgr/libfiemap/fiemap_writer_test.cpp b/fs_mgr/libfiemap/fiemap_writer_test.cpp index 22a37225e..3c8ab42c1 100644 --- a/fs_mgr/libfiemap/fiemap_writer_test.cpp +++ b/fs_mgr/libfiemap/fiemap_writer_test.cpp @@ -35,6 +35,7 @@ #include #include #include +#include #include "utility.h" @@ -148,7 +149,10 @@ TEST_F(FiemapWriterTest, CheckBlockDevicePath) { FiemapUniquePtr fptr = FiemapWriter::Open(testfile, gBlockSize); EXPECT_EQ(fptr->size(), gBlockSize); EXPECT_EQ(fptr->bdev_path().find("/dev/block/"), size_t(0)); - EXPECT_EQ(fptr->bdev_path().find("/dev/block/dm-"), string::npos); + + if (!android::gsi::IsGsiRunning()) { + EXPECT_EQ(fptr->bdev_path().find("/dev/block/dm-"), string::npos); + } } TEST_F(FiemapWriterTest, CheckFileCreated) {