#!/usr/bin/env bash
# SPDX-License-Identifier: BSD-3-Clause
# Copyright 2014-2018, Intel Corporation
#
#
# pmempool_info/TEST14 -- test for info command
#

. ../unittest/unittest.sh

require_test_type medium

require_fs_type pmem non-pmem

require_sds $PMEMPOOL$EXESUFFIX

setup

require_usc_permission $DIR

POOL=$DIR/file.pool
LOG=out${UNITTEST_NUM}.log
rm -f $LOG && touch $LOG

expect_normal_exit $PMEMPOOL$EXESUFFIX create --layout "pmempool$SUFFIX" obj $POOL
expect_normal_exit $PMEMPOOL$EXESUFFIX feature --enable SHUTDOWN_STATE $POOL
expect_abnormal_exit $PMEMALLOC$EXESUFFIX -o 1 -t 1 -ea $POOL
expect_normal_exit $PMEMPOOL$EXESUFFIX info -l -R -a $POOL >> $LOG
echo >> $LOG
expect_abnormal_exit $PMEMALLOC$EXESUFFIX -o 1 -t 1 -s -es $POOL
expect_normal_exit $PMEMPOOL$EXESUFFIX info -l -R $POOL >> $LOG
echo >> $LOG
expect_abnormal_exit $PMEMALLOC$EXESUFFIX -o 1024 -t 1 -s -es $POOL
expect_normal_exit $PMEMPOOL$EXESUFFIX info -l -R $POOL >> $LOG
echo >> $LOG
expect_abnormal_exit $PMEMALLOC$EXESUFFIX -o 1 -t 1 -s -f -ef $POOL
expect_normal_exit $PMEMPOOL$EXESUFFIX info -l -R -a $POOL >> $LOG

check

pass
