Commit 9b25ed22 authored by Sergey Ulanov's avatar Sergey Ulanov Committed by Commit Bot

[Fuchsia] Write net-test-server-config to /tmp

Previuously net-test-server-config was written to /data/shared,
which is then mapped to /test-shared in the test launcher. The problem
was that this approach breaks when test launcher is not used (i.e. with
--single-process-tests flag). Updated runner scripts to copy the file to
/tmp. This approach is more consistent with other platforms and doesn't
require any special logic in the test launcher.

Change-Id: I5377eda57a0524b02e7ce419a5930ff16087a2e6
Reviewed-on: https://chromium-review.googlesource.com/c/1374456Reviewed-by: default avatarMatt Menke <mmenke@chromium.org>
Reviewed-by: default avatarKevin Marshall <kmarshall@chromium.org>
Reviewed-by: default avatarNico Weber <thakis@chromium.org>
Commit-Queue: Sergey Ulanov <sergeyu@chromium.org>
Cr-Commit-Position: refs/heads/master@{#616052}
parent dd5029e4
...@@ -378,21 +378,6 @@ int LaunchChildTestProcessWithOptions(const CommandLine& command_line, ...@@ -378,21 +378,6 @@ int LaunchChildTestProcessWithOptions(const CommandLine& command_line,
base::File::FLAG_DELETE_ON_CLOSE)) base::File::FLAG_DELETE_ON_CLOSE))
.release()}); .release()});
// The test launcher can use a shared data directory for providing tests with
// files deployed at runtime. The files are located under the directory
// "/data/shared". They will be mounted at "/test-shared" under the child
// process' namespace.
const base::FilePath kSharedDataSourcePath("/data/shared");
const base::FilePath kSharedDataTargetPath("/test-shared");
if (base::PathExists(kSharedDataSourcePath)) {
zx::handle shared_directory_handle = base::fuchsia::GetHandleFromFile(
base::File(kSharedDataSourcePath,
base::File::FLAG_OPEN | base::File::FLAG_READ |
base::File::FLAG_DELETE_ON_CLOSE));
new_options.paths_to_transfer.push_back(
{kSharedDataTargetPath, shared_directory_handle.release()});
}
#endif // defined(OS_FUCHSIA) #endif // defined(OS_FUCHSIA)
#if defined(OS_LINUX) #if defined(OS_LINUX)
......
...@@ -130,7 +130,6 @@ def SetupTestServer(target, test_concurrency): ...@@ -130,7 +130,6 @@ def SetupTestServer(target, test_concurrency):
})) }))
config_file.flush() config_file.flush()
target.RunCommand(['mkdir /data/shared']) target.PutFile(config_file.name, '/tmp/net-test-server-config')
target.PutFile(config_file.name, '/data/shared/net-test-server-config')
return spawning_server return spawning_server
...@@ -28,8 +28,6 @@ base::FilePath GetTestServerConfigFilePath() { ...@@ -28,8 +28,6 @@ base::FilePath GetTestServerConfigFilePath() {
base::FilePath dir; base::FilePath dir;
#if defined(OS_ANDROID) #if defined(OS_ANDROID)
base::PathService::Get(base::DIR_ANDROID_EXTERNAL_STORAGE, &dir); base::PathService::Get(base::DIR_ANDROID_EXTERNAL_STORAGE, &dir);
#elif defined(OS_FUCHSIA)
dir = base::FilePath("/test-shared");
#else #else
base::PathService::Get(base::DIR_TEMP, &dir); base::PathService::Get(base::DIR_TEMP, &dir);
#endif #endif
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment