-
Notifications
You must be signed in to change notification settings - Fork 8
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Signed-off-by: klapinsk <[email protected]>
- Loading branch information
1 parent
6b0a70e
commit 5517171
Showing
4 changed files
with
165 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,51 @@ | ||
#!/usr/bin/env bash | ||
|
||
curdir=$(dirname $(readlink -f "${BASH_SOURCE[0]}")) | ||
rootdir=$(readlink -f $curdir/../../..) | ||
source $rootdir/test/ocf/common.sh | ||
source $rootdir/scripts/common.sh | ||
source $rootdir/test/common/autotest_common.sh | ||
rpc_py=$rootdir/scripts/rpc.py | ||
|
||
iterations=50 | ||
cache_modes=("wa" "wb" "wt" "pt" "wo" "wi") | ||
RANDOM=$$$(date +%s) | ||
|
||
# Setup NVMe devices | ||
$rootdir/scripts/setup.sh | ||
|
||
# Create NVMe config | ||
prepare_nvme_config | ||
|
||
# Clear nvme device which we will use in test | ||
clear_nvme | ||
|
||
# Start SPDK app | ||
start_spdk "$curdir/config" | ||
|
||
# Create 2x256MiB partitions on NVMe device | ||
create_partitions Nvme0n1 2 256 | ||
|
||
# Test loop with creating and deleting CAS device | ||
for i in $(eval echo "{1..$iterations}") | ||
do | ||
# Create CAS device | ||
random_cache_mode=${cache_modes[$RANDOM % ${#cache_modes[@]}]} | ||
$rpc_py bdev_ocf_create cas_dev $random_cache_mode Nvme0n1p0 Nvme0n1p1 --create --force | ||
|
||
# Check that CAS device was created properly | ||
$rpc_py bdev_ocf_get_bdevs | jq -r '.[] .name' | grep -qw cas_dev | ||
|
||
# Remove CAS device | ||
$rpc_py bdev_ocf_delete cas_dev | ||
|
||
# Check that CAS device was deleted properly | ||
! $rpc_py bdev_ocf_get_bdevs | jq -r '.[] .name' | grep -qw cas_dev | ||
done | ||
|
||
# Stop SPDK app and cleanup | ||
stop_spdk | ||
|
||
clear_nvme $bdf | ||
|
||
remove_config |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,53 @@ | ||
#!/usr/bin/env bash | ||
|
||
curdir=$(dirname $(readlink -f "${BASH_SOURCE[0]}")) | ||
rootdir=$(readlink -f $curdir/../../..) | ||
source $rootdir/test/ocf/common.sh | ||
source $rootdir/scripts/common.sh | ||
source $rootdir/test/common/autotest_common.sh | ||
rpc_py=$rootdir/scripts/rpc.py | ||
bdevperf=$rootdir/test/bdev/bdevperf/bdevperf | ||
iterations=50 | ||
|
||
# Setup NVMe devices | ||
$rootdir/scripts/setup.sh | ||
|
||
# Create NVMe config | ||
prepare_nvme_config | ||
|
||
# Clear nvme device which we will use in test | ||
clear_nvme | ||
|
||
# Start SPDK app | ||
start_spdk "$curdir/config" | ||
|
||
# Create 2x256MiB partitions on NVMe device | ||
create_partitions Nvme0n1 2 256 | ||
|
||
# Create CAS device | ||
$rpc_py bdev_ocf_create cas_dev wt Nvme0n1p0 Nvme0n1p1 --create --force | ||
|
||
# Check that CAS device was created properly | ||
$rpc_py bdev_ocf_get_bdevs | jq -r '.[] .name' | grep -qw cas_dev | ||
|
||
save_and_clean_bdev_config | ||
stop_spdk | ||
|
||
# Start I/O in background | ||
$bdevperf --json "$curdir/config" -q 128 -o 4096 -w write -t 360 -r /var/tmp/spdk.sock & | ||
bdev_perf_pid=$! | ||
waitforlisten $bdev_perf_pid | ||
sleep 1 | ||
|
||
# Test loop with getting CAS device statistics | ||
for i in $(eval echo "{1..$iterations}") | ||
do | ||
get_stat_json cas_dev | jq | ||
sleep 1 | ||
done | ||
|
||
# Cleanup | ||
kill -9 $bdev_perf_pid | ||
wait $bdev_perf_pid || true | ||
clear_nvme $bdf | ||
remove_config |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,55 @@ | ||
#!/usr/bin/env bash | ||
|
||
curdir=$(dirname $(readlink -f "${BASH_SOURCE[0]}")) | ||
rootdir=$(readlink -f $curdir/../../..) | ||
source $rootdir/test/ocf/common.sh | ||
source $rootdir/scripts/common.sh | ||
source $rootdir/test/common/autotest_common.sh | ||
rpc_py=$rootdir/scripts/rpc.py | ||
|
||
iterations=50 | ||
|
||
# Setup NVMe devices | ||
$rootdir/scripts/setup.sh | ||
|
||
# Create NVMe config | ||
prepare_nvme_config | ||
|
||
# Clear nvme device which we will use in test | ||
clear_nvme | ||
|
||
# Start SPDK app | ||
start_spdk "$curdir/config" | ||
|
||
# Create 2x256MiB partitions on NVMe device and save config | ||
create_partitions Nvme0n1 2 256 | ||
save_and_clean_bdev_config | ||
|
||
# Create CAS device | ||
$rpc_py bdev_ocf_create cas_dev wb Nvme0n1p0 Nvme0n1p1 --create --force | ||
|
||
# Check that CAS device was created properly | ||
$rpc_py bdev_ocf_get_bdevs | jq -r '.[] .name' | grep -qw cas_dev | ||
|
||
# Stop SPDK app | ||
stop_spdk | ||
|
||
# Test loop with loading CAS device | ||
for i in $(eval echo "{1..$iterations}") | ||
do | ||
# Start SPDK app | ||
start_spdk "$curdir/config" | ||
|
||
# Load CAS device | ||
$rpc_py bdev_ocf_create cas_dev wb Nvme0n1p0 Nvme0n1p1 | ||
|
||
# Check that CAS device was loaded properly | ||
$rpc_py bdev_ocf_get_bdevs | jq -r '.[] .name' | grep -qw cas_dev | ||
|
||
# Stop SPDK app | ||
stop_spdk | ||
done | ||
|
||
# Cleanup | ||
clear_nvme $bdf | ||
remove_config |