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

#
# src/test/obj_pool/TEST6 -- unit test for pmemobj_create
#

. ../unittest/unittest.sh

require_test_type medium

setup
umask 0

touch $DIR/testfile
chmod 0640 $DIR/testfile

#
# TEST6 existing file, file length < min required size, poolsize == 0,
#       layout string is too long
#
LAYOUT=$(tr -cd '[:alnum:]' < /dev/urandom 2>/dev/null | head -c1024)
[ $(echo $LAYOUT | wc -c) -ne 1025 ] && fatal "'tr' error"

expect_normal_exit ./obj_pool$EXESUFFIX c $DIR/testfile $LAYOUT 0 0640

check_files $DIR/testfile

check

pass
