#!/bin/bash

## Utility library for managing the Linux Kernel ND (NFIT-defined/NVDIMM) Subsystem
## detailed info can refer to https://github.com/pmem/ndctl

shopt -s nullglob

. $LKP_SRC/lib/debug.sh
. $LKP_SRC/lib/reproduce-log.sh

[[ -x "/lkp/benchmarks/bin/ndctl" ]] || die "Can not find executable ndctl file"

#1) check if nfit_test and its dependencies are available on local host
#2) avoid the following debug output:
#   could not open '/sys/module/XXX/initstate': No such file or directory
#   could not open '/sys/module/XXX': No such file or directory
modprobe nfit_test || die "Can not load nfit_test module and its dependencies"

/lkp/benchmarks/bin/ndctl test 2>&1

exit 0
