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

#
# src/test/util_is_poolset/TEST0 -- unit test for util_is_poolset
#

. ../unittest/unittest.sh

require_test_type medium

require_fs_type any

setup

create_poolset $DIR/pool.set 32K:$DIR/testfile:x
expect_normal_exit $PMEMPOOL$EXESUFFIX create obj $DIR/pool.obj
echo "NOT_PMEMPOOLSET" > $DIR/not_pool.set
echo "PMEMPOOL" > $DIR/too_short.set
touch $DIR/empty.set

expect_normal_exit ./util_is_poolset$EXESUFFIX\
	$DIR/pool.set\
	$DIR/not_pool.set\
	$DIR/too_short.set\
	$DIR/pool.obj\
	$DIR/empty.set\
	$DIR/not_exist.set

check

pass
