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

#
# src/test/blk_pool/TEST40 -- create a pool with the smallest parts
# possible
#
# This test is equivalent of TEST33 for ppc64le platform.
#

. ../unittest/unittest.sh

require_test_type medium
require_ppc64

setup
umask 0

#
# TEST40 non-existing file, poolsize >= min required size, bsize > min bsize
#        part size == min part size (pool set)
#
CMD="$DIR/testset"
MIN_PART=$((2 * 1024 * 1024)) # 2MiB
for i in {1..9}; do
	CMD="$CMD $MIN_PART:$DIR/testfile$i:x"
done
create_poolset $CMD

expect_normal_exit ./blk_pool$EXESUFFIX c $DIR/testset 100 0 0640

check_files $DIR/testset $DIR/testfile1 $DIR/testfile2 $DIR/testfile3 \
    $DIR/testfile4 $DIR/testfile5 $DIR/testfile6 $DIR/testfile7 $DIR/testfile8 \
    $DIR/testfile9

check

pass
