#!/usr/bin/env bash
# SPDX-License-Identifier: BSD-3-Clause
# Copyright 2014-2023, Intel Corporation
#
#
# pmempool_create/TEST3 -- test for inheriting pools
#

. ../unittest/unittest.sh

require_test_type medium

require_fs_type pmem non-pmem

setup

POOL=$DIR/file.pool
INHERIT=$DIR/inherit.pool

# PMEMOBJ
rm -f $POOL
rm -f $INHERIT
expect_normal_exit $PMEMPOOL$EXESUFFIX create --layout=LAYOUT_NAME$SUFFIX obj $POOL
check_file $POOL
check_signature PMEMOBJ $POOL
check_layout LAYOUT_NAME$SUFFIX $POOL
SIZE=$(get_size $POOL)
expect_normal_exit $PMEMPOOL$EXESUFFIX create --inherit $POOL $INHERIT
check_file $INHERIT
check_signature PMEMOBJ $INHERIT
check_layout LAYOUT_NAME$SUFFIX $POOL
check_size $SIZE $INHERIT

pass
