#!/usr/bin/env bash
# SPDX-License-Identifier: BSD-3-Clause
# Copyright 2016-2023, Intel Corporation
#
#
# libpmempool_rm/TEST0 -- test for pmempool_rm with single-file pool
#

. ../unittest/unittest.sh

require_test_type medium

require_fs_type any

setup

enable_log_append

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

# this should remove the pool file
expect_normal_exit ./libpmempool_rm$EXESUFFIX $DIR/pool.obj

# check if the file is removed
check_no_files $DIR/pool.obj

# this should report errors
expect_normal_exit ./libpmempool_rm$EXESUFFIX $DIR/pool.obj
# this should ignore all errors
expect_normal_exit ./libpmempool_rm$EXESUFFIX -f $DIR/pool.obj

check

pass
