#!/usr/bin/env bash
# SPDX-License-Identifier: BSD-3-Clause
# Copyright 2014-2019, Intel Corporation
#
#
# pmempool_check/TEST9 -- test for checking pmemobj pool
#

. ../unittest/unittest.sh

require_test_type medium

require_fs_type pmem non-pmem

setup

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

expect_normal_exit $PMEMPOOL$EXESUFFIX create obj $POOL

expect_normal_exit $PMEMPOOL$EXESUFFIX check -vyr $POOL >> $LOG

$PMEMSPOIL -v $POOL pool_hdr.major=0x0\
			pool_hdr.features.compat=0xfe\
			pool_hdr.features.incompat=0xfb\
			pool_hdr.features.ro_compat=0xff\
			pool_hdr.shutdown_state.usc=0\
			pool_hdr.shutdown_state.uuid=0\
			'pool_hdr.shutdown_state.f:checksum_gen'\
			pool_hdr.unused=ERROR >> $LOG

expect_abnormal_exit $PMEMPOOL$EXESUFFIX check -vyr $POOL >> $LOG

check

pass
