#!/usr/bin/env bash
#
# SPDX-License-Identifier: BSD-3-Clause
# Copyright 2014-2019, Intel Corporation
# Copyright 2019, IBM Corporation

#
# src/test/blk_rw/TEST18 -- unit test for pmemblk_read/write/set_zero/set_error
#
# This test is equivalent of TEST4 for ppc64le platform.
#

. ../unittest/unittest.sh

require_test_type medium
require_ppc64

# doesn't make sense to run in local directory
require_fs_type pmem non-pmem

setup

# write re-use test case
truncate -s 1G $DIR/testfile1
expect_normal_exit ./blk_rw$EXESUFFIX 512 $DIR/testfile1 c\
	w:0 w:1 w:2 w:3 w:4 r:4 r:3 r:2 r:1 r:0
expect_normal_exit ./blk_rw$EXESUFFIX 512 $DIR/testfile1 o\
	w:0 r:4 r:3 r:2 r:1 r:0 w:0 r:0

check_pool $DIR/testfile1

check

pass
