Commit a3cb1deb authored by Marcin Dziegielewski's avatar Marcin Dziegielewski Committed by Jim Harris
Browse files

test/ocf: change backend device in persistent-metadata test



This patch is related to issue #815. To avoid hung and re-enable
testing this part of ocf, this patch changes backed device from aio to
nvme.

Hung in this test was caused by implementation of AIO bdev and bdev layer.
All AIO bdevs are using the same shared context with limited queue depth,
so in some cases AIO can return NOMEM status. It's ok when we have more
than one IO from bdev layer perspective, if not we will stuck because
nothing will triger retry io procedure.

This patch only enables testing and are not fixing root cause of hung.

To prevent before unexpected behavior of this and next one test we
need to clear ocf metadata on nvme device.

This patch also reenables this test in CI.

Signed-off-by: default avatarMarcin Dziegielewski <marcin.dziegielewski@intel.com>
Change-Id: Ibab4aefb9aaf33d725db20345bd5c09c1e5eebdd
Reviewed-on: https://review.gerrithub.io/c/spdk/spdk/+/463605


Tested-by: default avatarSPDK CI Jenkins <sys_sgci@intel.com>
Reviewed-by: default avatarTomasz Zawadzki <tomasz.zawadzki@intel.com>
Reviewed-by: default avatarJim Harris <james.r.harris@intel.com>
Reviewed-by: default avatarBroadcom SPDK FC-NVMe CI <spdk-ci.pdl@broadcom.com>
Reviewed-by: default avatarVitaliy Mysak <vitaliy.mysak@intel.com>
parent c2d85bb2
Loading
Loading
Loading
Loading
+38 −25
Original line number Diff line number Diff line
@@ -2,29 +2,40 @@

curdir=$(dirname $(readlink -f "$BASH_SOURCE"))
rootdir=$(readlink -f $curdir/../../..)
source $rootdir/scripts/common.sh
source $rootdir/test/common/autotest_common.sh

function clear_nvme()
{
        # Clear metadata on NVMe device
        $rootdir/scripts/setup.sh reset
        sleep 1
        name=$(get_nvme_name_from_bdf $1)
        mountpoints=$(lsblk /dev/$blkname --output MOUNTPOINT -n | wc -w)
        if [ "$mountpoints" != "0" ]; then
                $rootdir/scripts/setup.sh
                exit 1
        fi
        dd if=/dev/zero of=/dev/$name bs=1M count=1000 oflag=direct
        $rootdir/scripts/setup.sh
}

rpc_py=$rootdir/scripts/rpc.py

rm -f aio*
truncate -s 128M aio0
truncate -s 128M aio1
truncate -s 128M aio2
truncate -s 128M aio3
truncate -s 128M aio4
truncate -s 128M aio5
truncate -s 128M aio6

echo "
[AIO]
  AIO ./aio0 aio0 512
  AIO ./aio1 aio1 512
  AIO ./aio2 aio2 512
  AIO ./aio3 aio3 512
  AIO ./aio4 aio4 512
  AIO ./aio5 aio5 512
  AIO ./aio6 aio6 512
" > $curdir/config
nvme_cfg=$($rootdir/scripts/gen_nvme.sh)

config="
$nvme_cfg

[Split]
  Split Nvme0n1 7 128
"
echo "$config" > $curdir/config

# Clear only nvme device which we will use in test
bdf=$($rootdir/scripts/gen_nvme.sh --json | jq '.config[0].params.traddr' | sed s/\"//g)

clear_nvme $bdf

$rootdir/app/iscsi_tgt/iscsi_tgt -c $curdir/config &
spdk_pid=$!
@@ -33,10 +44,10 @@ waitforlisten $spdk_pid

# Create ocf on persistent storage

$rpc_py construct_ocf_bdev ocfWT  wt aio0 aio1
$rpc_py construct_ocf_bdev ocfPT  pt aio2 aio3
$rpc_py construct_ocf_bdev ocfWB0 wb aio4 aio5
$rpc_py construct_ocf_bdev ocfWB1 wb aio4 aio6
$rpc_py construct_ocf_bdev ocfWT  wt Nvme0n1p0 Nvme0n1p1
$rpc_py construct_ocf_bdev ocfPT  pt Nvme0n1p2 Nvme0n1p3
$rpc_py construct_ocf_bdev ocfWB0 wb Nvme0n1p4 Nvme0n1p5
$rpc_py construct_ocf_bdev ocfWB1 wb Nvme0n1p4 Nvme0n1p6

# Sorting bdevs because we dont guarantee that they are going to be
# in the same order after shutdown
@@ -50,7 +61,7 @@ killprocess $spdk_pid
$rootdir/app/iscsi_tgt/iscsi_tgt -c $curdir/config &
spdk_pid=$!

trap 'killprocess $spdk_pid; exit 1' SIGINT SIGTERM EXIT
trap 'killprocess $spdk_pid; rm -f $curdir/config ocf_bdevs ocf_bdevs_verify; exit 1' SIGINT SIGTERM EXIT

waitforlisten $spdk_pid

@@ -63,4 +74,6 @@ diff ocf_bdevs ocf_bdevs_verify
trap - SIGINT SIGTERM EXIT

killprocess $spdk_pid
rm -f aio* $curdir/config ocf_bdevs ocf_bdevs_verify
rm -f $curdir/config ocf_bdevs ocf_bdevs_verify

clear_nvme $bdf
+1 −2
Original line number Diff line number Diff line
@@ -18,8 +18,7 @@ suite "$testdir/integrity/fio-modes.sh"
suite "$testdir/integrity/bdevperf-iotypes.sh"
suite "$testdir/management/create-destruct.sh"
suite "$testdir/management/multicore.sh"
# disabled due to intermittent failures. See github isssue #815
#suite "$testdir/management/persistent-metadata.sh"
suite "$testdir/management/persistent-metadata.sh"

timing_exit ocf
report_test_completion "ocf"