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

#
# src/test/util_sds/TEST3 -- unittest for shutdown state
#

. ../unittest/unittest.sh

require_test_type medium

require_fs_type any

require_build_type debug

setup

export PMEM2_LOG_LEVEL=2
export PMEM2_LOG_FILE=./test$UNITTEST_NUM.log

# fail during sds creation
expect_normal_exit ./util_sds 1 3 \
				   $DIR/testfile1 5 0 \
				   $DIR/testfile2 7 0 \
				   $DIR/testfile3 9 0

expect_normal_exit ./util_sds 0 0 \
				   $DIR/testfile1 5 0 \
				   $DIR/testfile2 7 0 \
				   $DIR/testfile3 9 0

grep "shutdown_state_check" test$UNITTEST_NUM.log > grep$UNITTEST_NUM.log || true

check

pass
