From 64264d436321f2dc2ae9b55f9a3984366b9d366e Mon Sep 17 00:00:00 2001 From: Patrick Roy Date: Thu, 12 Sep 2024 12:00:02 +0100 Subject: [PATCH] chore: fix permission on test_results directory test_results contains files from failed tests from debugging, but the directory is created inside of a privileged docker container. Thus after finishing a test run, fix up the permissions so that it can easily be dealt with. Signed-off-by: Patrick Roy --- tools/devtool | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) diff --git a/tools/devtool b/tools/devtool index 4ac3f2f98821..48cc4fbc5dcd 100755 --- a/tools/devtool +++ b/tools/devtool @@ -110,6 +110,7 @@ CTR_FC_ROOT_DIR="/firecracker" # Full path to the build dir, as bind-mounted in the container. CTR_FC_BUILD_DIR="${CTR_FC_ROOT_DIR}/build" +CTR_TEST_RESULTS_DIR="${CTR_FC_ROOT_DIR}/test_results" # Full path to the cargo target dir, as bind-mounted in the container. CTR_CARGO_TARGET_DIR="$CTR_FC_BUILD_DIR/cargo_target" @@ -227,10 +228,12 @@ build_bin_path() { cmd_fix_perms() { # Yes, running Docker to get elevated privileges, just to chown some files # is a dirty hack. - run_devctr \ - --workdir "$CTR_FC_ROOT_DIR" \ - -- \ - chown -R "$(id -u):$(id -g)" "$CTR_FC_BUILD_DIR" + for dir in "$CTR_FC_BUILD_DIR" "$CTR_TEST_RESULTS_DIR"; do + run_devctr \ + --workdir "$CTR_FC_ROOT_DIR" \ + -- \ + chown -R "$(id -u):$(id -g)" "$dir" + done } # Builds the development container from its Dockerfile.