#!/usr/bin/env bash
# SPDX-License-Identifier: BSD-3-Clause
# Copyright 2016-2018, Intel Corporation
#
#
# rpmemd_config/TEST3 -- test for rpmemd config overwrite
#

. ../unittest/unittest.sh

require_test_type medium
require_build_type debug
require_fs_type any

setup

RPMEMD=./rpmemd_config$EXESUFFIX

LOG=out${UNITTEST_NUM}.log
LOG_TEMP=out${UNITTEST_NUM}_temp.log
rm -f $LOG $LOG_TEMP

CONFIG=in${UNITTEST_NUM}.conf

CL_LOG_LEVEL=notice

expect_normal_exit $RPMEMD -c $CONFIG
cat $LOG >> $LOG_TEMP

expect_normal_exit $RPMEMD -c $CONFIG\
	--log-file=/cl/log/file/path\
	--poolset-dir=/cl/dir/path\
	--persist-apm\
	--persist-general\
	--use-syslog\
	--log-level=$CL_LOG_LEVEL
cat $LOG >> $LOG_TEMP

$GREP -v rpmemd_config $LOG_TEMP > $LOG

check

pass
