Skip to content

Commit

Permalink
use dmsetup remove instead of luksClose
Browse files Browse the repository at this point in the history
test 1dfsddfddfsddffsddfds

Signed-off-by: flouthoc <flouthoc.git@gmail.com>
  • Loading branch information
flouthoc committed Feb 14, 2025
1 parent e8a8c8b commit 5d1e8f1
Show file tree
Hide file tree
Showing 3 changed files with 28 additions and 2 deletions.
Binary file modified internal/mkcw/embed/entrypoint_amd64.gz
Binary file not shown.
27 changes: 26 additions & 1 deletion tests/helpers.bash
Original file line number Diff line number Diff line change
Expand Up @@ -301,10 +301,35 @@ function rm() {
#################
#
function run_with_log() {
local expected_rc=0
local cmd="$*"
case "$1" in
[0-9]) expected_rc=$1; shift;;
[1-9][0-9]) expected_rc=$1; shift;;
[12][0-9][0-9]) expected_rc=$1; shift;;
'?') expected_rc= ; shift;; # ignore exit code
esac
echo "$_LOG_PROMPT $cmd"
run -0 "$@"
run "$@"
echo "$output"
if [ "$status" -ne 0 ]; then
echo -n "[ rc=$status ";
if [ -n "$expected_rc" ]; then
if [ "$status" -eq "$expected_rc" ]; then
echo -n "(expected) ";
else
echo -n "(** EXPECTED $expected_rc **) ";
fi
fi
echo "]"
fi
if [ -n "$expected_rc" ]; then
if [ "$status" -eq "$expected_rc" ]; then
return
else
die "exit code is $status; expected $expected_rc"
fi
fi
}

#################
Expand Down
3 changes: 2 additions & 1 deletion tests/mkcw.bats
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,8 @@ function mkcw_check_image() {
fi

# Clean up.
run_with_log umount -f -l "$TEST_SCRATCH_DIR"/mount
run_with_log umount -f "$TEST_SCRATCH_DIR"/mount
run_with_log sleep 1
run_with_log cryptsetup luksClose "$uuid"
run_buildah umount "$ctrID"
}
Expand Down

0 comments on commit 5d1e8f1

Please sign in to comment.