#!/usr/bin/env bash
# SPDX-License-Identifier: BSD-3-Clause
# Copyright 2018-2020, Intel Corporation

#
# src/test/pmem_deep_persist/TEST8 -- unit test for pmem_deep_persist
#

. ../unittest/unittest.sh

require_test_type medium
require_fs_type any
require_dev_dax_region
require_dax_devices 2

setup

dax_device_zero

export PMEMOBJ_LOG_LEVEL=15

create_poolset $DIR/testset1 AUTO:${DEVICE_DAX_PATH[0]} AUTO:${DEVICE_DAX_PATH[1]} o SINGLEHDR

DEEP_PERSIST_SIZE=$(convert_to_bytes 20M)
OFFSET=0
expect_normal_exit ./pmem_deep_persist$EXESUFFIX $DIR/testset1 o $DEEP_PERSIST_SIZE $OFFSET

count_lines "<libpmemobj>: <3>.*part_deep_common.*" pmemobj$UNITTEST_NUM.log > ./grep$UNITTEST_NUM.log
count_lines "<libpmemobj>: <3>.*deep_flush_write.*" pmemobj$UNITTEST_NUM.log >> ./grep$UNITTEST_NUM.log

check

pass
