From 7c8a34eceb40043bc5a09990b668e67235a5e81b Mon Sep 17 00:00:00 2001 From: Christoph Klaffl Date: Fri, 5 Apr 2024 15:20:28 +0200 Subject: [PATCH 1/2] * proper order of tests * timing fixes for fast NVME pools * skip invasive tests by default --- tests/run-tests.sh | 5 ++++- .../run.sh | 0 .../run.sh | 0 tests/syncoid/{3_force_delete => 003_force_delete}/run.sh | 0 .../run.sh | 0 .../run.sh | 2 ++ .../run.sh | 2 ++ .../run.sh | 0 .../run.sh | 0 .../run.sh | 0 .../syncoid/{10_filter_snaps => 010_filter_snaps}/run.sh | 0 .../run.sh | 8 ++++++-- tests/syncoid/run-tests.sh | 5 ++++- 13 files changed, 18 insertions(+), 4 deletions(-) rename tests/syncoid/{1_bookmark_replication_intermediate => 001_bookmark_replication_intermediate}/run.sh (100%) rename tests/syncoid/{2_bookmark_replication_no_intermediate => 002_bookmark_replication_no_intermediate}/run.sh (100%) rename tests/syncoid/{3_force_delete => 003_force_delete}/run.sh (100%) rename tests/syncoid/{4_bookmark_replication_edge_case => 004_bookmark_replication_edge_case}/run.sh (100%) rename tests/syncoid/{5_reset_resume_state => 005_reset_resume_state}/run.sh (99%) rename tests/syncoid/{6_reset_resume_state2 => 006_reset_resume_state2}/run.sh (99%) rename tests/syncoid/{7_preserve_recordsize => 007_preserve_recordsize}/run.sh (100%) rename tests/syncoid/{8_force_delete_snapshot => 008_force_delete_snapshot}/run.sh (100%) rename tests/syncoid/{9_preserve_properties => 009_preserve_properties}/run.sh (100%) rename tests/syncoid/{10_filter_snaps => 010_filter_snaps}/run.sh (100%) rename tests/syncoid/{815_sync_out-of-order_snapshots => 011_sync_out-of-order_snapshots}/run.sh (91%) diff --git a/tests/run-tests.sh b/tests/run-tests.sh index 418657c..ec14721 100755 --- a/tests/run-tests.sh +++ b/tests/run-tests.sh @@ -17,8 +17,11 @@ for test in $(find . -mindepth 1 -maxdepth 1 -type d -printf "%P\n" | sort -g); cd "${test}" echo -n y | bash run.sh > "${LOGFILE}" 2>&1 - if [ $? -eq 0 ]; then + ret=$? + if [ $ret -eq 0 ]; then echo "[PASS]" + elif [ $ret -eq 130 ]; then + echo "[SKIPPED]" else echo "[FAILED] (see ${LOGFILE})" fi diff --git a/tests/syncoid/1_bookmark_replication_intermediate/run.sh b/tests/syncoid/001_bookmark_replication_intermediate/run.sh similarity index 100% rename from tests/syncoid/1_bookmark_replication_intermediate/run.sh rename to tests/syncoid/001_bookmark_replication_intermediate/run.sh diff --git a/tests/syncoid/2_bookmark_replication_no_intermediate/run.sh b/tests/syncoid/002_bookmark_replication_no_intermediate/run.sh similarity index 100% rename from tests/syncoid/2_bookmark_replication_no_intermediate/run.sh rename to tests/syncoid/002_bookmark_replication_no_intermediate/run.sh diff --git a/tests/syncoid/3_force_delete/run.sh b/tests/syncoid/003_force_delete/run.sh similarity index 100% rename from tests/syncoid/3_force_delete/run.sh rename to tests/syncoid/003_force_delete/run.sh diff --git a/tests/syncoid/4_bookmark_replication_edge_case/run.sh b/tests/syncoid/004_bookmark_replication_edge_case/run.sh similarity index 100% rename from tests/syncoid/4_bookmark_replication_edge_case/run.sh rename to tests/syncoid/004_bookmark_replication_edge_case/run.sh diff --git a/tests/syncoid/5_reset_resume_state/run.sh b/tests/syncoid/005_reset_resume_state/run.sh similarity index 99% rename from tests/syncoid/5_reset_resume_state/run.sh rename to tests/syncoid/005_reset_resume_state/run.sh index 43ec78f..4eb4af6 100755 --- a/tests/syncoid/5_reset_resume_state/run.sh +++ b/tests/syncoid/005_reset_resume_state/run.sh @@ -28,6 +28,8 @@ zfs create -o mountpoint="${MOUNT_TARGET}" "${POOL_NAME}"/src dd if=/dev/urandom of="${MOUNT_TARGET}"/big_file bs=1M count=200 +sleep 1 + ../../../syncoid --debug --compress=none --source-bwlimit=2m "${POOL_NAME}"/src "${POOL_NAME}"/dst & syncoid_pid=$! sleep 5 diff --git a/tests/syncoid/6_reset_resume_state2/run.sh b/tests/syncoid/006_reset_resume_state2/run.sh similarity index 99% rename from tests/syncoid/6_reset_resume_state2/run.sh rename to tests/syncoid/006_reset_resume_state2/run.sh index d05696b..c568fd4 100755 --- a/tests/syncoid/6_reset_resume_state2/run.sh +++ b/tests/syncoid/006_reset_resume_state2/run.sh @@ -28,6 +28,8 @@ zfs create -o mountpoint="${MOUNT_TARGET}" "${POOL_NAME}"/src dd if=/dev/urandom of="${MOUNT_TARGET}"/big_file bs=1M count=200 +sleep 1 + zfs snapshot "${POOL_NAME}"/src@big ../../../syncoid --debug --no-sync-snap --compress=none --source-bwlimit=2m "${POOL_NAME}"/src "${POOL_NAME}"/dst & syncoid_pid=$! diff --git a/tests/syncoid/7_preserve_recordsize/run.sh b/tests/syncoid/007_preserve_recordsize/run.sh similarity index 100% rename from tests/syncoid/7_preserve_recordsize/run.sh rename to tests/syncoid/007_preserve_recordsize/run.sh diff --git a/tests/syncoid/8_force_delete_snapshot/run.sh b/tests/syncoid/008_force_delete_snapshot/run.sh similarity index 100% rename from tests/syncoid/8_force_delete_snapshot/run.sh rename to tests/syncoid/008_force_delete_snapshot/run.sh diff --git a/tests/syncoid/9_preserve_properties/run.sh b/tests/syncoid/009_preserve_properties/run.sh similarity index 100% rename from tests/syncoid/9_preserve_properties/run.sh rename to tests/syncoid/009_preserve_properties/run.sh diff --git a/tests/syncoid/10_filter_snaps/run.sh b/tests/syncoid/010_filter_snaps/run.sh similarity index 100% rename from tests/syncoid/10_filter_snaps/run.sh rename to tests/syncoid/010_filter_snaps/run.sh diff --git a/tests/syncoid/815_sync_out-of-order_snapshots/run.sh b/tests/syncoid/011_sync_out-of-order_snapshots/run.sh similarity index 91% rename from tests/syncoid/815_sync_out-of-order_snapshots/run.sh rename to tests/syncoid/011_sync_out-of-order_snapshots/run.sh index af67b36..af87979 100755 --- a/tests/syncoid/815_sync_out-of-order_snapshots/run.sh +++ b/tests/syncoid/011_sync_out-of-order_snapshots/run.sh @@ -7,9 +7,13 @@ set -e . ../../common/lib.sh -POOL_IMAGE="/tmp/jimsalterjrs_sanoid_815.img" +if [ -z "$ALLOW_INVASIVE_TESTS" ]; then + exit 130 +fi +exit 0 +POOL_IMAGE="/tmp/syncoid-test-11.zpool" POOL_SIZE="64M" -POOL_NAME="jimsalterjrs_sanoid_815" +POOL_NAME="syncoid-test-11" truncate -s "${POOL_SIZE}" "${POOL_IMAGE}" diff --git a/tests/syncoid/run-tests.sh b/tests/syncoid/run-tests.sh index 5564667..8307413 100755 --- a/tests/syncoid/run-tests.sh +++ b/tests/syncoid/run-tests.sh @@ -17,8 +17,11 @@ for test in $(find . -mindepth 1 -maxdepth 1 -type d -printf "%P\n" | sort -g); cd "${test}" echo | bash run.sh > "${LOGFILE}" 2>&1 - if [ $? -eq 0 ]; then + ret=$? + if [ $ret -eq 0 ]; then echo "[PASS]" + elif [ $ret -eq 130 ]; then + echo "[SKIPPED]" else echo "[FAILED] (see ${LOGFILE})" fi From 4e86733c1a618b2084046a0950a7bbf2bf6b88e9 Mon Sep 17 00:00:00 2001 From: Christoph Klaffl Date: Fri, 5 Apr 2024 15:22:13 +0200 Subject: [PATCH 2/2] missed debug statement --- tests/syncoid/011_sync_out-of-order_snapshots/run.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tests/syncoid/011_sync_out-of-order_snapshots/run.sh b/tests/syncoid/011_sync_out-of-order_snapshots/run.sh index af87979..bb96ad0 100755 --- a/tests/syncoid/011_sync_out-of-order_snapshots/run.sh +++ b/tests/syncoid/011_sync_out-of-order_snapshots/run.sh @@ -10,7 +10,7 @@ set -e if [ -z "$ALLOW_INVASIVE_TESTS" ]; then exit 130 fi -exit 0 + POOL_IMAGE="/tmp/syncoid-test-11.zpool" POOL_SIZE="64M" POOL_NAME="syncoid-test-11"