From 5d1e8f1e31bc57e07d05806de0ca737525a127c2 Mon Sep 17 00:00:00 2001 From: flouthoc Date: Thu, 13 Feb 2025 13:25:48 -0800 Subject: [PATCH] use dmsetup remove instead of luksClose test 1dfsddfddfsddffsddfds Signed-off-by: flouthoc --- internal/mkcw/embed/entrypoint_amd64.gz | Bin 310 -> 375 bytes tests/helpers.bash | 27 +++++++++++++++++++++++- tests/mkcw.bats | 3 ++- 3 files changed, 28 insertions(+), 2 deletions(-) diff --git a/internal/mkcw/embed/entrypoint_amd64.gz b/internal/mkcw/embed/entrypoint_amd64.gz index fc658bf8c603f5055c775d1e67aaa298e42ff8a7..953670818fe136267f5a1624e4298358495fb743 100755 GIT binary patch literal 375 zcmV--0f_z|iwFP!000021MQkYO2a@DhF@Z%MHki^%)+G%!IcY&$+@sW+c zvPFuH9Z{g~0X0l+K+8lc%3HLeWVNbmR0Fpzi&k`O!%kgYV@+LX!%mx4uV*U$N!^vM z+obQ)A^-pY000000O0S@o=!X?Q{TvYsDFst)3*!lb^|?oJfHQ9$M*sN000000002~ zBUMkF(Y%L$etAnCd6O#UP6YThf744#mOh9?GChc8nI@TxnaWvLvSO4mQ8K~q^6Wm1 zWu{UwV2^pxALJrtqcY7BHb}dDoyfO|c-bpep+uLsl23|wmMh7VY{Z8}K9q%eCSK&R zP~zA7+_8ID^z!Zb2G_9XwS2GU_w==8zK3OTeqb(PEx%dw`*zJk>qB?$z}9!Zc>c0( Ve6p{xtv^`v{vQyN#K-6%007vKwlx3% literal 310 zcmV-60m=R!iwFP!000021MS)|PJ}=d2H*$FT4*7bcJBlfRu;z4Xf~0?#0v}#!ekK= zW;WV+HDe(s@gA}RLs+s#3meV<75u!%3^So4@N$)0`<_RRPnTq?Ft&9(^a~z`biH#5 zx??~KJ2s%Hcqe(dwMz>7*p|yl?bdS{4Q-dxd3HUwAC7l28QRHg-tC8x2lR6x0RR91 z0002|AFKA&v(frC-nTE(tM=`ttB#l5)r&8A|ZS@3;bJt&z~Mv0Q2>SkTmLh?qdD(6zA>uz9lNEGQpo5qNgB9lEE zikeyqBYtC_N7R4&AHU&`{|odH&BlAP`ef*xxyJb4Kp)8$^QXDkv#(^BfBMb(p8=SL If@mQC06G+ssQ>@~ diff --git a/tests/helpers.bash b/tests/helpers.bash index 9e2097c9c39..59f7d0ce641 100644 --- a/tests/helpers.bash +++ b/tests/helpers.bash @@ -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 } ################# diff --git a/tests/mkcw.bats b/tests/mkcw.bats index b4533d86cf4..0c714e85b5d 100644 --- a/tests/mkcw.bats +++ b/tests/mkcw.bats @@ -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" }