Skip to content

Commit

Permalink
chore: fix permission on test_results directory
Browse files Browse the repository at this point in the history
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 <[email protected]>
  • Loading branch information
roypat committed Sep 13, 2024
1 parent 4d0d3a5 commit 64264d4
Showing 1 changed file with 7 additions and 4 deletions.
11 changes: 7 additions & 4 deletions tools/devtool
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand Down Expand Up @@ -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.
Expand Down

0 comments on commit 64264d4

Please sign in to comment.