#!/usr/bin/env bash
# SPDX-License-Identifier: BSD-3-Clause
# Copyright 2016-2018, Intel Corporation
#
#
# libpmempool_rm/TEST4 -- test for pmempool_rm with opened files
#

. ../unittest/unittest.sh

require_test_type medium

require_fs_type any

setup

enable_log_append

create_poolset $DIR/pool.set 32M:$DIR/pool.obj.1:x 32M:$DIR/pool.obj.2:x

expect_normal_exit $PMEMPOOL$EXESUFFIX create obj $DIR/pool.obj
expect_normal_exit $PMEMPOOL$EXESUFFIX create obj $DIR/pool.set
check_files $DIR/pool.obj $DIR/pool.set $DIR/pool.obj.1

expect_normal_exit ./libpmempool_rm$EXESUFFIX -o $DIR/pool.obj
check_files $DIR/pool.obj

expect_normal_exit ./libpmempool_rm$EXESUFFIX -o $DIR/pool.set
check_files $DIR/pool.set $DIR/pool.obj.1 $DIR/pool.obj.2

check

pass
