@@ -27,7 +27,9 @@ TESTS =\
max_available_extent_ns.sh \
pfn-meta-errors.sh
-EXTRA_DIST = $(TESTS)
+EXTRA_DIST = $(TESTS) common \
+ btt-pad-compat.xxd \
+ nmem1.bin nmem2.bin nmem3.bin nmem4.bin
check_PROGRAMS =\
libndctl \
@@ -15,7 +15,7 @@ set -e
rc=77
-. ./common
+. $(dirname $0)/common
check_min_kver "4.11" || do_skip "may lack blk-exhaustion fix"
@@ -19,7 +19,7 @@ blockdev=""
bs=4096
rc=77
-. ./common
+. $(dirname $0)/common
trap 'err $LINENO' ERR
@@ -16,14 +16,14 @@ FILE=image
blockdev=""
rc=77
-. ./common
+. $(dirname $0)/common
cleanup()
{
rm -f $FILE
rm -f $MNT/$FILE
- if [ -n "$blockdev" ]; then
- umount "/dev/$blockdev"
+ if grep -q "$MNT" /proc/mounts; then
+ umount $MNT
else
rc=77
fi
@@ -160,5 +160,6 @@ dd if=/dev/$blockdev of=/dev/null iflag=direct bs=4096 count=1 && err $LINENO ||
$NDCTL disable-region -b $NFIT_TEST_BUS0 all
$NDCTL zero-labels -b $NFIT_TEST_BUS0 all
$NDCTL enable-region -b $NFIT_TEST_BUS0 all
+cleanup
_cleanup
exit 0
@@ -16,7 +16,8 @@ size=""
blockdev=""
rc=77
-. ./common
+BASE=$(dirname $0)
+. $BASE/common
trap 'err $LINENO' ERR
@@ -107,7 +108,7 @@ force_raw()
copy_xxd_img()
{
local bdev="$1"
- local xxd_patch="btt-pad-compat.xxd"
+ local xxd_patch="$BASE/btt-pad-compat.xxd"
test -s "$xxd_patch"
test -b "$bdev"
@@ -15,7 +15,7 @@ set -e
rc=77
-. ./common
+. $(dirname $0)/common
check_min_kver "4.6" || do_skip "lacks clear poison support"
@@ -16,7 +16,7 @@ set -e
SECTOR_SIZE="4096"
rc=77
-. ./common
+. $(dirname $0)/common
check_min_kver "4.5" || do_skip "may lack namespace mode attribute"
@@ -11,7 +11,7 @@
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
# General Public License for more details.
-. ./common
+. $(dirname $0)/common
MNT=test_dax_mnt
FILE=image
@@ -3,7 +3,7 @@
# Copyright(c) 2019 Intel Corporation. All rights reserved.
rc=77
-. ./common
+. $(dirname $0)/common
trap 'cleanup $LINENO' ERR
@@ -15,7 +15,7 @@ set -e
rc=77
-. ./common
+. $(dirname $0)/common
check_min_kver "4.12" || do_skip "lacks dax dev error handling"
@@ -11,7 +11,7 @@
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
# General Public License for more details.
-. ./common
+. $(dirname $0)/common
rc=77
@@ -6,7 +6,7 @@ rc=77
dev=""
image="update-fw.img"
-. ./common
+. $(dirname $0)/common
trap 'err $LINENO' ERR
@@ -18,7 +18,7 @@ rc=77
err_block=42
err_count=8
-. ./common
+. $(dirname $0)/common
trap 'err $LINENO' ERR
@@ -3,7 +3,7 @@
# Copyright(c) 2018 Intel Corporation. All rights reserved.
rc=77
-. ./common
+. $(dirname $0)/common
bus="$NFIT_TEST_BUS0"
inj_val="42"
@@ -15,7 +15,8 @@ set -e
rc=77
-. ./common
+BASE=$(dirname $0)
+. $BASE/common
check_min_kver "4.11" || do_skip "may not provide reliable isetcookie values"
@@ -36,7 +37,7 @@ dimms=$($NDCTL list -DRi -r $region | jq -r "$query" | xargs)
i=1
for d in $dimms
do
- $NDCTL write-labels $d -i nmem${i}.bin
+ $NDCTL write-labels $d -i $BASE/nmem${i}.bin
i=$((i+1))
done
@@ -5,7 +5,7 @@
rc=77
-. ./common
+. $(dirname $0)/common
trap 'err $LINENO' ERR
@@ -11,7 +11,7 @@
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
# General Public License for more details.
-. ./common
+. $(dirname $0)/common
MNT=test_mmap_mnt
FILE=image
@@ -12,7 +12,7 @@ monitor_regions=""
monitor_namespace=""
smart_supported_bus=""
-. ./common
+. $(dirname $0)/common
trap 'err $LINENO' ERR
@@ -15,7 +15,7 @@ set -e
rc=77
-. ./common
+. $(dirname $0)/common
check_min_kver "4.13" || do_skip "may lack multi-dax support"
@@ -6,7 +6,7 @@
blockdev=""
rc=77
-. ./common
+. $(dirname $0)/common
force_raw()
{
@@ -6,7 +6,7 @@ MNT=test_dax_mnt
FILE=image
rc=77
-. ./common
+. $(dirname $0)/common
cleanup()
{
@@ -113,14 +113,7 @@ echo $((start_sect + 1)) 1 > /sys/block/$blockdev/badblocks
: The following 'dd' is expected to hit an I/O Error
dd if=$MNT/$FILE of=/dev/null iflag=direct bs=4096 count=1 && err $LINENO || true
-# cleanup
-rm -f $FILE
-rm -f $MNT/$FILE
-if [ -n "$blockdev" ]; then
- umount /dev/$blockdev
-fi
-rmdir $MNT
-
+cleanup
_cleanup
exit 0
@@ -7,7 +7,7 @@ size=""
blockdev=""
rc=77
-. ./common
+. $(dirname $0)/common
trap 'err $LINENO' ERR
@@ -13,7 +13,7 @@
rc=77
-. ./common
+. $(dirname $0)/common
set -e
trap 'err $LINENO' ERR
@@ -11,7 +11,7 @@ masterpath="$keypath/$masterkey.blob"
backup_key=0
backup_handle=0
-. ./common
+. $(dirname $0)/common
trap 'err $LINENO' ERR
- Add missing dependencies to EXTRA_DIST - Fix up relative path names - Fix up test cleanup to not leave straggling file behind Reported-by: Auke Kok <auke-jan.h.kok@intel.com> Signed-off-by: Dan Williams <dan.j.williams@intel.com> --- test/Makefile.am | 4 +++- test/blk-exhaust.sh | 2 +- test/btt-check.sh | 2 +- test/btt-errors.sh | 7 ++++--- test/btt-pad-compat.sh | 5 +++-- test/clear.sh | 2 +- test/create.sh | 2 +- test/dax.sh | 2 +- test/daxctl-devices.sh | 2 +- test/daxdev-errors.sh | 2 +- test/device-dax-fio.sh | 2 +- test/firmware-update.sh | 2 +- test/inject-error.sh | 2 +- test/inject-smart.sh | 2 +- test/label-compat.sh | 5 +++-- test/max_available_extent_ns.sh | 2 +- test/mmap.sh | 2 +- test/monitor.sh | 2 +- test/multi-dax.sh | 2 +- test/pfn-meta-errors.sh | 2 +- test/pmem-errors.sh | 11 ++--------- test/rescan-partitions.sh | 2 +- test/sector-mode.sh | 2 +- test/security.sh | 2 +- 24 files changed, 34 insertions(+), 36 deletions(-)