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

#
# src/test/pmreorder_simple/TEST4 -- unit test for the reordering script
# Tests positive case using partial reorder engine for section marked as
# the most critical and full reorder engine for other parts of the code.
#

. ../unittest/unittest.sh

require_fs_type pmem non-pmem
require_build_type debug
require_test_type medium
require_pmemcheck_version_ge 1 0
require_pmemcheck_version_lt 2 0
require_pmreorder

setup

# create holey file
truncate -s 4M $DIR/testfile

BIN="./pmreorder_simple$EXESUFFIX"
PMEMCHECK_CMD="$BIN g $DIR/testfile"
PMREORDER_CMD="$BIN c"

pmreorder_create_store_log $DIR/testfile "$PMEMCHECK_CMD"
pmreorder_expect_success ReorderFull pmreorder4.conf "$PMREORDER_CMD"

check

pass
