From ecbd4fbe30c8d618b3b23d8c0468eeefd130f9f7 Mon Sep 17 00:00:00 2001 From: Slawomir Jankowski Date: Mon, 7 Dec 2020 16:58:45 +0100 Subject: [PATCH] Update smoke tests Signed-off-by: Slawomir Jankowski --- test/smoke_test/basic/02 | 6 ++--- test/smoke_test/basic/03 | 20 ++++++++--------- test/smoke_test/basic/04 | 20 ++++++++--------- test/smoke_test/basic/05 | 4 ++-- test/smoke_test/basic/06 | 19 ++++++---------- test/smoke_test/basic/08 | 12 +++++----- test/smoke_test/basic/11 | 8 +++---- test/smoke_test/basic/12 | 16 +++++++------- test/smoke_test/basic/13 | 16 +++++++------- test/smoke_test/cache_suspend/02 | 34 ++++++++++++++--------------- test/smoke_test/cache_suspend/03 | 20 ++++++++--------- test/smoke_test/eviction_policy/01 | 4 ++-- test/smoke_test/eviction_policy/02 | 8 +++---- test/smoke_test/eviction_policy/03 | 8 +++---- test/smoke_test/fio/01 | 4 ++-- test/smoke_test/incremental_load/01 | 26 +++++++++++----------- test/smoke_test/incremental_load/02 | 30 ++++++++++++------------- test/smoke_test/init_script/01 | 14 +++++------- test/smoke_test/init_script/02 | 12 +++++----- test/smoke_test/init_script/03 | 14 ++++++------ test/smoke_test/io_class/01_wlth | 4 ++-- test/smoke_test/io_class/02_wlth | 4 ++-- test/smoke_test/metadata_corrupt/01 | 8 +++---- test/smoke_test/metadata_corrupt/02 | 6 ++--- test/smoke_test/promotion/01 | 4 ++-- test/smoke_test/recovery/01 | 19 ++++++++-------- test/smoke_test/recovery/02 | 17 ++++++++------- test/smoke_test/write_back/01 | 6 ++--- 28 files changed, 179 insertions(+), 184 deletions(-) diff --git a/test/smoke_test/basic/02 b/test/smoke_test/basic/02 index 746dd16..c89623c 100755 --- a/test/smoke_test/basic/02 +++ b/test/smoke_test/basic/02 @@ -28,13 +28,13 @@ TARGET_DEVICE_OPTION="$CACHE_DEVICE" remove_partitions TARGET_DEVICE_OPTION="$CACHE_DEVICE" PARTITION_SIZE_OPTION="2000M" PARTITION_IDS_OPTION="1" make_primary_partitions # Start cache with ID=1 on device ${CACHE_DEVICE}1 (/dev/sda1, for instance) -CACHE_ID_OPTION="1" CACHE_DEVICE_OPTION="${CACHE_DEVICE}1" start_cache +CACHE_ID_OPTION="1" CACHE_DEVICE_OPTION="${CACHE_DEVICE}-part1" start_cache # Use the same device but a different ID - negative test -CACHE_ID_OPTION="2" CACHE_DEVICE_OPTION="${CACHE_DEVICE}1" NEGATIVE_TEST_OPTION="1" start_cache +CACHE_ID_OPTION="2" CACHE_DEVICE_OPTION="${CACHE_DEVICE}-part1" NEGATIVE_TEST_OPTION="1" start_cache # Use the same ID but a different device - another negative test -CACHE_ID_OPTION="1" CACHE_DEVICE_OPTION="${CACHE_DEVICE}2" NEGATIVE_TEST_OPTION="1" start_cache +CACHE_ID_OPTION="1" CACHE_DEVICE_OPTION="${CACHE_DEVICE}-part2" NEGATIVE_TEST_OPTION="1" start_cache # Clear up after test CACHE_ID_OPTION="1" stop_cache diff --git a/test/smoke_test/basic/03 b/test/smoke_test/basic/03 index 5c1358c..6417b78 100755 --- a/test/smoke_test/basic/03 +++ b/test/smoke_test/basic/03 @@ -31,22 +31,22 @@ TARGET_DEVICE_OPTION="$CACHE_DEVICE" PARTITION_SIZE_OPTION="2000M" PARTITION_IDS TARGET_DEVICE_OPTION="$CORE_DEVICE" PARTITION_SIZE_OPTION="4000M" PARTITION_IDS_OPTION="1 2" make_primary_partitions # Start cache on CACHE_DEVICE1 (/dev/sdd1, for example) with ID=1 and add a core device using CORE_DEVICE1 (/dev/sde1, for example) -CACHE_ID_OPTION="1" CACHE_DEVICE_OPTION="${CACHE_DEVICE}1" start_cache -CACHE_ID_OPTION="1" CORE_DEVICE_OPTION="${CORE_DEVICE}1" add_core +CACHE_ID_OPTION="1" CACHE_DEVICE_OPTION="${CACHE_DEVICE}-part1" start_cache +CACHE_ID_OPTION="1" CORE_DEVICE_OPTION="${CORE_DEVICE}-part1" add_core # Start cache on CACHE_DEVICE2 (/dev/sdd2, for example) with ID=2 and add a core device using CORE_DEVICE1 (/dev/sde2, for example) -CACHE_ID_OPTION="2" CACHE_DEVICE_OPTION="${CACHE_DEVICE}2" start_cache -CACHE_ID_OPTION="2" CORE_DEVICE_OPTION="${CORE_DEVICE}2" add_core +CACHE_ID_OPTION="2" CACHE_DEVICE_OPTION="${CACHE_DEVICE}-part2" start_cache +CACHE_ID_OPTION="2" CORE_DEVICE_OPTION="${CORE_DEVICE}-part2" add_core # Try to add already taken CORE device and a non-existing core to cache 1 -NEGATIVE_TEST_OPTION="1" CACHE_ID_OPTION="1" CORE_DEVICE_OPTION="${CORE_DEVICE}1" add_core -NEGATIVE_TEST_OPTION="1" CACHE_ID_OPTION="1" CORE_DEVICE_OPTION="${CORE_DEVICE}2" add_core -NEGATIVE_TEST_OPTION="1" CACHE_ID_OPTION="1" CORE_DEVICE_OPTION="${CORE_DEVICE}3" add_core +NEGATIVE_TEST_OPTION="1" CACHE_ID_OPTION="1" CORE_DEVICE_OPTION="${CORE_DEVICE}-part1" add_core +NEGATIVE_TEST_OPTION="1" CACHE_ID_OPTION="1" CORE_DEVICE_OPTION="${CORE_DEVICE}-part2" add_core +NEGATIVE_TEST_OPTION="1" CACHE_ID_OPTION="1" CORE_DEVICE_OPTION="${CORE_DEVICE}-part3" add_core # Try to add already taken CORE device and a non-existing core to cache 2 -NEGATIVE_TEST_OPTION="1" CACHE_ID_OPTION="2" CORE_DEVICE_OPTION="${CORE_DEVICE}1" add_core -NEGATIVE_TEST_OPTION="1" CACHE_ID_OPTION="2" CORE_DEVICE_OPTION="${CORE_DEVICE}2" add_core -NEGATIVE_TEST_OPTION="1" CACHE_ID_OPTION="2" CORE_DEVICE_OPTION="${CORE_DEVICE}3" add_core +NEGATIVE_TEST_OPTION="1" CACHE_ID_OPTION="2" CORE_DEVICE_OPTION="${CORE_DEVICE}-part1" add_core +NEGATIVE_TEST_OPTION="1" CACHE_ID_OPTION="2" CORE_DEVICE_OPTION="${CORE_DEVICE}-part2" add_core +NEGATIVE_TEST_OPTION="1" CACHE_ID_OPTION="2" CORE_DEVICE_OPTION="${CORE_DEVICE}-part3" add_core # Remove the core device from cache CACHE_ID_OPTION="1" CORE_ID_OPTION="1" remove_core diff --git a/test/smoke_test/basic/04 b/test/smoke_test/basic/04 index dcc5d78..71c6a63 100755 --- a/test/smoke_test/basic/04 +++ b/test/smoke_test/basic/04 @@ -28,21 +28,21 @@ TARGET_DEVICE_OPTION="$CORE_DEVICE" remove_partitions TARGET_DEVICE_OPTION="$CACHE_DEVICE" PARTITION_SIZE_OPTION="2000M" PARTITION_IDS_OPTION="1 2 3" make_primary_partitions # Create 3 primary partitions on CORE_DEVICE, each of 4000M size TARGET_DEVICE_OPTION="$CORE_DEVICE" PARTITION_SIZE_OPTION="4000M" PARTITION_IDS_OPTION="1 2 3" make_primary_partitions -run_cmd dd if=/dev/zero of="${CORE_DEVICE}1" bs=1M count=1 oflag=direct -run_cmd dd if=/dev/zero of="${CORE_DEVICE}2" bs=1M count=1 oflag=direct -run_cmd dd if=/dev/zero of="${CORE_DEVICE}3" bs=1M count=1 oflag=direct +run_cmd dd if=/dev/zero of="${CORE_DEVICE}-part1" bs=1M count=1 oflag=direct +run_cmd dd if=/dev/zero of="${CORE_DEVICE}-part2" bs=1M count=1 oflag=direct +run_cmd dd if=/dev/zero of="${CORE_DEVICE}-part3" bs=1M count=1 oflag=direct # Start cache on CACHE_DEVICE1 (/dev/sdd1, for example) with ID=1 and add a core device using CORE_DEVICE1 (/dev/sde1, for example) -CACHE_ID_OPTION="1" CACHE_DEVICE_OPTION="${CACHE_DEVICE}1" start_cache -CACHE_ID_OPTION="1" CORE_DEVICE_OPTION="${CORE_DEVICE}1" add_core +CACHE_ID_OPTION="1" CACHE_DEVICE_OPTION="${CACHE_DEVICE}-part1" start_cache +CACHE_ID_OPTION="1" CORE_DEVICE_OPTION="${CORE_DEVICE}-part1" add_core # Start cache on CACHE_DEVICE2 (/dev/sdd2, for example) with ID=2 and add a core device using CORE_DEVICE2 (/dev/sde2, for example) -CACHE_ID_OPTION="2" CACHE_DEVICE_OPTION="${CACHE_DEVICE}2" start_cache -CACHE_ID_OPTION="2" CORE_DEVICE_OPTION="${CORE_DEVICE}2" add_core +CACHE_ID_OPTION="2" CACHE_DEVICE_OPTION="${CACHE_DEVICE}-part2" start_cache +CACHE_ID_OPTION="2" CORE_DEVICE_OPTION="${CORE_DEVICE}-part2" add_core # Start cache on CACHE_DEVICE3 (/dev/sdd3, for example) with ID=3 and add a core device using CORE_DEVICE3 (/dev/sde3, for example) -CACHE_ID_OPTION="3" CACHE_DEVICE_OPTION="${CACHE_DEVICE}3" start_cache -CACHE_ID_OPTION="3" CORE_DEVICE_OPTION="${CORE_DEVICE}3" add_core +CACHE_ID_OPTION="3" CACHE_DEVICE_OPTION="${CACHE_DEVICE}-part3" start_cache +CACHE_ID_OPTION="3" CORE_DEVICE_OPTION="${CORE_DEVICE}-part3" add_core # Create filesystems on cached devices - we do this using run_cmd because it is not in the API (and probably won't be). # The test framework will accept invoking the commands directly (e.g. "mkfs.ext3 [...]" without the "run_cmd"), but the @@ -68,7 +68,7 @@ done for ID in 1 2 3 ; do run_cmd "umount ${MOUNTPOINT}-${ID}-1" CACHE_ID_OPTION="$ID" stop_cache - run_cmd "mount ${CORE_DEVICE}${ID} ${MOUNTPOINT}-${ID}-1" + run_cmd "mount ${CORE_DEVICE}-part${ID} ${MOUNTPOINT}-${ID}-1" done # Now check for files' presence and umount core devices diff --git a/test/smoke_test/basic/05 b/test/smoke_test/basic/05 index 006b27a..8401b9e 100755 --- a/test/smoke_test/basic/05 +++ b/test/smoke_test/basic/05 @@ -31,7 +31,7 @@ TARGET_DEVICE_OPTION="$CACHE_DEVICE" PARTITION_SIZE_OPTION="2000M" PARTITION_IDS # Try to start positive caches in loop and later stop them - if any of those operations fails, it # means the cache ID is invalid for ID in $POSITIVE_IDS ; do - CACHE_ID_OPTION="$ID" CACHE_DEVICE_OPTION="${CACHE_DEVICE}1" CACHE_FORCE_OPTION="yes" start_cache + CACHE_ID_OPTION="$ID" CACHE_DEVICE_OPTION="${CACHE_DEVICE}-part1" CACHE_FORCE_OPTION="yes" start_cache CACHE_ID_OPTION="$ID" stop_cache done @@ -41,7 +41,7 @@ done # automatically. for ID in $NEGATIVE_IDS ; do NEGATIVE_TEST_OPTION="1" CACHE_ID_OPTION="$ID" - CACHE_DEVICE_OPTION="${CACHE_DEVICE}1" CACHE_FORCE_OPTION="yes" start_cache + CACHE_DEVICE_OPTION="${CACHE_DEVICE}-part1" CACHE_FORCE_OPTION="yes" start_cache done # Always return 0 at the end of the test - if at any point something has failed diff --git a/test/smoke_test/basic/06 b/test/smoke_test/basic/06 index af82515..d03733a 100755 --- a/test/smoke_test/basic/06 +++ b/test/smoke_test/basic/06 @@ -4,7 +4,7 @@ # SPDX-License-Identifier: BSD-3-Clause-Clear # -#DESCRIPTION --set-param option fuzzing. +# DESCRIPTION --set-param option fuzzing. # This tests checks whether CLI accepts correct data and rejects incorrect # data for "--flush-parameters" option. It tries to invoke CLI using different @@ -22,15 +22,9 @@ TARGET_DEVICE_OPTION="$CORE_DEVICE" remove_partitions TARGET_DEVICE_OPTION="$CACHE_DEVICE" PARTITION_SIZE_OPTION="2000M" PARTITION_IDS_OPTION="1" make_primary_partitions # create cache in WT mode and try to change flush-parameters -CACHE_MODE_OPTION="wt" CACHE_ID_OPTION="1" CACHE_DEVICE_OPTION="${CACHE_DEVICE}1" CACHE_FORCE_OPTION="1" start_cache +CACHE_MODE_OPTION="wt" CACHE_ID_OPTION="1" CACHE_DEVICE_OPTION="${CACHE_DEVICE}-part1" CACHE_FORCE_OPTION="1" start_cache -# changing flush parameters should be prohibited while core is added to cache CACHE_ID_OPTION="1" CORE_DEVICE_OPTION="$CORE_DEVICE" add_core -CACHE_ID_OPTION="1" CLEAN_POL_NS_OPTION="cleaning-alru" WAKE_UP_OPTION="100" STALE_TIME_OPTION="50" FLUSH_BUFFERS_OPTION="100" ACTIVITY_THRESH_OPTION="5" NEGATIVE_TEST_OPTION="1" set_flush_params - -# remove core -sleep 1 -CACHE_ID_OPTION="1" CORE_ID_OPTION="1" remove_core printf "\n============Running negative tests============\n" @@ -45,8 +39,8 @@ CACHE_ID_OPTION="1" CLEAN_POL_NS_OPTION="cleaning-alru" WAKE_UP_OPTION="100" STA CACHE_ID_OPTION="1" CLEAN_POL_NS_OPTION="cleaning-alru" WAKE_UP_OPTION="100" STALE_TIME_OPTION="50" FLUSH_BUFFERS_OPTION="-1" ACTIVITY_THRESH_OPTION="5" NEGATIVE_TEST_OPTION="1" set_flush_params CACHE_ID_OPTION="1" CLEAN_POL_NS_OPTION="cleaning-alru" WAKE_UP_OPTION="100" STALE_TIME_OPTION="50" FLUSH_BUFFERS_OPTION="100" ACTIVITY_THRESH_OPTION="-1" NEGATIVE_TEST_OPTION="1" set_flush_params -# test for 0 wake_up_time and 0 flush buffers -CACHE_ID_OPTION="1" CLEAN_POL_NS_OPTION="cleaning-alru" WAKE_UP_OPTION="0" STALE_TIME_OPTION="50" FLUSH_BUFFERS_OPTION="100" ACTIVITY_THRESH_OPTION="5" NEGATIVE_TEST_OPTION="1" set_flush_params +# test for 0 staleness-time and 0 flush buffers +CACHE_ID_OPTION="1" CLEAN_POL_NS_OPTION="cleaning-alru" WAKE_UP_OPTION="100" STALE_TIME_OPTION="0" FLUSH_BUFFERS_OPTION="100" ACTIVITY_THRESH_OPTION="5" NEGATIVE_TEST_OPTION="1" set_flush_params CACHE_ID_OPTION="1" CLEAN_POL_NS_OPTION="cleaning-alru" WAKE_UP_OPTION="100" STALE_TIME_OPTION="50" FLUSH_BUFFERS_OPTION="0" ACTIVITY_THRESH_OPTION="5" NEGATIVE_TEST_OPTION="1" set_flush_params printf "\n============Running positive tests============\n" @@ -58,9 +52,10 @@ CACHE_ID_OPTION="1" CLEAN_POL_OPTION="acp" set_cleaning_policy CACHE_ID_OPTION="1" CLEAN_POL_OPTION="alru" set_cleaning_policy CACHE_ID_OPTION="1" CLEAN_POL_NS_OPTION="cleaning-alru" WAKE_UP_OPTION="100" STALE_TIME_OPTION="1" FLUSH_BUFFERS_OPTION="100" ACTIVITY_THRESH_OPTION="500" set_flush_params -CACHE_ID_OPTION="1" CLEAN_POL_NS_OPTION="cleaning-alru" WAKE_UP_OPTION="100" STALE_TIME_OPTION="50" FLUSH_BUFFERS_OPTION="100" ACTIVITY_THRESH_OPTION="500" set_flush_params +CACHE_ID_OPTION="1" CLEAN_POL_NS_OPTION="cleaning-alru" WAKE_UP_OPTION="100" STALE_TIME_OPTION="50" FLUSH_BUFFERS_OPTION="100" ACTIVITY_THRESH_OPTION="0" set_flush_params +CACHE_ID_OPTION="1" CLEAN_POL_NS_OPTION="cleaning-alru" WAKE_UP_OPTION="0" STALE_TIME_OPTION="50" FLUSH_BUFFERS_OPTION="100" ACTIVITY_THRESH_OPTION="500" set_flush_params -CACHE_ID_OPTION="1" CLEAN_POL_NS_OPTION="cleaning-alru" WAKE_UP_OPTION="100" STALE_TIME_OPTION="50" FLUSH_BUFFERS_OPTION="100" ACTIVITY_THRESH_OPTION="500" set_flush_params +CACHE_ID_OPTION="1" CLEAN_POL_NS_OPTION="cleaning-alru" WAKE_UP_OPTION="100" STALE_TIME_OPTION="50" FLUSH_BUFFERS_OPTION="1" ACTIVITY_THRESH_OPTION="500" set_flush_params # stop cache now CACHE_ID_OPTION="1" stop_cache diff --git a/test/smoke_test/basic/08 b/test/smoke_test/basic/08 index 75c714b..77bfd43 100755 --- a/test/smoke_test/basic/08 +++ b/test/smoke_test/basic/08 @@ -42,14 +42,14 @@ do echo "------Start CAS Linux in $mode mode" # This is where the real test starts - CACHE_ID_OPTION="1" CACHE_DEVICE_OPTION="${CACHE_DEVICE}"1 CACHE_MODE_OPTION="$mode" + CACHE_ID_OPTION="1" CACHE_DEVICE_OPTION="${CACHE_DEVICE}"-part1 CACHE_MODE_OPTION="$mode" CACHE_FORCE_OPTION="yes" start_cache - CACHE_ID_OPTION="1" CORE_DEVICE_OPTION="${CORE_DEVICE}"1 add_core + CACHE_ID_OPTION="1" CORE_DEVICE_OPTION="${CORE_DEVICE}"-part1 add_core sleep 2 # iostat read - TMP_CACHE_DEVICE=$(echo "${CACHE_DEVICE}" | cut -c6-) + TMP_CACHE_DEVICE=$(echo "$(realpath ${CACHE_DEVICE})" | cut -c6-) run_cmd "dd if=/dev/cas1-1 of=$TMP_DIR/file001.bin bs=$BLOCK_SIZE count=$COUNT skip=10000 iflag=direct" READ_CACHE_1=$(iostat "${CACHE_DEVICE}" | grep $TMP_CACHE_DEVICE | awk 'NR==1 {print $5}') run_cmd "dd if=/dev/cas1-1 of=$TMP_DIR/file001.bin bs=$BLOCK_SIZE count=$COUNT skip=10000 iflag=direct" @@ -74,14 +74,14 @@ do echo "------Start CAS Linux in $mode mode" # This is where the real test starts - CACHE_ID_OPTION="1" CACHE_DEVICE_OPTION="${CACHE_DEVICE}"1 CACHE_MODE_OPTION="$mode" + CACHE_ID_OPTION="1" CACHE_DEVICE_OPTION="${CACHE_DEVICE}"-part1 CACHE_MODE_OPTION="$mode" CACHE_FORCE_OPTION="yes" start_cache - CACHE_ID_OPTION="1" CORE_DEVICE_OPTION="${CORE_DEVICE}"1 add_core + CACHE_ID_OPTION="1" CORE_DEVICE_OPTION="${CORE_DEVICE}"-part1 add_core sleep 2 # iostat write and write - TMP_CORE_DEVICE=$(echo "${CORE_DEVICE}" | cut -c6-) + TMP_CORE_DEVICE=$(echo "$(realpath ${CORE_DEVICE})" | cut -c6-) WRITE_CORE_0=$(iostat "${CORE_DEVICE}" | grep $TMP_CORE_DEVICE | awk 'NR==1 {print $6}') WRITE_CACHE_0=$(iostat "${CACHE_DEVICE}" | grep $TMP_CACHE_DEVICE | awk 'NR==1 {print $6}') run_cmd "dd if=$TMP_DIR/file001.bin of=/dev/cas1-1 bs=$BLOCK_SIZE count=$COUNT seek=20000 oflag=direct" diff --git a/test/smoke_test/basic/11 b/test/smoke_test/basic/11 index 6004d9a..144ca43 100755 --- a/test/smoke_test/basic/11 +++ b/test/smoke_test/basic/11 @@ -28,12 +28,12 @@ TARGET_DEVICE_OPTION="$CACHE_DEVICE" PARTITION_SIZE_OPTION="2000M" PARTITION_IDS TARGET_DEVICE_OPTION="$CORE_DEVICE" PARTITION_SIZE_OPTION="4000M" PARTITION_IDS_OPTION="1" make_primary_partitions # Start caches -CACHE_ID_OPTION="1" CACHE_DEVICE_OPTION="${CACHE_DEVICE}1" start_cache -CACHE_ID_OPTION="2" CACHE_DEVICE_OPTION="${CACHE_DEVICE}2" start_cache -CACHE_ID_OPTION="3" CACHE_DEVICE_OPTION="${CACHE_DEVICE}3" start_cache +CACHE_ID_OPTION="1" CACHE_DEVICE_OPTION="${CACHE_DEVICE}-part1" start_cache +CACHE_ID_OPTION="2" CACHE_DEVICE_OPTION="${CACHE_DEVICE}-part2" start_cache +CACHE_ID_OPTION="3" CACHE_DEVICE_OPTION="${CACHE_DEVICE}-part3" start_cache #Assembly multi-level cache (add cores) -CACHE_ID_OPTION="1" CORE_DEVICE_OPTION="${CORE_DEVICE}1" add_core +CACHE_ID_OPTION="1" CORE_DEVICE_OPTION="${CORE_DEVICE}-part1" add_core CACHE_ID_OPTION="2" CORE_DEVICE_OPTION="${DEVICE_NAME}1-1" add_core CACHE_ID_OPTION="3" CORE_DEVICE_OPTION="${DEVICE_NAME}2-1" add_core diff --git a/test/smoke_test/basic/12 b/test/smoke_test/basic/12 index 9dbb4b9..c713cbb 100755 --- a/test/smoke_test/basic/12 +++ b/test/smoke_test/basic/12 @@ -31,16 +31,16 @@ TARGET_DEVICE_OPTION="$CACHE_DEVICE" PARTITION_SIZE_OPTION="2000M" PARTITION_IDS TARGET_DEVICE_OPTION="$CORE_DEVICE" PARTITION_SIZE_OPTION="4000M" PARTITION_IDS_OPTION="1 2 3" make_primary_partitions # Start cache on CACHE_DEVICE1 (/dev/sdd1, for example) with ID=1 and add a core device using CORE_DEVICE1 (/dev/sde1, for example) -CACHE_ID_OPTION="1" CACHE_DEVICE_OPTION="${CACHE_DEVICE}1" CACHE_FORCE_OPTION="1" CACHE_MODE_OPTION=$CACHE_MODE start_cache -CACHE_ID_OPTION="1" CORE_DEVICE_OPTION="${CORE_DEVICE}1" add_core +CACHE_ID_OPTION="1" CACHE_DEVICE_OPTION="${CACHE_DEVICE}-part1" CACHE_FORCE_OPTION="1" CACHE_MODE_OPTION=$CACHE_MODE start_cache +CACHE_ID_OPTION="1" CORE_DEVICE_OPTION="${CORE_DEVICE}-part1" add_core # Start cache on CACHE_DEVICE2 (/dev/sdd2, for example) with ID=2 and add a core device using CORE_DEVICE2 (/dev/sde2, for example) -CACHE_ID_OPTION="2" CACHE_DEVICE_OPTION="${CACHE_DEVICE}2" CACHE_FORCE_OPTION="1" CACHE_MODE_OPTION=$CACHE_MODE start_cache -CACHE_ID_OPTION="2" CORE_DEVICE_OPTION="${CORE_DEVICE}2" add_core +CACHE_ID_OPTION="2" CACHE_DEVICE_OPTION="${CACHE_DEVICE}-part2" CACHE_FORCE_OPTION="1" CACHE_MODE_OPTION=$CACHE_MODE start_cache +CACHE_ID_OPTION="2" CORE_DEVICE_OPTION="${CORE_DEVICE}-part2" add_core # Start cache on CACHE_DEVICE3 (/dev/sdd3, for example) with ID=3 and add a core device using CORE_DEVICE3 (/dev/sde3, for example) -CACHE_ID_OPTION="3" CACHE_DEVICE_OPTION="${CACHE_DEVICE}3" CACHE_FORCE_OPTION="1" CACHE_MODE_OPTION=$CACHE_MODE start_cache -CACHE_ID_OPTION="3" CORE_DEVICE_OPTION="${CORE_DEVICE}3" add_core +CACHE_ID_OPTION="3" CACHE_DEVICE_OPTION="${CACHE_DEVICE}-part3" CACHE_FORCE_OPTION="1" CACHE_MODE_OPTION=$CACHE_MODE start_cache +CACHE_ID_OPTION="3" CORE_DEVICE_OPTION="${CORE_DEVICE}-part3" add_core # Create filesystems on cached devices - we do this using run_cmd because it is not in the API (and probably won't be). # The test framework will accept invoking the commands directly (e.g. "mkfs.ext3 [...]" without the "run_cmd"), but the @@ -67,8 +67,8 @@ for ID in 1 2 3 ; do run_cmd "umount ${MOUNTPOINT}-${ID}-1" CACHE_ID_OPTION="$ID" flush_cache CACHE_ID_OPTION="$ID" CACHE_DONT_FLUSH_DATA_OPTION="1" stop_cache - run_cmd dd if=/dev/zero of="${CACHE_DEVICE}${ID}" bs=1M count=1 oflag=direct - run_cmd "mount ${CORE_DEVICE}${ID} ${MOUNTPOINT}-${ID}-1" + run_cmd dd if=/dev/zero of="${CACHE_DEVICE}-part${ID}" bs=1M count=1 oflag=direct + run_cmd "mount ${CORE_DEVICE}-part${ID} ${MOUNTPOINT}-${ID}-1" done # Now check for files' presence and umount core devices diff --git a/test/smoke_test/basic/13 b/test/smoke_test/basic/13 index 0814383..7adbaa2 100755 --- a/test/smoke_test/basic/13 +++ b/test/smoke_test/basic/13 @@ -31,16 +31,16 @@ TARGET_DEVICE_OPTION="$CACHE_DEVICE" PARTITION_SIZE_OPTION="2000M" PARTITION_IDS TARGET_DEVICE_OPTION="$CORE_DEVICE" PARTITION_SIZE_OPTION="4000M" PARTITION_IDS_OPTION="1 2 3" make_primary_partitions # Start cache on CACHE_DEVICE1 (/dev/sdd1, for example) with ID=1 and add a core device using CORE_DEVICE1 (/dev/sde1, for example) -CACHE_ID_OPTION="1" CACHE_DEVICE_OPTION="${CACHE_DEVICE}1" CACHE_FORCE_OPTION="1" CACHE_MODE_OPTION=$CACHE_MODE start_cache -CACHE_ID_OPTION="1" CORE_DEVICE_OPTION="${CORE_DEVICE}1" add_core +CACHE_ID_OPTION="1" CACHE_DEVICE_OPTION="${CACHE_DEVICE}-part1" CACHE_FORCE_OPTION="1" CACHE_MODE_OPTION=$CACHE_MODE start_cache +CACHE_ID_OPTION="1" CORE_DEVICE_OPTION="${CORE_DEVICE}-part1" add_core # Start cache on CACHE_DEVICE2 (/dev/sdd2, for example) with ID=2 and add a core device using CORE_DEVICE2 (/dev/sde2, for example) -CACHE_ID_OPTION="2" CACHE_DEVICE_OPTION="${CACHE_DEVICE}2" CACHE_FORCE_OPTION="1" CACHE_MODE_OPTION=$CACHE_MODE start_cache -CACHE_ID_OPTION="2" CORE_DEVICE_OPTION="${CORE_DEVICE}2" add_core +CACHE_ID_OPTION="2" CACHE_DEVICE_OPTION="${CACHE_DEVICE}-part2" CACHE_FORCE_OPTION="1" CACHE_MODE_OPTION=$CACHE_MODE start_cache +CACHE_ID_OPTION="2" CORE_DEVICE_OPTION="${CORE_DEVICE}-part2" add_core # Start cache on CACHE_DEVICE3 (/dev/sdd3, for example) with ID=3 and add a core device using CORE_DEVICE3 (/dev/sde3, for example) -CACHE_ID_OPTION="3" CACHE_DEVICE_OPTION="${CACHE_DEVICE}3" CACHE_FORCE_OPTION="1" CACHE_MODE_OPTION=$CACHE_MODE start_cache -CACHE_ID_OPTION="3" CORE_DEVICE_OPTION="${CORE_DEVICE}3" add_core +CACHE_ID_OPTION="3" CACHE_DEVICE_OPTION="${CACHE_DEVICE}-part3" CACHE_FORCE_OPTION="1" CACHE_MODE_OPTION=$CACHE_MODE start_cache +CACHE_ID_OPTION="3" CORE_DEVICE_OPTION="${CORE_DEVICE}-part3" add_core # Create filesystems on cached devices - we do this using run_cmd because it is not in the API (and probably won't be). # The test framework will accept invoking the commands directly (e.g. "mkfs.ext3 [...]" without the "run_cmd"), but the @@ -67,8 +67,8 @@ for ID in 1 2 3 ; do run_cmd "umount ${MOUNTPOINT}-${ID}-1" CACHE_ID_OPTION="$ID" flush_cache CACHE_ID_OPTION="$ID" CACHE_DONT_FLUSH_DATA_OPTION="1" stop_cache - run_cmd dd if=/dev/zero of="${CACHE_DEVICE}${ID}" bs=1M count=1 oflag=direct - run_cmd "mount ${CORE_DEVICE}${ID} ${MOUNTPOINT}-${ID}-1" + run_cmd dd if=/dev/zero of="${CACHE_DEVICE}-part${ID}" bs=1M count=1 oflag=direct + run_cmd "mount ${CORE_DEVICE}-part${ID} ${MOUNTPOINT}-${ID}-1" done # Now check for files' presence and umount core devices diff --git a/test/smoke_test/cache_suspend/02 b/test/smoke_test/cache_suspend/02 index dc69f06..0ab640c 100755 --- a/test/smoke_test/cache_suspend/02 +++ b/test/smoke_test/cache_suspend/02 @@ -23,14 +23,14 @@ TEST_DEVICE=${DEVICE_NAME}1-1 #param device get_stat_sectors_read() { - L_DEVICE=$(basename $1) + L_DEVICE=$(basename $(realpath $1)) L_STAT=$(cat /proc/diskstats | grep $L_DEVICE | awk '{ print $6 }') echo $L_STAT } #param device get_stat_sectors_written() { - L_DEVICE=$(basename $1) + L_DEVICE=$(basename $(realpath $1)) L_STAT=$(cat /proc/diskstats | grep $L_DEVICE | awk '{ print $10 }') echo $L_STAT } @@ -46,13 +46,13 @@ cache_suspend_init() { # Create 1 primary partitions on CORE_DEVICE TARGET_DEVICE_OPTION="$CORE_DEVICE" PARTITION_SIZE_OPTION=$CORE_DEVICE_SIZE PARTITION_IDS_OPTION="1" make_primary_partitions - run_cmd dd if=/dev/zero of="${CORE_DEVICE}1" bs=1M count=1 oflag=direct + run_cmd dd if=/dev/zero of="${CORE_DEVICE}-part1" bs=1M count=1 oflag=direct # Start cache on CACHE_DEVICE1 - CACHE_ID_OPTION="1" CACHE_DEVICE_OPTION="${CACHE_DEVICE}1" start_cache + CACHE_ID_OPTION="1" CACHE_DEVICE_OPTION="${CACHE_DEVICE}-part1" start_cache # Add a core device using CORE_DEVICE1 - CACHE_ID_OPTION="1" CORE_DEVICE_OPTION="${CORE_DEVICE}1" add_core + CACHE_ID_OPTION="1" CORE_DEVICE_OPTION="${CORE_DEVICE}-part1" add_core } cache_suspend_deinit() { @@ -80,7 +80,7 @@ cache_suspend_test() { CACHE_MODE_FLUSH_OPTION="yes" CACHE_ID_OPTION="1" CACHE_MODE_OPTION="pt" set_cache_mode # Get read cache statistics before. - L_CACHE_READS_BEFORE=$(get_stat_sectors_read ${CACHE_DEVICE}1) + L_CACHE_READS_BEFORE=$(get_stat_sectors_read ${CACHE_DEVICE}-part1) # Read file test_log_trace "Read 4k, Read has to be performed from core" @@ -89,7 +89,7 @@ cache_suspend_test() { # Sync sync && echo 3 > /proc/sys/vm/drop_caches - L_CACHE_READS_AFTER=$(get_stat_sectors_read ${CACHE_DEVICE}1) + L_CACHE_READS_AFTER=$(get_stat_sectors_read ${CACHE_DEVICE}-part1) test_log_trace "Cache reads before : $L_CACHE_READS_BEFORE" test_log_trace "Cache reads after : $L_CACHE_READS_AFTER" @@ -107,9 +107,9 @@ cache_suspend_test() { sync && echo 3 > /proc/sys/vm/drop_caches # Get statistics - L_CACHE_WRITES_BEFORE=$(get_stat_sectors_written ${CACHE_DEVICE}1) - L_CORE_READS_BEFORE=$(get_stat_sectors_read ${CORE_DEVICE}1) - L_CACHE_READS_BEFORE=$(get_stat_sectors_read ${CACHE_DEVICE}1) + L_CACHE_WRITES_BEFORE=$(get_stat_sectors_written ${CACHE_DEVICE}-part1) + L_CORE_READS_BEFORE=$(get_stat_sectors_read ${CORE_DEVICE}-part1) + L_CACHE_READS_BEFORE=$(get_stat_sectors_read ${CACHE_DEVICE}-part1) # Read file test_log_trace "Read 4k, read form core only" @@ -119,9 +119,9 @@ cache_suspend_test() { sync && echo 3 > /proc/sys/vm/drop_caches # Get statistics - L_CACHE_WRITES_AFTER=$(get_stat_sectors_written ${CACHE_DEVICE}1) - L_CORE_READS_AFTER=$(get_stat_sectors_read ${CORE_DEVICE}1) - L_CACHE_READS_AFTER=$(get_stat_sectors_read ${CACHE_DEVICE}1) + L_CACHE_WRITES_AFTER=$(get_stat_sectors_written ${CACHE_DEVICE}-part1) + L_CORE_READS_AFTER=$(get_stat_sectors_read ${CORE_DEVICE}-part1) + L_CACHE_READS_AFTER=$(get_stat_sectors_read ${CACHE_DEVICE}-part1) test_log_trace "Core reads before : $L_CORE_READS_BEFORE" test_log_trace "Core reads after : $L_CORE_READS_AFTER" @@ -146,8 +146,8 @@ cache_suspend_test() { # Resume the cache CACHE_ID_OPTION="1" CACHE_MODE_OPTION="wt" set_cache_mode - L_CACHE_WRITES_BEFORE=$(get_stat_sectors_written ${CACHE_DEVICE}1) - L_CORE_READS_BEFORE=$(get_stat_sectors_read ${CORE_DEVICE}1) + L_CACHE_WRITES_BEFORE=$(get_stat_sectors_written ${CACHE_DEVICE}-part1) + L_CORE_READS_BEFORE=$(get_stat_sectors_read ${CORE_DEVICE}-part1) test_log_trace "Read 4k, read form core, write on cache" # Read file @@ -156,8 +156,8 @@ cache_suspend_test() { # Sync sync && echo 3 > /proc/sys/vm/drop_caches - L_CORE_READS_AFTER=$(get_stat_sectors_read ${CORE_DEVICE}1) - L_CACHE_WRITES_AFTER=$(get_stat_sectors_written ${CACHE_DEVICE}1) + L_CORE_READS_AFTER=$(get_stat_sectors_read ${CORE_DEVICE}-part1) + L_CACHE_WRITES_AFTER=$(get_stat_sectors_written ${CACHE_DEVICE}-part1) test_log_trace "Core reads before : $L_CORE_READS_BEFORE" test_log_trace "Core reads after : $L_CORE_READS_AFTER" diff --git a/test/smoke_test/cache_suspend/03 b/test/smoke_test/cache_suspend/03 index 307c371..d2048b6 100755 --- a/test/smoke_test/cache_suspend/03 +++ b/test/smoke_test/cache_suspend/03 @@ -27,10 +27,10 @@ TEST_COUNT_HALF=16384 #param device get_stat_sectors_read() { - L_DEVICE=$(basename $1) + L_DEVICE=$(basename $(realpath $1)) if [[ ${L_DEVICE} =~ "nvme" ]] then - L_DEVICE="${L_DEVICE:0:${#L_DEVICE}-1}p${L_DEVICE: -1}" + L_DEVICE="${L_DEVICE:0:${#L_DEVICE}-1}-part${L_DEVICE: -1}" fi L_STAT=$(cat /proc/diskstats | grep $L_DEVICE | awk '{ print $6 }') echo $L_STAT @@ -38,7 +38,7 @@ get_stat_sectors_read() { #param device get_stat_sectors_written() { - L_DEVICE=$(basename $1) + L_DEVICE=$(basename $(realpath $1)) L_STAT=$(cat /proc/diskstats | grep $L_DEVICE | awk '{ print $10 }') echo $L_STAT } @@ -54,13 +54,13 @@ cache_suspend_init() { # Create 1 primary partitions on CORE_DEVICE TARGET_DEVICE_OPTION="$CORE_DEVICE" PARTITION_SIZE_OPTION=$CORE_DEVICE_SIZE PARTITION_IDS_OPTION="1" make_primary_partitions - run_cmd dd if=/dev/zero of="${CORE_DEVICE}1" bs=1M count=1 oflag=direct + run_cmd dd if=/dev/zero of="${CORE_DEVICE}-part1" bs=1M count=1 oflag=direct # Start cache on CACHE_DEVICE1 - CACHE_ID_OPTION="1" CACHE_DEVICE_OPTION="${CACHE_DEVICE}1" start_cache + CACHE_ID_OPTION="1" CACHE_DEVICE_OPTION="${CACHE_DEVICE}-part1" start_cache # Add a core device using CORE_DEVICE1 - CACHE_ID_OPTION="1" CORE_DEVICE_OPTION="${CORE_DEVICE}1" add_core + CACHE_ID_OPTION="1" CORE_DEVICE_OPTION="${CORE_DEVICE}-part1" add_core } cache_suspend_deinit() { @@ -107,8 +107,8 @@ cache_suspend_test() { CACHE_ID_OPTION="1" CACHE_MODE_OPTION="wt" set_cache_mode # Get statistics before - L_CACHE_READS_BEFORE=$(get_stat_sectors_read ${CACHE_DEVICE}1) - L_CORE_READS_BEFORE=$(get_stat_sectors_read ${CORE_DEVICE}1) + L_CACHE_READS_BEFORE=$(get_stat_sectors_read ${CACHE_DEVICE}-part1) + L_CORE_READS_BEFORE=$(get_stat_sectors_read ${CORE_DEVICE}-part1) # Read from test_log_trace "Read from CAS" @@ -117,8 +117,8 @@ cache_suspend_test() { sync && echo 3 > /proc/sys/vm/drop_caches # Get statistics after - L_CACHE_READS_AFTER=$(get_stat_sectors_read ${CACHE_DEVICE}1) - L_CORE_READS_AFTER=$(get_stat_sectors_read ${CORE_DEVICE}1) + L_CACHE_READS_AFTER=$(get_stat_sectors_read ${CACHE_DEVICE}-part1) + L_CORE_READS_AFTER=$(get_stat_sectors_read ${CORE_DEVICE}-part1) test_log_trace "Cache reads before : $L_CACHE_READS_BEFORE" test_log_trace "Cache reads after : $L_CACHE_READS_AFTER" diff --git a/test/smoke_test/eviction_policy/01 b/test/smoke_test/eviction_policy/01 index d453e5d..b5d555f 100755 --- a/test/smoke_test/eviction_policy/01 +++ b/test/smoke_test/eviction_policy/01 @@ -48,10 +48,10 @@ eviction_policy_init() { fi # Start cache on CACHE_DEVICE1 - CACHE_ID_OPTION="1" CACHE_DEVICE_OPTION="${CACHE_DEVICE}1" start_cache + CACHE_ID_OPTION="1" CACHE_DEVICE_OPTION="${CACHE_DEVICE}-part1" start_cache # Add a core device using CORE_DEVICE1 - CACHE_ID_OPTION="1" CORE_DEVICE_OPTION="${CORE_DEVICE}1" add_core + CACHE_ID_OPTION="1" CORE_DEVICE_OPTION="${CORE_DEVICE}-part1" add_core } eviction_policy_flush() { diff --git a/test/smoke_test/eviction_policy/02 b/test/smoke_test/eviction_policy/02 index 65bd815..0fa2fa0 100755 --- a/test/smoke_test/eviction_policy/02 +++ b/test/smoke_test/eviction_policy/02 @@ -34,7 +34,7 @@ eviction_policy_init() { # Create 1 primary partitions on CACHE_DEVICE TARGET_DEVICE_OPTION="$CACHE_DEVICE" PARTITION_SIZE_OPTION=$CACHE_DEVICE_SIZE PARTITION_IDS_OPTION="1" make_primary_partitions # Make empty cache device, clear previous content, clear previous metadata - dd if=/dev/zero of="${CACHE_DEVICE}1" bs="4k" count=$CACHE_DEVICE_SIZE &>/dev/null + dd if=/dev/zero of="${CACHE_DEVICE}-part1" bs="4k" count=$CACHE_DEVICE_SIZE &>/dev/null # Create 1 primary partitions on CORE_DEVICE TARGET_DEVICE_OPTION="$CORE_DEVICE" PARTITION_SIZE_OPTION=$CORE_DEVICE_SIZE PARTITION_IDS_OPTION="1" make_primary_partitions @@ -50,10 +50,10 @@ eviction_policy_init() { fi # Start cache on CACHE_DEVICE1 - CACHE_ID_OPTION="1" CACHE_DEVICE_OPTION="${CACHE_DEVICE}1" start_cache + CACHE_ID_OPTION="1" CACHE_DEVICE_OPTION="${CACHE_DEVICE}-part1" start_cache # Add a core device using CORE_DEVICE1 - CACHE_ID_OPTION="1" CORE_DEVICE_OPTION="${CORE_DEVICE}1" add_core + CACHE_ID_OPTION="1" CORE_DEVICE_OPTION="${CORE_DEVICE}-part1" add_core } eviction_policy_flush() { @@ -322,7 +322,7 @@ test_log_start run_cmd eviction_policy_init -run_cmd eviction_policy_test $TEST_DEVICE "${CORE_DEVICE}1" $(get_bytes $CORE_DEVICE_SIZE) +run_cmd eviction_policy_test $TEST_DEVICE "${CORE_DEVICE}-part1" $(get_bytes $CORE_DEVICE_SIZE) run_cmd eviction_policy_deinit diff --git a/test/smoke_test/eviction_policy/03 b/test/smoke_test/eviction_policy/03 index bb0fcc1..abff530 100755 --- a/test/smoke_test/eviction_policy/03 +++ b/test/smoke_test/eviction_policy/03 @@ -34,7 +34,7 @@ eviction_policy_init() { # Create 1 primary partitions on CACHE_DEVICE TARGET_DEVICE_OPTION="$CACHE_DEVICE" PARTITION_SIZE_OPTION=$CACHE_DEVICE_SIZE PARTITION_IDS_OPTION="1" make_primary_partitions # Make empty cache device, clear previous content, clear previous metadata - dd if=/dev/zero of="${CACHE_DEVICE}1" bs="4k" count=$CACHE_DEVICE_SIZE &>/dev/null + dd if=/dev/zero of="${CACHE_DEVICE}-part1" bs="4k" count=$CACHE_DEVICE_SIZE &>/dev/null # Create 1 primary partitions on CORE_DEVICE TARGET_DEVICE_OPTION="$CORE_DEVICE" PARTITION_SIZE_OPTION=$CORE_DEVICE_SIZE PARTITION_IDS_OPTION="1" make_primary_partitions @@ -50,10 +50,10 @@ eviction_policy_init() { fi # Start cache on CACHE_DEVICE1 - CACHE_ID_OPTION="1" CACHE_DEVICE_OPTION="${CACHE_DEVICE}1" start_cache + CACHE_ID_OPTION="1" CACHE_DEVICE_OPTION="${CACHE_DEVICE}-part1" start_cache # Add a core device using CORE_DEVICE1 - CACHE_ID_OPTION="1" CORE_DEVICE_OPTION="${CORE_DEVICE}1" add_core + CACHE_ID_OPTION="1" CORE_DEVICE_OPTION="${CORE_DEVICE}-part1" add_core } eviction_policy_flush() { @@ -315,7 +315,7 @@ test_log_start run_cmd eviction_policy_init "YES" -run_cmd eviction_policy_test $TEST_DEVICE "${CORE_DEVICE}1" $(get_bytes $CORE_DEVICE_SIZE) +run_cmd eviction_policy_test $TEST_DEVICE "${CORE_DEVICE}-part1" $(get_bytes $CORE_DEVICE_SIZE) run_cmd eviction_policy_deinit diff --git a/test/smoke_test/fio/01 b/test/smoke_test/fio/01 index 2e6d7e9..a164f08 100755 --- a/test/smoke_test/fio/01 +++ b/test/smoke_test/fio/01 @@ -36,10 +36,10 @@ CACHE_LINE_SIZES="4 8 16 32 64" for mode in $CACHE_MODES; do for line_size in $CACHE_LINE_SIZES; do - CACHE_ID_OPTION="1" CACHE_DEVICE_OPTION="${CACHE_DEVICE}1" \ + CACHE_ID_OPTION="1" CACHE_DEVICE_OPTION="${CACHE_DEVICE}-part1" \ CACHE_MODE_OPTION="$mode" CACHE_LINE_SIZE="$line_size" \ CACHE_FORCE_OPTION="yes" start_cache - CACHE_ID_OPTION="1" CORE_DEVICE_OPTION="${CORE_DEVICE}1" add_core + CACHE_ID_OPTION="1" CORE_DEVICE_OPTION="${CORE_DEVICE}-part1" add_core for engine in $IO_ENGINES; do run_cmd "fio --ioengine=${engine} --direct=1 --name=test \ diff --git a/test/smoke_test/incremental_load/01 b/test/smoke_test/incremental_load/01 index 0d23cdc..b389d80 100755 --- a/test/smoke_test/incremental_load/01 +++ b/test/smoke_test/incremental_load/01 @@ -31,12 +31,12 @@ TARGET_DEVICE_OPTION="$CACHE_DEVICE" PARTITION_SIZE_OPTION="2000M" PARTITION_IDS TARGET_DEVICE_OPTION="$CORE_DEVICE" PARTITION_SIZE_OPTION="4000M" PARTITION_IDS_OPTION="1 2 3" make_primary_partitions # Prepare cache on CACHE_DEVICE1 (/dev/sdd1, e.g.) and add core device using CORE_DEVICE1, CORE_DEVICE2 and CORE_DEVICE3 (/dev/sde1, /dev/sde2, /dev/sde3, e.g) -CACHE_ID_OPTION="1" CACHE_DEVICE_OPTION="${CACHE_DEVICE}1" start_cache -CACHE_ID_OPTION="1" CORE_DEVICE_OPTION="${CORE_DEVICE}1" add_core -CACHE_ID_OPTION="1" CORE_DEVICE_OPTION="${CORE_DEVICE}2" add_core -CACHE_ID_OPTION="1" CORE_DEVICE_OPTION="${CORE_DEVICE}3" add_core +CACHE_ID_OPTION="1" CACHE_DEVICE_OPTION="${CACHE_DEVICE}-part1" start_cache +CACHE_ID_OPTION="1" CORE_DEVICE_OPTION="${CORE_DEVICE}-part1" add_core +CACHE_ID_OPTION="1" CORE_DEVICE_OPTION="${CORE_DEVICE}-part2" add_core +CACHE_ID_OPTION="1" CORE_DEVICE_OPTION="${CORE_DEVICE}-part3" add_core -DEVICE_ID_OPTION=${CACHE_DEVICE}1 DEMANDED_STATE_OPTION="Running" check_device_state +DEVICE_ID_OPTION="${CACHE_DEVICE}-part1" DEMANDED_STATE_OPTION="Running" check_device_state DEVICE_ID_OPTION="${DEVICE_NAME}1-1" DEMANDED_STATE_OPTION="Active" check_device_state DEVICE_ID_OPTION="${DEVICE_NAME}1-2" DEMANDED_STATE_OPTION="Active" check_device_state DEVICE_ID_OPTION="${DEVICE_NAME}1-3" DEMANDED_STATE_OPTION="Active" check_device_state @@ -46,19 +46,19 @@ CACHE_ID_OPTION="1" stop_cache # Add cores to pool, then load cache and check if cache is running # Try to add core devices and check their states -CACHE_ID_OPTION="1" CORE_DEVICE_OPTION="${CORE_DEVICE}1" CORE_ID_OPTION="1" try_add_core -DEVICE_ID_OPTION=${CORE_DEVICE}1 DEMANDED_STATE_OPTION="Detached" check_device_state +CACHE_ID_OPTION="1" CORE_DEVICE_OPTION="${CORE_DEVICE}-part1" CORE_ID_OPTION="1" try_add_core +DEVICE_ID_OPTION="${CORE_DEVICE}-part1" DEMANDED_STATE_OPTION="Detached" check_device_state -CACHE_ID_OPTION="1" CORE_DEVICE_OPTION="${CORE_DEVICE}2" CORE_ID_OPTION="2" try_add_core -DEVICE_ID_OPTION=${CORE_DEVICE}2 DEMANDED_STATE_OPTION="Detached" check_device_state +CACHE_ID_OPTION="1" CORE_DEVICE_OPTION="${CORE_DEVICE}-part2" CORE_ID_OPTION="2" try_add_core +DEVICE_ID_OPTION="${CORE_DEVICE}-part2" DEMANDED_STATE_OPTION="Detached" check_device_state -CACHE_ID_OPTION="1" CORE_DEVICE_OPTION="${CORE_DEVICE}3" CORE_ID_OPTION="3" try_add_core -DEVICE_ID_OPTION=${CORE_DEVICE}3 DEMANDED_STATE_OPTION="Detached" check_device_state +CACHE_ID_OPTION="1" CORE_DEVICE_OPTION="${CORE_DEVICE}-part3" CORE_ID_OPTION="3" try_add_core +DEVICE_ID_OPTION="${CORE_DEVICE}-part3" DEMANDED_STATE_OPTION="Detached" check_device_state # Try to load cache device, check if it is running and if all cores status is appropirate -CACHE_ID_OPTION="1" CACHE_DEVICE_OPTION="${CACHE_DEVICE}1" CACHE_LOAD_METADATA_OPTION="y" start_cache -DEVICE_ID_OPTION=${CACHE_DEVICE}1 DEMANDED_STATE_OPTION="Running" check_device_state +CACHE_ID_OPTION="1" CACHE_DEVICE_OPTION="${CACHE_DEVICE}-part1" CACHE_LOAD_METADATA_OPTION="y" start_cache +DEVICE_ID_OPTION="${CACHE_DEVICE}-part1" DEMANDED_STATE_OPTION="Running" check_device_state DEVICE_ID_OPTION="${DEVICE_NAME}1-1" DEMANDED_STATE_OPTION="Active" check_device_state DEVICE_ID_OPTION="${DEVICE_NAME}1-2" DEMANDED_STATE_OPTION="Active" check_device_state DEVICE_ID_OPTION="${DEVICE_NAME}1-3" DEMANDED_STATE_OPTION="Active" check_device_state diff --git a/test/smoke_test/incremental_load/02 b/test/smoke_test/incremental_load/02 index 14966de..b1351c8 100755 --- a/test/smoke_test/incremental_load/02 +++ b/test/smoke_test/incremental_load/02 @@ -31,12 +31,12 @@ TARGET_DEVICE_OPTION="$CACHE_DEVICE" PARTITION_SIZE_OPTION="2000M" PARTITION_IDS TARGET_DEVICE_OPTION="$CORE_DEVICE" PARTITION_SIZE_OPTION="4000M" PARTITION_IDS_OPTION="1 2 3" make_primary_partitions # Prepare cache on CACHE_DEVICE1 (/dev/sdd1, e.g.) and add core device using CORE_DEVICE1, CORE_DEVICE2 and CORE_DEVICE3 (/dev/sde1, /dev/sde2, /dev/sde3, e.g) -CACHE_ID_OPTION="1" CACHE_DEVICE_OPTION="${CACHE_DEVICE}1" start_cache -CACHE_ID_OPTION="1" CORE_DEVICE_OPTION="${CORE_DEVICE}1" add_core -CACHE_ID_OPTION="1" CORE_DEVICE_OPTION="${CORE_DEVICE}2" add_core -CACHE_ID_OPTION="1" CORE_DEVICE_OPTION="${CORE_DEVICE}3" add_core +CACHE_ID_OPTION="1" CACHE_DEVICE_OPTION="${CACHE_DEVICE}-part1" start_cache +CACHE_ID_OPTION="1" CORE_DEVICE_OPTION="${CORE_DEVICE}-part1" add_core +CACHE_ID_OPTION="1" CORE_DEVICE_OPTION="${CORE_DEVICE}-part2" add_core +CACHE_ID_OPTION="1" CORE_DEVICE_OPTION="${CORE_DEVICE}-part3" add_core -DEVICE_ID_OPTION=${CACHE_DEVICE}1 DEMANDED_STATE_OPTION="Running" check_device_state +DEVICE_ID_OPTION="${CACHE_DEVICE}-part1" DEMANDED_STATE_OPTION="Running" check_device_state DEVICE_ID_OPTION="${DEVICE_NAME}1-1" DEMANDED_STATE_OPTION="Active" check_device_state DEVICE_ID_OPTION="${DEVICE_NAME}1-2" DEMANDED_STATE_OPTION="Active" check_device_state DEVICE_ID_OPTION="${DEVICE_NAME}1-3" DEMANDED_STATE_OPTION="Active" check_device_state @@ -48,8 +48,8 @@ TARGET_DEVICE_OPTION="$CORE_DEVICE" PARTITION_SIZE_OPTION="4000M" PARTITION_IDS_ sleep 1 # Load cache, then add cores and check if chache is running # Try to load cache device, check its state and cores state -CACHE_ID_OPTION="1" CACHE_DEVICE_OPTION="${CACHE_DEVICE}1" CACHE_LOAD_METADATA_OPTION="y" start_cache -DEVICE_ID_OPTION=${CACHE_DEVICE}1 DEMANDED_STATE_OPTION="Incomplete" check_device_state +CACHE_ID_OPTION="1" CACHE_DEVICE_OPTION="${CACHE_DEVICE}-part1" CACHE_LOAD_METADATA_OPTION="y" start_cache +DEVICE_ID_OPTION="${CACHE_DEVICE}-part1" DEMANDED_STATE_OPTION="Incomplete" check_device_state DEVICE_ID_OPTION="${DEVICE_NAME}1-1" DEMANDED_STATE_OPTION="Active" check_device_state DEVICE_ID_OPTION="${DEVICE_NAME}1-2" DEMANDED_STATE_OPTION="Active" check_device_state DEVICE_ID_OPTION="${DEVICE_NAME}1-3" DEMANDED_STATE_OPTION="Inactive" check_device_state @@ -59,16 +59,16 @@ CACHE_ID_OPTION="1" CACHE_DONT_FLUSH_DATA_OPTION="1" stop_cache TARGET_DEVICE_OPTION="$CORE_DEVICE" remove_partitions TARGET_DEVICE_OPTION="$CORE_DEVICE" PARTITION_SIZE_OPTION="4000M" PARTITION_IDS_OPTION="1 2 3" make_primary_partitions sleep 1 -CACHE_ID_OPTION="1" CORE_DEVICE_OPTION="${CORE_DEVICE}1" CORE_ID_OPTION="1" try_add_core -CACHE_ID_OPTION="1" CORE_DEVICE_OPTION="${CORE_DEVICE}2" CORE_ID_OPTION="2" try_add_core -CACHE_ID_OPTION="1" CORE_DEVICE_OPTION="${CORE_DEVICE}3" CORE_ID_OPTION="3" try_add_core -DEVICE_ID_OPTION="${CORE_DEVICE}1" DEMANDED_STATE_OPTION="Detached" check_device_state -DEVICE_ID_OPTION="${CORE_DEVICE}2" DEMANDED_STATE_OPTION="Detached" check_device_state -DEVICE_ID_OPTION="${CORE_DEVICE}3" DEMANDED_STATE_OPTION="Detached" check_device_state +CACHE_ID_OPTION="1" CORE_DEVICE_OPTION="${CORE_DEVICE}-part1" CORE_ID_OPTION="1" try_add_core +CACHE_ID_OPTION="1" CORE_DEVICE_OPTION="${CORE_DEVICE}-part2" CORE_ID_OPTION="2" try_add_core +CACHE_ID_OPTION="1" CORE_DEVICE_OPTION="${CORE_DEVICE}-part3" CORE_ID_OPTION="3" try_add_core +DEVICE_ID_OPTION="${CORE_DEVICE}-part1" DEMANDED_STATE_OPTION="Detached" check_device_state +DEVICE_ID_OPTION="${CORE_DEVICE}-part2" DEMANDED_STATE_OPTION="Detached" check_device_state +DEVICE_ID_OPTION="${CORE_DEVICE}-part3" DEMANDED_STATE_OPTION="Detached" check_device_state -CACHE_ID_OPTION="1" CACHE_DEVICE_OPTION="${CACHE_DEVICE}1" CACHE_LOAD_METADATA_OPTION="y" start_cache +CACHE_ID_OPTION="1" CACHE_DEVICE_OPTION="${CACHE_DEVICE}-part1" CACHE_LOAD_METADATA_OPTION="y" start_cache -DEVICE_ID_OPTION=${CACHE_DEVICE}1 DEMANDED_STATE_OPTION="Running" check_device_state +DEVICE_ID_OPTION="${CACHE_DEVICE}-part1" DEMANDED_STATE_OPTION="Running" check_device_state DEVICE_ID_OPTION="${DEVICE_NAME}1-1" DEMANDED_STATE_OPTION="Active" check_device_state DEVICE_ID_OPTION="${DEVICE_NAME}1-2" DEMANDED_STATE_OPTION="Active" check_device_state DEVICE_ID_OPTION="${DEVICE_NAME}1-3" DEMANDED_STATE_OPTION="Active" check_device_state diff --git a/test/smoke_test/init_script/01 b/test/smoke_test/init_script/01 index cbde890..3274481 100755 --- a/test/smoke_test/init_script/01 +++ b/test/smoke_test/init_script/01 @@ -31,18 +31,18 @@ TARGET_DEVICE_OPTION="$CORE_DEVICE" PARTITION_SIZE_OPTION="4000M" PARTITION_IDS_ cat > $CAS_CONFIG_PATH <<- EOM ${CAS_CONFIG_VERSION_TAG} [caches] -1 ${CACHE_DEVICE}1 WT +1 ${CACHE_DEVICE}-part1 WT [cores] -1 1 ${CORE_DEVICE}1 -1 2 ${CORE_DEVICE}2 -1 3 ${CORE_DEVICE}3 +1 1 ${CORE_DEVICE}-part1 +1 2 ${CORE_DEVICE}-part2 +1 3 ${CORE_DEVICE}-part3 EOM run_cmd "casctl init" run_cmd "udevadm settle" -DEVICE_ID_OPTION=${CACHE_DEVICE}1 DEMANDED_STATE_OPTION="Running" check_device_state +DEVICE_ID_OPTION="${CACHE_DEVICE}-part1" DEMANDED_STATE_OPTION="Running" check_device_state DEVICE_ID_OPTION="${DEVICE_NAME}1-1" DEMANDED_STATE_OPTION="Active" check_device_state DEVICE_ID_OPTION="${DEVICE_NAME}1-2" DEMANDED_STATE_OPTION="Active" check_device_state DEVICE_ID_OPTION="${DEVICE_NAME}1-3" DEMANDED_STATE_OPTION="Active" check_device_state @@ -53,9 +53,7 @@ check_no_cache_running run_cmd "casctl start" -run_cmd "udevadm settle" - -DEVICE_ID_OPTION=${CACHE_DEVICE}1 DEMANDED_STATE_OPTION="Running" check_device_state +DEVICE_ID_OPTION="${CACHE_DEVICE}-part1" DEMANDED_STATE_OPTION="Running" check_device_state DEVICE_ID_OPTION="${DEVICE_NAME}1-1" DEMANDED_STATE_OPTION="Active" check_device_state DEVICE_ID_OPTION="${DEVICE_NAME}1-2" DEMANDED_STATE_OPTION="Active" check_device_state DEVICE_ID_OPTION="${DEVICE_NAME}1-3" DEMANDED_STATE_OPTION="Active" check_device_state diff --git a/test/smoke_test/init_script/02 b/test/smoke_test/init_script/02 index 3beedf2..ec2bb64 100755 --- a/test/smoke_test/init_script/02 +++ b/test/smoke_test/init_script/02 @@ -35,16 +35,16 @@ TARGET_DEVICE_OPTION="$CORE_DEVICE" PARTITION_SIZE_OPTION="4000M" PARTITION_IDS_ cat > $CAS_CONFIG_PATH <<- EOM ${CAS_CONFIG_VERSION_TAG} [caches] -16384 ${CACHE_DEVICE}1 WB cleaning_policy=acp +16384 ${CACHE_DEVICE}-part1 WB cleaning_policy=acp [cores] -16384 4095 ${CORE_DEVICE}1 -16384 4094 ${CORE_DEVICE}2 -16384 0 ${CORE_DEVICE}3 +16384 4095 ${CORE_DEVICE}-part1 +16384 4094 ${CORE_DEVICE}-part2 +16384 0 ${CORE_DEVICE}-part3 EOM run_cmd "casctl init" -DEVICE_ID_OPTION=${CACHE_DEVICE}1 DEMANDED_STATE_OPTION="Running" check_device_state +DEVICE_ID_OPTION="${CACHE_DEVICE}-part1" DEMANDED_STATE_OPTION="Running" check_device_state DEVICE_ID_OPTION="${DEVICE_NAME}16384-0" DEMANDED_STATE_OPTION="Active" check_device_state DEVICE_ID_OPTION="${DEVICE_NAME}16384-4095" DEMANDED_STATE_OPTION="Active" check_device_state DEVICE_ID_OPTION="${DEVICE_NAME}16384-4094" DEMANDED_STATE_OPTION="Active" check_device_state @@ -57,7 +57,7 @@ check_no_cache_running run_cmd "casctl start" -DEVICE_ID_OPTION=${CACHE_DEVICE}1 DEMANDED_STATE_OPTION="Running" check_device_state +DEVICE_ID_OPTION="${CACHE_DEVICE}-part1" DEMANDED_STATE_OPTION="Running" check_device_state DEVICE_ID_OPTION="${DEVICE_NAME}16384-0" DEMANDED_STATE_OPTION="Active" check_device_state DEVICE_ID_OPTION="${DEVICE_NAME}16384-4095" DEMANDED_STATE_OPTION="Active" check_device_state DEVICE_ID_OPTION="${DEVICE_NAME}16384-4094" DEMANDED_STATE_OPTION="Active" check_device_state diff --git a/test/smoke_test/init_script/03 b/test/smoke_test/init_script/03 index cc7bf3b..eac542f 100755 --- a/test/smoke_test/init_script/03 +++ b/test/smoke_test/init_script/03 @@ -30,11 +30,11 @@ TARGET_DEVICE_OPTION="$CORE_DEVICE" PARTITION_SIZE_OPTION="4000M" PARTITION_IDS_ cat > $CAS_CONFIG_PATH <<- EOM ${CAS_CONFIG_VERSION_TAG} [caches] -1 ${CACHE_DEVICE}1 WB cleaning_policy=nop +1 ${CACHE_DEVICE}-part1 WB cleaning_policy=nop [cores] -1 1 ${CORE_DEVICE}1 -1 2 ${CORE_DEVICE}2 -1 3 ${CORE_DEVICE}3 +1 1 ${CORE_DEVICE}-part1 +1 2 ${CORE_DEVICE}-part2 +1 3 ${CORE_DEVICE}-part3 EOM run_cmd "casctl init" @@ -46,7 +46,7 @@ run_cmd "udevadm settle" run_cmd "casctl stop" # We shouldn't be able to start cache on this device, it contains dirty data -NEGATIVE_TEST_OPTION=1 CACHE_DEVICE_OPTION=${CACHE_DEVICE}1 CACHE_ID_OPTION=1 start_cache +NEGATIVE_TEST_OPTION=1 CACHE_DEVICE_OPTION="${CACHE_DEVICE}-part1" CACHE_ID_OPTION=1 start_cache NEGATIVE_TEST_OPTION=1 run_cmd "casctl init" clear_options @@ -56,7 +56,7 @@ run_cmd "casctl start" run_cmd "casctl stop" # We still shouldn't be able to start -NEGATIVE_TEST_OPTION=1 CACHE_DEVICE_OPTION=${CACHE_DEVICE}1 CACHE_ID_OPTION=1 start_cache +NEGATIVE_TEST_OPTION=1 CACHE_DEVICE_OPTION="${CACHE_DEVICE}-part1" CACHE_ID_OPTION=1 start_cache NEGATIVE_TEST_OPTION=1 run_cmd "casctl init" clear_options @@ -69,7 +69,7 @@ run_cmd "udevadm settle" run_cmd "casctl stop --flush" -run_cmd "casadm -S -d ${CACHE_DEVICE}1 --force" +run_cmd "casadm -S -d ${CACHE_DEVICE}-part1 --force" run_cmd "casctl stop" diff --git a/test/smoke_test/io_class/01_wlth b/test/smoke_test/io_class/01_wlth index ddc91b5..2d1842b 100755 --- a/test/smoke_test/io_class/01_wlth +++ b/test/smoke_test/io_class/01_wlth @@ -46,10 +46,10 @@ TARGET_DEVICE_OPTION="$CACHE_DEVICE" PARTITION_SIZE_OPTION="200M" PARTITION_IDS_ TARGET_DEVICE_OPTION="$CORE_DEVICE" PARTITION_SIZE_OPTION="400M" PARTITION_IDS_OPTION="1" make_primary_partitions # Start cache -CACHE_ID_OPTION="1" CACHE_DEVICE_OPTION="${CACHE_DEVICE}1" start_cache +CACHE_ID_OPTION="1" CACHE_DEVICE_OPTION="${CACHE_DEVICE}-part1" start_cache # Add core -CACHE_ID_OPTION="1" CORE_DEVICE_OPTION="${CORE_DEVICE}1" add_core +CACHE_ID_OPTION="1" CORE_DEVICE_OPTION="${CORE_DEVICE}-part1" add_core # Prepare IO class config with wlth specified io_class_config_wlth diff --git a/test/smoke_test/io_class/02_wlth b/test/smoke_test/io_class/02_wlth index 4262fdb..431e51a 100755 --- a/test/smoke_test/io_class/02_wlth +++ b/test/smoke_test/io_class/02_wlth @@ -48,10 +48,10 @@ TARGET_DEVICE_OPTION="$CACHE_DEVICE" PARTITION_SIZE_OPTION="200M" PARTITION_IDS_ TARGET_DEVICE_OPTION="$CORE_DEVICE" PARTITION_SIZE_OPTION="400M" PARTITION_IDS_OPTION="1" make_primary_partitions # Start cache -CACHE_ID_OPTION="1" CACHE_DEVICE_OPTION="${CACHE_DEVICE}1" start_cache +CACHE_ID_OPTION="1" CACHE_DEVICE_OPTION="${CACHE_DEVICE}-part1" start_cache # Add core -CACHE_ID_OPTION="1" CORE_DEVICE_OPTION="${CORE_DEVICE}1" add_core +CACHE_ID_OPTION="1" CORE_DEVICE_OPTION="${CORE_DEVICE}-part1" add_core # Prepare IO class config with wlth specified io_class_config_wlth diff --git a/test/smoke_test/metadata_corrupt/01 b/test/smoke_test/metadata_corrupt/01 index 64c52f1..2910ac2 100755 --- a/test/smoke_test/metadata_corrupt/01 +++ b/test/smoke_test/metadata_corrupt/01 @@ -24,13 +24,13 @@ test_log_start # Corrupts random bit from byte on given by $1 address from ${CACHE_DEVICE}1 corrupt_byte(){ OFFSET=$1 - READ_VALUE=`od -N 1 -j $OFFSET -A n -t x1 ${CACHE_DEVICE}1` + READ_VALUE=`od -N 1 -j $OFFSET -A n -t x1 ${CACHE_DEVICE}-part1` READ_VALUE="0x`echo $READ_VALUE`" RANDOM_UINT32=`od -An -tu4 -N4 /dev/urandom` MASK=$(( 1 << $(( $RANDOM_UINT32 % 8 )) )) - echo -e "\x$(( ${READ_VALUE} ^ ${MASK} ))"| dd bs=1 count=1 seek=$OFFSET conv=notrunc of=${CACHE_DEVICE}1 1>&2 2>/dev/null + echo -e "\x$(( ${READ_VALUE} ^ ${MASK} ))"| dd bs=1 count=1 seek=$OFFSET conv=notrunc of=${CACHE_DEVICE}-part1 1>&2 2>/dev/null } # Use CACHE_DEVICE and CORE_DEVICE provided by configuration file and remove partitions from those devices @@ -52,7 +52,7 @@ do fi # Start cache on CACHE_DEVICE to repair it and also to make log. - CACHE_ID_OPTION="1" CACHE_FORCE_OPTION="1" CACHE_DEVICE_OPTION="${CACHE_DEVICE}1" start_cache + CACHE_ID_OPTION="1" CACHE_FORCE_OPTION="1" CACHE_DEVICE_OPTION="${CACHE_DEVICE}-part1" start_cache # Stop cache. CACHE_ID_OPTION="1" stop_cache @@ -88,7 +88,7 @@ do corrupt_byte ${CORRUPT_ADDRESS} # Start again with load option, this should fail, metadata is corrupted. - NEGATIVE_TEST_OPTION="1" CACHE_ID_OPTION="1" CACHE_LOAD_METADATA_OPTION="1" CACHE_DEVICE_OPTION="${CACHE_DEVICE}1" start_cache + NEGATIVE_TEST_OPTION="1" CACHE_ID_OPTION="1" CACHE_LOAD_METADATA_OPTION="1" CACHE_DEVICE_OPTION="${CACHE_DEVICE}-part1" start_cache done diff --git a/test/smoke_test/metadata_corrupt/02 b/test/smoke_test/metadata_corrupt/02 index 538196b..2a854a1 100755 --- a/test/smoke_test/metadata_corrupt/02 +++ b/test/smoke_test/metadata_corrupt/02 @@ -40,7 +40,7 @@ do fi # Start cache on CACHE_DEVICE to repair it and also to make log. - CACHE_ID_OPTION="1" CACHE_FORCE_OPTION="1" CACHE_DEVICE_OPTION="${CACHE_DEVICE}1" start_cache + CACHE_ID_OPTION="1" CACHE_FORCE_OPTION="1" CACHE_DEVICE_OPTION="${CACHE_DEVICE}-part1" start_cache # Stop cache. CACHE_ID_OPTION="1" stop_cache @@ -59,10 +59,10 @@ do test_log_trace "Corrupting 64K bytes in ${SECTION}" # Corrupt cache metadata - run_cmd "dd if=/dev/urandom of="${CACHE_DEVICE}1" bs=1 count=64K conv=notrunc seek=${METADATA_SECTION_OFFSET}K " + run_cmd "dd if=/dev/urandom of=${CACHE_DEVICE}-part1 bs=1 count=64K conv=notrunc seek=${METADATA_SECTION_OFFSET}K " # Start again with load option, this should fail, metadata is corrupted. - NEGATIVE_TEST_OPTION="1" CACHE_ID_OPTION="1" CACHE_LOAD_METADATA_OPTION="1" CACHE_DEVICE_OPTION="${CACHE_DEVICE}1" start_cache + NEGATIVE_TEST_OPTION="1" CACHE_ID_OPTION="1" CACHE_LOAD_METADATA_OPTION="1" CACHE_DEVICE_OPTION="${CACHE_DEVICE}-part1" start_cache done test_log_stop diff --git a/test/smoke_test/promotion/01 b/test/smoke_test/promotion/01 index bcbaf2d..dc20c75 100755 --- a/test/smoke_test/promotion/01 +++ b/test/smoke_test/promotion/01 @@ -26,7 +26,7 @@ TARGET_DEVICE_OPTION="$CORE_DEVICE" remove_partitions TARGET_DEVICE_OPTION="$CACHE_DEVICE" PARTITION_SIZE_OPTION="2000M" PARTITION_IDS_OPTION="1" make_primary_partitions # create cache in WT mode and try to change promotion parameters -CACHE_MODE_OPTION="wt" CACHE_ID_OPTION="1" CACHE_DEVICE_OPTION="${CACHE_DEVICE}1" CACHE_FORCE_OPTION="1" start_cache +CACHE_MODE_OPTION="wt" CACHE_ID_OPTION="1" CACHE_DEVICE_OPTION="${CACHE_DEVICE}-part1" CACHE_FORCE_OPTION="1" start_cache # changing promotion parameters should not be prohibited while core is added to cache CACHE_ID_OPTION="1" CORE_DEVICE_OPTION="$CORE_DEVICE" add_core @@ -108,7 +108,7 @@ CACHE_ID_OPTION="1" PROMO_POL_NS_OPTION="promotion-nhit" THRESHOLD_OPTION="451" CACHE_ID_OPTION="1" PROMO_POL_NS_OPTION="promotion-nhit" THRESHOLD_OPTION="812" TRIGGER_OPTION="49" set_promotion_params CACHE_ID_OPTION="1" PROMO_POL_OPTION="nhit" set_promotion_policy CACHE_ID_OPTION="1" stop_cache -CACHE_MODE_OPTION="wt" CACHE_ID_OPTION="1" CACHE_DEVICE_OPTION="${CACHE_DEVICE}1" CACHE_LOAD_METADATA_OPTION="1" start_cache +CACHE_MODE_OPTION="wt" CACHE_ID_OPTION="1" CACHE_DEVICE_OPTION="${CACHE_DEVICE}-part1" CACHE_LOAD_METADATA_OPTION="1" start_cache CACHE_ID_OPTION="1" PROMO_POL_OPTION="nhit" check_promotion_policy CACHE_ID_OPTION="1" PROMO_POL_NS_OPTION="promotion-nhit" THRESHOLD_OPTION="812" TRIGGER_OPTION="49" check_promotion_params diff --git a/test/smoke_test/recovery/01 b/test/smoke_test/recovery/01 index 805fae0..efb8fa1 100755 --- a/test/smoke_test/recovery/01 +++ b/test/smoke_test/recovery/01 @@ -28,16 +28,16 @@ TARGET_DEVICE_OPTION="$CACHE_DEVICE" PARTITION_SIZE_OPTION="2000M" PARTITION_IDS TARGET_DEVICE_OPTION="$CORE_DEVICE" PARTITION_SIZE_OPTION="4000M" PARTITION_IDS_OPTION="1 2 3" make_primary_partitions # Start cache on CACHE_DEVICE1 (/dev/sdd1, for example) with ID=1 and add a core device using CORE_DEVICE1 (/dev/sde1, for example) -CACHE_ID_OPTION="1" CACHE_DEVICE_OPTION="${CACHE_DEVICE}1" CACHE_MODE_OPTION="wb" start_cache -CACHE_ID_OPTION="1" CORE_DEVICE_OPTION="${CORE_DEVICE}1" add_core +CACHE_ID_OPTION="1" CACHE_DEVICE_OPTION="${CACHE_DEVICE}-part1" CACHE_MODE_OPTION="wb" start_cache +CACHE_ID_OPTION="1" CORE_DEVICE_OPTION="${CORE_DEVICE}-part1" add_core # Start cache on CACHE_DEVICE2 (/dev/sdd2, for example) with ID=2 and add a core device using CORE_DEVICE2 (/dev/sde2, for example) -CACHE_ID_OPTION="2" CACHE_DEVICE_OPTION="${CACHE_DEVICE}2" CACHE_MODE_OPTION="wb" start_cache -CACHE_ID_OPTION="2" CORE_DEVICE_OPTION="${CORE_DEVICE}2" add_core +CACHE_ID_OPTION="2" CACHE_DEVICE_OPTION="${CACHE_DEVICE}-part2" CACHE_MODE_OPTION="wb" start_cache +CACHE_ID_OPTION="2" CORE_DEVICE_OPTION="${CORE_DEVICE}-part2" add_core # Start cache on CACHE_DEVICE3 (/dev/sdd3, for example) with ID=3 and add a core device using CORE_DEVICE3 (/dev/sde3, for example) -CACHE_ID_OPTION="3" CACHE_DEVICE_OPTION="${CACHE_DEVICE}3" CACHE_MODE_OPTION="wb" start_cache -CACHE_ID_OPTION="3" CORE_DEVICE_OPTION="${CORE_DEVICE}3" add_core +CACHE_ID_OPTION="3" CACHE_DEVICE_OPTION="${CACHE_DEVICE}-part3" CACHE_MODE_OPTION="wb" start_cache +CACHE_ID_OPTION="3" CORE_DEVICE_OPTION="${CORE_DEVICE}-part3" add_core # Create filesystems on cached devices - we do this using run_cmd because it is not in the API (and probably won't be). # The test framework will accept invoking the commands directly (e.g. "mkfs.ext3 [...]" without the "run_cmd"), but the @@ -64,16 +64,17 @@ for ID in 1 2 3 ; do run_cmd "umount ${MOUNTPOINT}-${ID}-1" done +SHORT_LINK=$(realpath ${CACHE_DEVICE}) CACHE_DEVICE_OPTION="${CACHE_DEVICE}" turn_off_device for ID in 1 2 3 ; do DONT_FAIL_ON_ERROR_OPTION="YES" CACHE_ID_OPTION="$ID" stop_cache done -CACHE_DEVICE_OPTION="${CACHE_DEVICE}" turn_on_device +CACHE_DEVICE_OPTION="${SHORT_LINK}" turn_on_device for ID in 1 2 3 ; do - CACHE_ID_OPTION="$ID" CACHE_DEVICE_OPTION="${CACHE_DEVICE}$ID" CACHE_LOAD_METADATA_OPTION="y" CACHE_MODE_OPTION="wb" start_cache + CACHE_ID_OPTION="$ID" CACHE_DEVICE_OPTION="${CACHE_DEVICE}-part${ID}" CACHE_LOAD_METADATA_OPTION="y" CACHE_MODE_OPTION="wb" start_cache CACHE_ID_OPTION="$ID" stop_cache - run_cmd "mount ${CORE_DEVICE}${ID} ${MOUNTPOINT}-${ID}-1" + run_cmd "mount ${CORE_DEVICE}-part${ID} ${MOUNTPOINT}-${ID}-1" done # Now check for files' presence and umount core devices diff --git a/test/smoke_test/recovery/02 b/test/smoke_test/recovery/02 index 792f799..a88fbe9 100755 --- a/test/smoke_test/recovery/02 +++ b/test/smoke_test/recovery/02 @@ -28,16 +28,16 @@ TARGET_DEVICE_OPTION="$CACHE_DEVICE" PARTITION_SIZE_OPTION="2000M" PARTITION_IDS TARGET_DEVICE_OPTION="$CORE_DEVICE" PARTITION_SIZE_OPTION="4000M" PARTITION_IDS_OPTION="1 2 3" make_primary_partitions # Start cache on CACHE_DEVICE1 (/dev/sdd1, for example) with ID=1 and add a core device using CORE_DEVICE1 (/dev/sde1, for example) -CACHE_ID_OPTION="1" CACHE_DEVICE_OPTION="${CACHE_DEVICE}1" CACHE_MODE_OPTION="wb" start_cache -CACHE_ID_OPTION="1" CORE_DEVICE_OPTION="${CORE_DEVICE}1" add_core +CACHE_ID_OPTION="1" CACHE_DEVICE_OPTION="${CACHE_DEVICE}-part1" CACHE_MODE_OPTION="wb" start_cache +CACHE_ID_OPTION="1" CORE_DEVICE_OPTION="${CORE_DEVICE}-part1" add_core # Start cache on CACHE_DEVICE2 (/dev/sdd2, for example) with ID=2 and add a core device using CORE_DEVICE2 (/dev/sde2, for example) -CACHE_ID_OPTION="2" CACHE_DEVICE_OPTION="${CACHE_DEVICE}2" CACHE_MODE_OPTION="wb" start_cache -CACHE_ID_OPTION="2" CORE_DEVICE_OPTION="${CORE_DEVICE}2" add_core +CACHE_ID_OPTION="2" CACHE_DEVICE_OPTION="${CACHE_DEVICE}-part2" CACHE_MODE_OPTION="wb" start_cache +CACHE_ID_OPTION="2" CORE_DEVICE_OPTION="${CORE_DEVICE}-part2" add_core # Start cache on CACHE_DEVICE3 (/dev/sdd3, for example) with ID=3 and add a core device using CORE_DEVICE3 (/dev/sde3, for example) -CACHE_ID_OPTION="3" CACHE_DEVICE_OPTION="${CACHE_DEVICE}3" CACHE_MODE_OPTION="wb" start_cache -CACHE_ID_OPTION="3" CORE_DEVICE_OPTION="${CORE_DEVICE}3" add_core +CACHE_ID_OPTION="3" CACHE_DEVICE_OPTION="${CACHE_DEVICE}-part3" CACHE_MODE_OPTION="wb" start_cache +CACHE_ID_OPTION="3" CORE_DEVICE_OPTION="${CORE_DEVICE}-part3" add_core # Create filesystems on cached devices - we do this using run_cmd because it is not in the API (and probably won't be). # The test framework will accept invoking the commands directly (e.g. "mkfs.ext3 [...]" without the "run_cmd"), but the @@ -64,14 +64,15 @@ for ID in 1 2 3 ; do run_cmd "umount ${MOUNTPOINT}-${ID}-1" done +SHORT_LINK=$(realpath ${CACHE_DEVICE}) CACHE_DEVICE_OPTION="${CACHE_DEVICE}" turn_off_device for ID in 1 2 3 ; do DONT_FAIL_ON_ERROR_OPTION="YES" CACHE_ID_OPTION="$ID" stop_cache done -CACHE_DEVICE_OPTION="${CACHE_DEVICE}" turn_on_device +CACHE_DEVICE_OPTION="${SHORT_LINK}" turn_on_device for ID in 1 2 3 ; do - CACHE_ID_OPTION="$ID" CACHE_DEVICE_OPTION="${CACHE_DEVICE}$ID" CACHE_LOAD_METADATA_OPTION="y" CACHE_MODE_OPTION="wb" start_cache + CACHE_ID_OPTION="$ID" CACHE_DEVICE_OPTION="${CACHE_DEVICE}-part${ID}" CACHE_LOAD_METADATA_OPTION="y" CACHE_MODE_OPTION="wb" start_cache CACHE_ID_OPTION="$ID" CORE_ID_OPTION="1" mount_cache done diff --git a/test/smoke_test/write_back/01 b/test/smoke_test/write_back/01 index e9d6e5d..c9314be 100755 --- a/test/smoke_test/write_back/01 +++ b/test/smoke_test/write_back/01 @@ -36,13 +36,13 @@ wb_init() { TARGET_DEVICE_OPTION="$CORE_DEVICE" PARTITION_SIZE_OPTION=$CORE_DEVICE_SIZE PARTITION_IDS_OPTION="1" make_primary_partitions # Make ext3 file system - TARGET_DEVICE_OPTION="${CORE_DEVICE}1" FILESYSTEM_TYPE="ext3" make_filesystem + TARGET_DEVICE_OPTION="${CORE_DEVICE}-part1" FILESYSTEM_TYPE="ext3" make_filesystem # Start cache on CACHE_DEVICE1 - CACHE_MODE_OPTION="wb" CACHE_ID_OPTION="1" CACHE_DEVICE_OPTION="${CACHE_DEVICE}1" start_cache + CACHE_MODE_OPTION="wb" CACHE_ID_OPTION="1" CACHE_DEVICE_OPTION="${CACHE_DEVICE}-part1" start_cache # Add a core device using CORE_DEVICE1 - CACHE_ID_OPTION="1" CORE_DEVICE_OPTION="${CORE_DEVICE}1" add_core + CACHE_ID_OPTION="1" CORE_DEVICE_OPTION="${CORE_DEVICE}-part1" add_core #Mount file system CACHE_ID_OPTION="1" CORE_ID_OPTION="1" mount_cache