From 1c781262353eb56e11a83a7f917e4556a79ad4e3 Mon Sep 17 00:00:00 2001 From: Vitaliy Mysak Date: Fri, 12 Apr 2019 18:28:13 +0000 Subject: [PATCH] ocf: test: use all cache modes Modify FIO test to use all cache modes that we support, including WriteBack New test config uses Nvme bdevs instead of mallocs because memory is an issue when testing OCF Signed-off-by: Vitaliy Mysak Reviewed-on: https://review.gerrithub.io/c/spdk/spdk/+/451022 (master) (cherry picked from commit d6f0613d193ba119d7bc43df7d3195ebf61fcf1e) Change-Id: I3abec9605b61791f8ebaaaf08b88a011a50d3f26 Signed-off-by: Tomasz Zawadzki Reviewed-on: https://review.gerrithub.io/c/spdk/spdk/+/457261 Reviewed-by: Darek Stojaczyk Reviewed-by: Ben Walker Tested-by: SPDK CI Jenkins --- test/ocf/integrity/fio-mallocs.sh | 13 ----------- test/ocf/integrity/fio-modes.sh | 38 +++++++++++++++++++++++++++++++ test/ocf/ocf.sh | 2 +- 3 files changed, 39 insertions(+), 14 deletions(-) delete mode 100755 test/ocf/integrity/fio-mallocs.sh create mode 100755 test/ocf/integrity/fio-modes.sh diff --git a/test/ocf/integrity/fio-mallocs.sh b/test/ocf/integrity/fio-mallocs.sh deleted file mode 100755 index 0563475e3..000000000 --- a/test/ocf/integrity/fio-mallocs.sh +++ /dev/null @@ -1,13 +0,0 @@ -#!/usr/bin/env bash - -curdir=$(dirname $(readlink -f "$BASH_SOURCE")) -rootdir=$(readlink -f $curdir/../../..) -plugindir=$rootdir/examples/bdev/fio_plugin - -source $rootdir/test/common/autotest_common.sh - -function fio_verify(){ - LD_PRELOAD=$plugindir/fio_plugin /usr/src/fio/fio $curdir/test.fio --aux-path=/tmp/ --ioengine=spdk_bdev $@ -} - -fio_verify --filename=MalCache1:MalCache2 --spdk_conf=$curdir/mallocs.conf diff --git a/test/ocf/integrity/fio-modes.sh b/test/ocf/integrity/fio-modes.sh new file mode 100755 index 000000000..d4ae0eed8 --- /dev/null +++ b/test/ocf/integrity/fio-modes.sh @@ -0,0 +1,38 @@ +#!/usr/bin/env bash + +curdir=$(dirname $(readlink -f "$BASH_SOURCE")) +rootdir=$(readlink -f $curdir/../../..) +plugindir=$rootdir/examples/bdev/fio_plugin + +source $rootdir/test/common/autotest_common.sh + +function fio_verify(){ + LD_PRELOAD=$plugindir/fio_plugin /usr/src/fio/fio $curdir/test.fio --aux-path=/tmp/ --ioengine=spdk_bdev $@ +} + +function cleanup(){ + rm -f $curdir/modes.conf +} + +trap "cleanup; exit 1" SIGINT SIGTERM EXIT + +nvme_cfg=$($rootdir/scripts/gen_nvme.sh) + +config=" +$nvme_cfg + +[Split] + Split Nvme0n1 8 101 + +[OCF] + OCF PT_Nvme pt Nvme0n1p0 Nvme0n1p1 + OCF WT_Nvme wt Nvme0n1p2 Nvme0n1p3 + OCF WB_Nvme0 wb Nvme0n1p4 Nvme0n1p5 + OCF WB_Nvme1 wb Nvme0n1p6 Nvme0n1p7 +" +echo "$config" > $curdir/modes.conf + +fio_verify --filename=PT_Nvme:WT_Nvme:WB_Nvme0:WB_Nvme1 --spdk_conf=$curdir/modes.conf + +trap - SIGINT SIGTERM EXIT +cleanup diff --git a/test/ocf/ocf.sh b/test/ocf/ocf.sh index d5f793b34..85514d6be 100755 --- a/test/ocf/ocf.sh +++ b/test/ocf/ocf.sh @@ -14,7 +14,7 @@ function suite() timing_enter ocf -suite "$testdir/integrity/fio-mallocs.sh" +suite "$testdir/integrity/fio-modes.sh" suite "$testdir/integrity/bdevperf-iotypes.sh" suite "$testdir/management/create-destruct.sh" suite "$testdir/management/multicore.sh"