Skip to content

Commit

Permalink
KAFKA-18118 Fix the incorrect soft link of results/latest (#17992)
Browse files Browse the repository at this point in the history
Reviewers: Chia-Ping Tsai <[email protected]>
  • Loading branch information
Yunyung authored Dec 8, 2024
1 parent 38e727f commit 104fa57
Showing 1 changed file with 16 additions and 1 deletion.
17 changes: 16 additions & 1 deletion tests/docker/ducker-ak
Original file line number Diff line number Diff line change
Expand Up @@ -489,6 +489,18 @@ EOF
exec 3>&-
}

correct_latest_link() {
local result_dir="${kafka_dir}/results"
local latest_link="${result_dir}/latest"

# Correct the link if it's a symbolic link and broken.
if [[ -L "${latest_link}" ]] && [[ ! -e "${latest_link}" ]]; then
local latest_test_dirname=$(basename "$(readlink "${latest_link}")")
unlink "${latest_link}"
ln -s "${result_dir}/${latest_test_dirname}" "${latest_link}"
fi
}

ducker_test() {
require_commands docker
docker inspect ducker01 &>/dev/null || \
Expand Down Expand Up @@ -529,7 +541,10 @@ ducker_test() {

cmd="cd /opt/kafka-dev && ${ducktape_cmd} --cluster-file /opt/kafka-dev/tests/docker/build/cluster.json $test_names $ducktape_args"
echo "docker exec ducker01 bash -c \"${cmd}\""
exec docker exec --user=ducker ducker01 bash -c "${cmd}"
docker exec --user=ducker ducker01 bash -c "${cmd}"
docker_status=$?
correct_latest_link
exit "${docker_status}"
}

ducker_ssh() {
Expand Down

0 comments on commit 104fa57

Please sign in to comment.