From a6c65704d6b2b4a092dd228d14b522904556b6cb Mon Sep 17 00:00:00 2001 From: Elliott Hughes Date: Wed, 11 Jan 2017 17:34:40 -0800 Subject: [PATCH] Fix libbase file.Readlink test on marlin/sailfish. Bug: http://b/33306057 Test: ran tests Change-Id: Ie6797e71d3507572da66d6b6966f8ee9373124a4 --- base/file_test.cpp | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/base/file_test.cpp b/base/file_test.cpp index f741d89a0..ed39ce973 100644 --- a/base/file_test.cpp +++ b/base/file_test.cpp @@ -134,7 +134,11 @@ TEST(file, Readlink) { // Linux doesn't allow empty symbolic links. std::string min("x"); // ext2 and ext4 both have PAGE_SIZE limits. - std::string max(static_cast(4096 - 1), 'x'); + // If file encryption is enabled, there's extra overhead to store the + // size of the encrypted symlink target. There's also an off-by-one + // in current kernels (and marlin/sailfish where we're seeing this + // failure are still on 3.18, far from current). http://b/33306057. + std::string max(static_cast(4096 - 2 - 1 - 1), 'x'); TemporaryDir td; std::string min_path{std::string(td.path) + "/" + "min"};