Dimitry Ivanov | 4cabfaa | 2017-03-07 11:19:05 -0800 | [diff] [blame] | 1 | /* |
| 2 | * Copyright (C) 2017 The Android Open Source Project |
| 3 | * All rights reserved. |
| 4 | * |
| 5 | * Redistribution and use in source and binary forms, with or without |
| 6 | * modification, are permitted provided that the following conditions |
| 7 | * are met: |
| 8 | * * Redistributions of source code must retain the above copyright |
| 9 | * notice, this list of conditions and the following disclaimer. |
| 10 | * * Redistributions in binary form must reproduce the above copyright |
| 11 | * notice, this list of conditions and the following disclaimer in |
| 12 | * the documentation and/or other materials provided with the |
| 13 | * distribution. |
| 14 | * |
| 15 | * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS |
| 16 | * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT |
| 17 | * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS |
| 18 | * FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE |
| 19 | * COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, |
| 20 | * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, |
| 21 | * BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS |
| 22 | * OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED |
| 23 | * AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, |
| 24 | * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT |
| 25 | * OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF |
| 26 | * SUCH DAMAGE. |
| 27 | */ |
| 28 | |
| 29 | #include <stdlib.h> |
| 30 | #include <string.h> |
| 31 | #include <sys/mman.h> |
| 32 | |
| 33 | #include <gtest/gtest.h> |
| 34 | |
Elliott Hughes | 15a2b7b | 2019-02-15 13:48:38 -0800 | [diff] [blame] | 35 | #include "linker_config.h" |
| 36 | #include "linker_utils.h" |
Dimitry Ivanov | 4cabfaa | 2017-03-07 11:19:05 -0800 | [diff] [blame] | 37 | |
| 38 | #include <unistd.h> |
| 39 | |
Mark Salyzyn | ba1a723 | 2018-11-14 15:19:53 -0800 | [diff] [blame] | 40 | #include <android-base/file.h> |
Tom Cherry | 98f016f | 2017-04-05 16:20:29 -0700 | [diff] [blame] | 41 | #include <android-base/scopeguard.h> |
Dimitry Ivanov | 4cabfaa | 2017-03-07 11:19:05 -0800 | [diff] [blame] | 42 | #include <android-base/stringprintf.h> |
Dimitry Ivanov | 4cabfaa | 2017-03-07 11:19:05 -0800 | [diff] [blame] | 43 | |
Jaesung Chung | 9d97008 | 2017-06-16 14:43:16 +0900 | [diff] [blame] | 44 | #if defined(__LP64__) |
| 45 | #define ARCH_SUFFIX "64" |
| 46 | #else |
| 47 | #define ARCH_SUFFIX "" |
| 48 | #endif |
Dimitry Ivanov | 4cabfaa | 2017-03-07 11:19:05 -0800 | [diff] [blame] | 49 | |
Jooyung Han | 61a9a40 | 2020-06-02 15:38:49 +0900 | [diff] [blame^] | 50 | // clang-format off |
Dimitry Ivanov | 4cabfaa | 2017-03-07 11:19:05 -0800 | [diff] [blame] | 51 | static const char* config_str = |
| 52 | "# comment \n" |
| 53 | "dir.test = /data/local/tmp\n" |
| 54 | "\n" |
| 55 | "[test]\n" |
| 56 | "\n" |
| 57 | "enable.target.sdk.version = true\n" |
| 58 | "additional.namespaces=system\n" |
Jiyong Park | 8b02951 | 2017-11-29 18:30:53 +0900 | [diff] [blame] | 59 | "additional.namespaces+=vndk\n" |
Vic Yang | 2d020e4 | 2019-01-12 21:03:25 -0800 | [diff] [blame] | 60 | "additional.namespaces+=vndk_in_system\n" |
Dimitry Ivanov | 4cabfaa | 2017-03-07 11:19:05 -0800 | [diff] [blame] | 61 | "namespace.default.isolated = true\n" |
| 62 | "namespace.default.search.paths = /vendor/${LIB}\n" |
| 63 | "namespace.default.permitted.paths = /vendor/${LIB}\n" |
Jiyong Park | 8b02951 | 2017-11-29 18:30:53 +0900 | [diff] [blame] | 64 | "namespace.default.asan.search.paths = /data\n" |
| 65 | "namespace.default.asan.search.paths += /vendor/${LIB}\n" |
Dimitry Ivanov | 4cabfaa | 2017-03-07 11:19:05 -0800 | [diff] [blame] | 66 | "namespace.default.asan.permitted.paths = /data:/vendor\n" |
| 67 | "namespace.default.links = system\n" |
Jiyong Park | 8b02951 | 2017-11-29 18:30:53 +0900 | [diff] [blame] | 68 | "namespace.default.links += vndk\n" |
| 69 | // irregular whitespaces are added intentionally for testing purpose |
| 70 | "namespace.default.link.system.shared_libs= libc.so\n" |
| 71 | "namespace.default.link.system.shared_libs += libm.so:libdl.so\n" |
| 72 | "namespace.default.link.system.shared_libs +=libstdc++.so\n" |
| 73 | "namespace.default.link.vndk.shared_libs = libcutils.so:libbase.so\n" |
Dimitry Ivanov | 4cabfaa | 2017-03-07 11:19:05 -0800 | [diff] [blame] | 74 | "namespace.system.isolated = true\n" |
Jiyong Park | d7c4832 | 2017-04-03 23:10:37 +0900 | [diff] [blame] | 75 | "namespace.system.visible = true\n" |
Dimitry Ivanov | 4cabfaa | 2017-03-07 11:19:05 -0800 | [diff] [blame] | 76 | "namespace.system.search.paths = /system/${LIB}\n" |
| 77 | "namespace.system.permitted.paths = /system/${LIB}\n" |
| 78 | "namespace.system.asan.search.paths = /data:/system/${LIB}\n" |
| 79 | "namespace.system.asan.permitted.paths = /data:/system\n" |
Jiyong Park | 8b02951 | 2017-11-29 18:30:53 +0900 | [diff] [blame] | 80 | "namespace.vndk.isolated = tr\n" |
| 81 | "namespace.vndk.isolated += ue\n" // should be ignored and return as 'false'. |
| 82 | "namespace.vndk.search.paths = /system/${LIB}/vndk\n" |
| 83 | "namespace.vndk.asan.search.paths = /data\n" |
| 84 | "namespace.vndk.asan.search.paths += /system/${LIB}/vndk\n" |
Logan Chien | 9ee4591 | 2018-01-18 12:05:09 +0800 | [diff] [blame] | 85 | "namespace.vndk.links = default\n" |
| 86 | "namespace.vndk.link.default.allow_all_shared_libs = true\n" |
Vic Yang | 2d020e4 | 2019-01-12 21:03:25 -0800 | [diff] [blame] | 87 | "namespace.vndk.link.vndk_in_system.allow_all_shared_libs = true\n" |
| 88 | "namespace.vndk_in_system.isolated = true\n" |
| 89 | "namespace.vndk_in_system.visible = true\n" |
| 90 | "namespace.vndk_in_system.search.paths = /system/${LIB}\n" |
| 91 | "namespace.vndk_in_system.permitted.paths = /system/${LIB}\n" |
Jooyung Han | 61a9a40 | 2020-06-02 15:38:49 +0900 | [diff] [blame^] | 92 | "namespace.vndk_in_system.whitelisted = libz.so:libyuv.so\n" |
| 93 | "namespace.vndk_in_system.whitelisted += libtinyxml2.so\n" |
Dimitry Ivanov | 4cabfaa | 2017-03-07 11:19:05 -0800 | [diff] [blame] | 94 | "\n"; |
Jooyung Han | 61a9a40 | 2020-06-02 15:38:49 +0900 | [diff] [blame^] | 95 | // clang-format on |
Dimitry Ivanov | 4cabfaa | 2017-03-07 11:19:05 -0800 | [diff] [blame] | 96 | |
| 97 | static bool write_version(const std::string& path, uint32_t version) { |
| 98 | std::string content = android::base::StringPrintf("%d", version); |
| 99 | return android::base::WriteStringToFile(content, path); |
| 100 | } |
| 101 | |
Jaesung Chung | 9d97008 | 2017-06-16 14:43:16 +0900 | [diff] [blame] | 102 | static std::vector<std::string> resolve_paths(std::vector<std::string> paths) { |
| 103 | std::vector<std::string> resolved_paths; |
| 104 | resolve_paths(paths, &resolved_paths); |
| 105 | return resolved_paths; |
| 106 | } |
| 107 | |
Dimitry Ivanov | 4cabfaa | 2017-03-07 11:19:05 -0800 | [diff] [blame] | 108 | static void run_linker_config_smoke_test(bool is_asan) { |
Jaesung Chung | 9d97008 | 2017-06-16 14:43:16 +0900 | [diff] [blame] | 109 | const std::vector<std::string> kExpectedDefaultSearchPath = |
| 110 | resolve_paths(is_asan ? std::vector<std::string>({ "/data", "/vendor/lib" ARCH_SUFFIX }) : |
| 111 | std::vector<std::string>({ "/vendor/lib" ARCH_SUFFIX })); |
Dimitry Ivanov | 4cabfaa | 2017-03-07 11:19:05 -0800 | [diff] [blame] | 112 | |
Jaesung Chung | 9d97008 | 2017-06-16 14:43:16 +0900 | [diff] [blame] | 113 | const std::vector<std::string> kExpectedDefaultPermittedPath = |
| 114 | resolve_paths(is_asan ? std::vector<std::string>({ "/data", "/vendor" }) : |
| 115 | std::vector<std::string>({ "/vendor/lib" ARCH_SUFFIX })); |
Dimitry Ivanov | 4cabfaa | 2017-03-07 11:19:05 -0800 | [diff] [blame] | 116 | |
Jaesung Chung | 9d97008 | 2017-06-16 14:43:16 +0900 | [diff] [blame] | 117 | const std::vector<std::string> kExpectedSystemSearchPath = |
| 118 | resolve_paths(is_asan ? std::vector<std::string>({ "/data", "/system/lib" ARCH_SUFFIX }) : |
| 119 | std::vector<std::string>({ "/system/lib" ARCH_SUFFIX })); |
Dimitry Ivanov | 4cabfaa | 2017-03-07 11:19:05 -0800 | [diff] [blame] | 120 | |
Jaesung Chung | 9d97008 | 2017-06-16 14:43:16 +0900 | [diff] [blame] | 121 | const std::vector<std::string> kExpectedSystemPermittedPath = |
| 122 | resolve_paths(is_asan ? std::vector<std::string>({ "/data", "/system" }) : |
| 123 | std::vector<std::string>({ "/system/lib" ARCH_SUFFIX })); |
Dimitry Ivanov | 4cabfaa | 2017-03-07 11:19:05 -0800 | [diff] [blame] | 124 | |
Jiyong Park | 8b02951 | 2017-11-29 18:30:53 +0900 | [diff] [blame] | 125 | const std::vector<std::string> kExpectedVndkSearchPath = |
| 126 | resolve_paths(is_asan ? std::vector<std::string>({ "/data", "/system/lib" ARCH_SUFFIX "/vndk"}) : |
| 127 | std::vector<std::string>({ "/system/lib" ARCH_SUFFIX "/vndk"})); |
| 128 | |
Dimitry Ivanov | 4cabfaa | 2017-03-07 11:19:05 -0800 | [diff] [blame] | 129 | TemporaryFile tmp_file; |
| 130 | close(tmp_file.fd); |
| 131 | tmp_file.fd = -1; |
| 132 | |
| 133 | android::base::WriteStringToFile(config_str, tmp_file.path); |
| 134 | |
| 135 | TemporaryDir tmp_dir; |
| 136 | |
| 137 | std::string executable_path = std::string(tmp_dir.path) + "/some-binary"; |
| 138 | std::string version_file = std::string(tmp_dir.path) + "/.version"; |
| 139 | |
Tom Cherry | 98f016f | 2017-04-05 16:20:29 -0700 | [diff] [blame] | 140 | auto file_guard = |
| 141 | android::base::make_scope_guard([&version_file] { unlink(version_file.c_str()); }); |
Dimitry Ivanov | 4cabfaa | 2017-03-07 11:19:05 -0800 | [diff] [blame] | 142 | |
| 143 | ASSERT_TRUE(write_version(version_file, 113U)) << strerror(errno); |
| 144 | |
| 145 | // read config |
| 146 | const Config* config = nullptr; |
| 147 | std::string error_msg; |
| 148 | ASSERT_TRUE(Config::read_binary_config(tmp_file.path, |
| 149 | executable_path.c_str(), |
| 150 | is_asan, |
| 151 | &config, |
| 152 | &error_msg)) << error_msg; |
| 153 | ASSERT_TRUE(config != nullptr); |
| 154 | ASSERT_TRUE(error_msg.empty()); |
| 155 | |
Elliott Hughes | ff1428a | 2018-11-12 16:01:37 -0800 | [diff] [blame] | 156 | ASSERT_EQ(113, config->target_sdk_version()); |
Dimitry Ivanov | 4cabfaa | 2017-03-07 11:19:05 -0800 | [diff] [blame] | 157 | |
| 158 | const NamespaceConfig* default_ns_config = config->default_namespace_config(); |
| 159 | ASSERT_TRUE(default_ns_config != nullptr); |
| 160 | |
| 161 | ASSERT_TRUE(default_ns_config->isolated()); |
Jiyong Park | d7c4832 | 2017-04-03 23:10:37 +0900 | [diff] [blame] | 162 | ASSERT_FALSE(default_ns_config->visible()); |
Dimitry Ivanov | 4cabfaa | 2017-03-07 11:19:05 -0800 | [diff] [blame] | 163 | ASSERT_EQ(kExpectedDefaultSearchPath, default_ns_config->search_paths()); |
| 164 | ASSERT_EQ(kExpectedDefaultPermittedPath, default_ns_config->permitted_paths()); |
| 165 | |
| 166 | const auto& default_ns_links = default_ns_config->links(); |
Jiyong Park | 8b02951 | 2017-11-29 18:30:53 +0900 | [diff] [blame] | 167 | ASSERT_EQ(2U, default_ns_links.size()); |
Logan Chien | 9ee4591 | 2018-01-18 12:05:09 +0800 | [diff] [blame] | 168 | |
Dimitry Ivanov | 4cabfaa | 2017-03-07 11:19:05 -0800 | [diff] [blame] | 169 | ASSERT_EQ("system", default_ns_links[0].ns_name()); |
| 170 | ASSERT_EQ("libc.so:libm.so:libdl.so:libstdc++.so", default_ns_links[0].shared_libs()); |
Logan Chien | 9ee4591 | 2018-01-18 12:05:09 +0800 | [diff] [blame] | 171 | ASSERT_FALSE(default_ns_links[0].allow_all_shared_libs()); |
| 172 | |
Jiyong Park | 8b02951 | 2017-11-29 18:30:53 +0900 | [diff] [blame] | 173 | ASSERT_EQ("vndk", default_ns_links[1].ns_name()); |
| 174 | ASSERT_EQ("libcutils.so:libbase.so", default_ns_links[1].shared_libs()); |
Logan Chien | 9ee4591 | 2018-01-18 12:05:09 +0800 | [diff] [blame] | 175 | ASSERT_FALSE(default_ns_links[1].allow_all_shared_libs()); |
Dimitry Ivanov | 4cabfaa | 2017-03-07 11:19:05 -0800 | [diff] [blame] | 176 | |
| 177 | auto& ns_configs = config->namespace_configs(); |
Vic Yang | 2d020e4 | 2019-01-12 21:03:25 -0800 | [diff] [blame] | 178 | ASSERT_EQ(4U, ns_configs.size()); |
Dimitry Ivanov | 4cabfaa | 2017-03-07 11:19:05 -0800 | [diff] [blame] | 179 | |
| 180 | // find second namespace |
| 181 | const NamespaceConfig* ns_system = nullptr; |
Jiyong Park | 8b02951 | 2017-11-29 18:30:53 +0900 | [diff] [blame] | 182 | const NamespaceConfig* ns_vndk = nullptr; |
Vic Yang | 2d020e4 | 2019-01-12 21:03:25 -0800 | [diff] [blame] | 183 | const NamespaceConfig* ns_vndk_in_system = nullptr; |
Dimitry Ivanov | 4cabfaa | 2017-03-07 11:19:05 -0800 | [diff] [blame] | 184 | for (auto& ns : ns_configs) { |
| 185 | std::string ns_name = ns->name(); |
Vic Yang | 2d020e4 | 2019-01-12 21:03:25 -0800 | [diff] [blame] | 186 | ASSERT_TRUE(ns_name == "system" || ns_name == "default" || |
| 187 | ns_name == "vndk" || ns_name == "vndk_in_system") |
Dimitry Ivanov | 4cabfaa | 2017-03-07 11:19:05 -0800 | [diff] [blame] | 188 | << "unexpected ns name: " << ns->name(); |
| 189 | |
| 190 | if (ns_name == "system") { |
| 191 | ns_system = ns.get(); |
Jiyong Park | 8b02951 | 2017-11-29 18:30:53 +0900 | [diff] [blame] | 192 | } else if (ns_name == "vndk") { |
| 193 | ns_vndk = ns.get(); |
Vic Yang | 2d020e4 | 2019-01-12 21:03:25 -0800 | [diff] [blame] | 194 | } else if (ns_name == "vndk_in_system") { |
| 195 | ns_vndk_in_system = ns.get(); |
Dimitry Ivanov | 4cabfaa | 2017-03-07 11:19:05 -0800 | [diff] [blame] | 196 | } |
| 197 | } |
| 198 | |
| 199 | ASSERT_TRUE(ns_system != nullptr) << "system namespace was not found"; |
| 200 | |
| 201 | ASSERT_TRUE(ns_system->isolated()); |
Jiyong Park | d7c4832 | 2017-04-03 23:10:37 +0900 | [diff] [blame] | 202 | ASSERT_TRUE(ns_system->visible()); |
Dimitry Ivanov | 4cabfaa | 2017-03-07 11:19:05 -0800 | [diff] [blame] | 203 | ASSERT_EQ(kExpectedSystemSearchPath, ns_system->search_paths()); |
| 204 | ASSERT_EQ(kExpectedSystemPermittedPath, ns_system->permitted_paths()); |
Jiyong Park | 8b02951 | 2017-11-29 18:30:53 +0900 | [diff] [blame] | 205 | |
| 206 | ASSERT_TRUE(ns_vndk != nullptr) << "vndk namespace was not found"; |
| 207 | |
| 208 | ASSERT_FALSE(ns_vndk->isolated()); // malformed bool property |
Logan Chien | 9ee4591 | 2018-01-18 12:05:09 +0800 | [diff] [blame] | 209 | ASSERT_FALSE(ns_vndk->visible()); // undefined bool property |
Jiyong Park | 8b02951 | 2017-11-29 18:30:53 +0900 | [diff] [blame] | 210 | ASSERT_EQ(kExpectedVndkSearchPath, ns_vndk->search_paths()); |
Logan Chien | 9ee4591 | 2018-01-18 12:05:09 +0800 | [diff] [blame] | 211 | |
| 212 | const auto& ns_vndk_links = ns_vndk->links(); |
| 213 | ASSERT_EQ(1U, ns_vndk_links.size()); |
| 214 | ASSERT_EQ("default", ns_vndk_links[0].ns_name()); |
| 215 | ASSERT_TRUE(ns_vndk_links[0].allow_all_shared_libs()); |
Vic Yang | 2d020e4 | 2019-01-12 21:03:25 -0800 | [diff] [blame] | 216 | |
| 217 | ASSERT_TRUE(ns_vndk_in_system != nullptr) << "vndk_in_system namespace was not found"; |
| 218 | ASSERT_EQ( |
| 219 | std::vector<std::string>({"libz.so", "libyuv.so", "libtinyxml2.so"}), |
| 220 | ns_vndk_in_system->whitelisted_libs()); |
Dimitry Ivanov | 4cabfaa | 2017-03-07 11:19:05 -0800 | [diff] [blame] | 221 | } |
| 222 | |
| 223 | TEST(linker_config, smoke) { |
| 224 | run_linker_config_smoke_test(false); |
| 225 | } |
| 226 | |
Jiyong Park | 1a524d6 | 2017-08-04 10:25:46 +0900 | [diff] [blame] | 227 | TEST(linker_config, asan_smoke) { |
| 228 | run_linker_config_smoke_test(true); |
| 229 | } |
Logan Chien | 9ee4591 | 2018-01-18 12:05:09 +0800 | [diff] [blame] | 230 | |
| 231 | TEST(linker_config, ns_link_shared_libs_invalid_settings) { |
| 232 | // This unit test ensures an error is emitted when a namespace link in ld.config.txt specifies |
| 233 | // both shared_libs and allow_all_shared_libs. |
| 234 | |
| 235 | static const char config_str[] = |
| 236 | "dir.test = /data/local/tmp\n" |
| 237 | "\n" |
| 238 | "[test]\n" |
| 239 | "additional.namespaces = system\n" |
| 240 | "namespace.default.links = system\n" |
| 241 | "namespace.default.link.system.shared_libs = libc.so:libm.so\n" |
| 242 | "namespace.default.link.system.allow_all_shared_libs = true\n" |
| 243 | "\n"; |
| 244 | |
| 245 | TemporaryFile tmp_file; |
| 246 | close(tmp_file.fd); |
| 247 | tmp_file.fd = -1; |
| 248 | |
| 249 | android::base::WriteStringToFile(config_str, tmp_file.path); |
| 250 | |
| 251 | TemporaryDir tmp_dir; |
| 252 | |
| 253 | std::string executable_path = std::string(tmp_dir.path) + "/some-binary"; |
| 254 | |
| 255 | const Config* config = nullptr; |
| 256 | std::string error_msg; |
| 257 | ASSERT_FALSE(Config::read_binary_config(tmp_file.path, |
| 258 | executable_path.c_str(), |
| 259 | false, |
| 260 | &config, |
| 261 | &error_msg)); |
| 262 | ASSERT_TRUE(config == nullptr); |
| 263 | ASSERT_EQ(std::string(tmp_file.path) + ":6: " |
| 264 | "error: both shared_libs and allow_all_shared_libs are set for default->system link.", |
| 265 | error_msg); |
| 266 | } |
Inseob Kim | 216323b | 2018-06-18 15:30:18 +0900 | [diff] [blame] | 267 | |
| 268 | TEST(linker_config, dir_path_resolve) { |
| 269 | // This unit test ensures the linker resolves paths of dir.${section} |
| 270 | // properties to real path. |
| 271 | |
| 272 | TemporaryDir tmp_dir; |
| 273 | |
| 274 | std::string sub_dir = std::string(tmp_dir.path) + "/subdir"; |
| 275 | mkdir(sub_dir.c_str(), 0755); |
| 276 | |
| 277 | auto subdir_guard = |
| 278 | android::base::make_scope_guard([&sub_dir] { rmdir(sub_dir.c_str()); }); |
| 279 | |
| 280 | std::string symlink_path = std::string(tmp_dir.path) + "/symlink"; |
| 281 | symlink(sub_dir.c_str(), symlink_path.c_str()); |
| 282 | |
| 283 | auto symlink_guard = |
| 284 | android::base::make_scope_guard([&symlink_path] { unlink(symlink_path.c_str()); }); |
| 285 | |
| 286 | std::string config_str = |
| 287 | "dir.test = " + symlink_path + "\n" |
| 288 | "\n" |
| 289 | "[test]\n"; |
| 290 | |
| 291 | TemporaryFile tmp_file; |
| 292 | close(tmp_file.fd); |
| 293 | tmp_file.fd = -1; |
| 294 | |
| 295 | android::base::WriteStringToFile(config_str, tmp_file.path); |
| 296 | |
| 297 | std::string executable_path = sub_dir + "/some-binary"; |
| 298 | |
| 299 | const Config* config = nullptr; |
| 300 | std::string error_msg; |
| 301 | |
| 302 | ASSERT_TRUE(Config::read_binary_config(tmp_file.path, |
| 303 | executable_path.c_str(), |
| 304 | false, |
| 305 | &config, |
| 306 | &error_msg)) << error_msg; |
| 307 | |
| 308 | ASSERT_TRUE(config != nullptr) << error_msg; |
| 309 | ASSERT_TRUE(error_msg.empty()) << error_msg; |
| 310 | } |