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

#
# src/test/util_poolset_parse/TEST1 -- unit test for parsing a pool set file
#

. ../unittest/unittest.sh

require_test_type medium

require_build_type debug
require_fs_type any
require_dax_devices 1

setup

export PARSER_LOG_LEVEL=4
export PARSER_LOG_FILE=./parser$UNITTEST_NUM.log

create_poolset $DIR/testset1 AUTO:$DEVICE_DAX_PATH

create_poolset $DIR/testset2 AUTO:$DEVICE_DAX_PATH 100G:$DIR/testfile1:x

create_poolset $DIR/testset3 AUTO:$DEVICE_DAX_PATH\
	r\
	100G:$DIR/testfile3:x

POOLSETS="$DIR/testset1 $DIR/testset2 $DIR/testset3"

expect_normal_exit ./util_poolset_parse$EXESUFFIX t $POOLSETS

$GREP -e "<[14]>.*\[.*util_poolset_parse\]" ./parser$UNITTEST_NUM.log | \
	sed -e "s/^.*util_poolset_parse][ ]*//g" > grep$UNITTEST_NUM.log

check

pass
