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

#
# src/test/util_file_open/TEST0 -- unit test for util_file_open()
#

. ../unittest/unittest.sh

require_test_type medium

require_fs_type any

setup

MIN_POOL=0x4000

truncate -s 1K $DIR/testfile1
truncate -s 32K $DIR/testfile2
mkdir $DIR/testdir1
ln -s testfile0 $DIR/testlink0
ln -s testdir1 $DIR/testlink1
ln -s /dev/zero $DIR/testlink2

expect_normal_exit ./util_file_open$EXESUFFIX $MIN_POOL \
    $DIR/testdir1\
    /dev/zero\
    $DIR/testlink0\
    $DIR/testlink1\
    $DIR/testlink2\
    $DIR/testfile0\
    $DIR/testfile1\
    $DIR/testfile2

check

pass
