From 8a00021b2ab5529640e5acaca30a27cdaca04178 Mon Sep 17 00:00:00 2001 From: David Oberhollenzer Date: Wed, 13 Jul 2016 16:10:28 +0200 Subject: Integrate tests into autotools build system Add automake files for the test binaries. If configured to do so, install the test binaries to libexec/mtd-utils and use autoconf to fix the paths in the test scripts. Signed-off-by: David Oberhollenzer Signed-off-by: Richard Weinberger --- tests/fs-tests/stress/Makefile | 11 ------- tests/fs-tests/stress/atoms/Makefile | 40 ----------------------- tests/fs-tests/stress/fs_stress00.sh.in | 58 +++++++++++++++++++++++++++++++++ tests/fs-tests/stress/fs_stress01.sh.in | 46 ++++++++++++++++++++++++++ tests/fs-tests/stress/stress00.sh | 52 ----------------------------- tests/fs-tests/stress/stress01.sh | 40 ----------------------- 6 files changed, 104 insertions(+), 143 deletions(-) delete mode 100644 tests/fs-tests/stress/Makefile delete mode 100644 tests/fs-tests/stress/atoms/Makefile create mode 100755 tests/fs-tests/stress/fs_stress00.sh.in create mode 100755 tests/fs-tests/stress/fs_stress01.sh.in delete mode 100755 tests/fs-tests/stress/stress00.sh delete mode 100755 tests/fs-tests/stress/stress01.sh (limited to 'tests/fs-tests/stress') diff --git a/tests/fs-tests/stress/Makefile b/tests/fs-tests/stress/Makefile deleted file mode 100644 index c24ff3f..0000000 --- a/tests/fs-tests/stress/Makefile +++ /dev/null @@ -1,11 +0,0 @@ - -SUBDIRS = atoms - -all tests: $(SUBDIRS) - -clean: $(SUBDIRS) - rm -rf run_pdf_test_file_* - -.PHONY: $(SUBDIRS) -$(SUBDIRS): - $(MAKE) -C $@ $(MAKECMDGOALS) diff --git a/tests/fs-tests/stress/atoms/Makefile b/tests/fs-tests/stress/atoms/Makefile deleted file mode 100644 index 9fbfd39..0000000 --- a/tests/fs-tests/stress/atoms/Makefile +++ /dev/null @@ -1,40 +0,0 @@ - -ifeq ($(origin CC),default) -CC = gcc -endif - -CFLAGS := $(CFLAGS) -Wall -g -O2 -I../../lib - -LDFLAGS := $(LDFLAGS) - -TARGETS = stress_1 \ - stress_2 \ - stress_3 \ - pdfrun \ - rndwrite00 \ - fwrite00 \ - rmdir00 \ - rndrm00 \ - rndrm99 \ - gcd_hupper - -all: $(TARGETS) - -$(TARGETS): ../../lib/tests.o - -../lib/tests.o: ../../lib/tests.h - -clean: - rm -f *.o $(TARGETS) run_pdf_test_file - -tests: all - ./stress_1 -e - ./stress_2 - ./stress_3 -e - ./pdfrun - ./rndwrite00 -e - ./fwrite00 - ./rmdir00 - ./rndrm00 - ./rndrm99 - ./gcd_hupper diff --git a/tests/fs-tests/stress/fs_stress00.sh.in b/tests/fs-tests/stress/fs_stress00.sh.in new file mode 100755 index 0000000..85ec7a2 --- /dev/null +++ b/tests/fs-tests/stress/fs_stress00.sh.in @@ -0,0 +1,58 @@ +#!/bin/sh + +prefix=@prefix@ +exec_prefix=@exec_prefix@ +bindir=@bindir@ +libexecpath=@libexecdir@/mtd-utils +TESTBINDIR=@testbindir@ + +TEST_DIR=$TEST_FILE_SYSTEM_MOUNT_DIR +if test -z "$TEST_DIR"; +then + TEST_DIR="/mnt/test_file_system" +fi + +FREESPACE=`$TESTBINDIR/free_space "$TEST_DIR"` + +if test -z "$FREESPACE"; +then + echo "Failed to determine free space" + exit 1 +fi + +if test -n "$1"; +then + DURATION="-d$1"; +else + DURATION=""; +fi + +FWRITE00=$TESTBINDIR/fwrite00 +RNDWR=$TESTBINDIR/rndwrite00 +GCHUP=$TESTBINDIR/gcd_hupper +PDFLUSH=$TESTBINDIR/pdfrun +FSIZE=$(( $FREESPACE/15 )); + +$TESTBINDIR/fstest_monitor $DURATION \ +"$FWRITE00 -z $FSIZE -n0 -p 20" \ +"$FWRITE00 -z $FSIZE -n0 -p 10 -s" \ +"$FWRITE00 -z $FSIZE -n0 -p 20 -u" \ +"$FWRITE00 -z $FSIZE -n0 -p 70 -o" \ +"$FWRITE00 -z $FSIZE -n0 -p 15 -s -o -u" \ +"$FWRITE00 -z $FSIZE -n0 -p 10 -u -c" \ +"$FWRITE00 -z $FSIZE -n0 -p 10 -u -o -c" \ +"$FWRITE00 -z $FSIZE -n0 -p 10 -o -c" \ +"$FWRITE00 -z $FSIZE -n0 -p 100 -o -u" \ +"$FWRITE00 -z $FSIZE -n0 -p 100 -s -o -u -c" \ +"$FWRITE00 -z $FSIZE -n0 -p 100 -o -u" \ +"$FWRITE00 -z $FSIZE -n0 -p 100 -u" \ +"$FWRITE00 -z $FSIZE -n0 -p 100 -s -o" \ +"$RNDWR -z $FSIZE -n0 -p 10 -e" \ +"$RNDWR -z $FSIZE -n0 -p 100 -e" \ +"$PDFLUSH -z 1073741824 -n0" + +STATUS=$? + +rm -rf ${TEST_DIR}/* + +exit $STATUS diff --git a/tests/fs-tests/stress/fs_stress01.sh.in b/tests/fs-tests/stress/fs_stress01.sh.in new file mode 100755 index 0000000..d0ea8f9 --- /dev/null +++ b/tests/fs-tests/stress/fs_stress01.sh.in @@ -0,0 +1,46 @@ +#!/bin/sh + +prefix=@prefix@ +exec_prefix=@exec_prefix@ +bindir=@bindir@ +libexecpath=@libexecdir@/mtd-utils +TESTBINDIR=@testbindir@ + +TEST_DIR=$TEST_FILE_SYSTEM_MOUNT_DIR +if test -z "$TEST_DIR"; +then + TEST_DIR="/mnt/test_file_system" +fi + +FREESPACE=`$TESTBINDIR/free_space "$TEST_DIR"` + +if test -z "$FREESPACE"; +then + echo "Failed to determine free space" + exit 1 +fi + +if test -n "$1"; +then + DURATION="-d$1"; +else + DURATION=""; +fi + +FWRITE00=$TESTBINDIR/fwrite00 +RNDWR=$TESTBINDIR/rndwrite00 +PDFLUSH=$TESTBINDIR/pdfrun +FSIZE=$(( $FREESPACE/15 )); + +$TESTBINDIR/fstest_monitor $DURATION \ +"$FWRITE00 -z $FSIZE -n0 -p 300" \ +"$FWRITE00 -z $FSIZE -n0 -u" \ +"$FWRITE00 -z $FSIZE -n0 -u -c" \ +"$FWRITE00 -z $FSIZE -n0 -s -o" \ +"$RNDWR -z $FSIZE -n0 -e" + +STATUS=$? + +rm -rf ${TEST_DIR}/* + +exit $STATUS diff --git a/tests/fs-tests/stress/stress00.sh b/tests/fs-tests/stress/stress00.sh deleted file mode 100755 index 60f8c0d..0000000 --- a/tests/fs-tests/stress/stress00.sh +++ /dev/null @@ -1,52 +0,0 @@ -#!/bin/sh - -TEST_DIR=$TEST_FILE_SYSTEM_MOUNT_DIR -if test -z "$TEST_DIR"; -then - TEST_DIR="/mnt/test_file_system" -fi - -FREESPACE=`../utils/free_space "$TEST_DIR"` - -if test -z "$FREESPACE"; -then - echo "Failed to determine free space" - exit 1 -fi - -if test -n "$1"; -then - DURATION="-d$1"; -else - DURATION=""; -fi - -FWRITE00=atoms/fwrite00 -RNDWR=atoms/rndwrite00 -GCHUP=atoms/gcd_hupper -PDFLUSH=atoms/pdfrun -FSIZE=$(( $FREESPACE/15 )); - -../utils/fstest_monitor $DURATION \ -"$FWRITE00 -z $FSIZE -n0 -p 20" \ -"$FWRITE00 -z $FSIZE -n0 -p 10 -s" \ -"$FWRITE00 -z $FSIZE -n0 -p 20 -u" \ -"$FWRITE00 -z $FSIZE -n0 -p 70 -o" \ -"$FWRITE00 -z $FSIZE -n0 -p 15 -s -o -u" \ -"$FWRITE00 -z $FSIZE -n0 -p 10 -u -c" \ -"$FWRITE00 -z $FSIZE -n0 -p 10 -u -o -c" \ -"$FWRITE00 -z $FSIZE -n0 -p 10 -o -c" \ -"$FWRITE00 -z $FSIZE -n0 -p 100 -o -u" \ -"$FWRITE00 -z $FSIZE -n0 -p 100 -s -o -u -c" \ -"$FWRITE00 -z $FSIZE -n0 -p 100 -o -u" \ -"$FWRITE00 -z $FSIZE -n0 -p 100 -u" \ -"$FWRITE00 -z $FSIZE -n0 -p 100 -s -o" \ -"$RNDWR -z $FSIZE -n0 -p 10 -e" \ -"$RNDWR -z $FSIZE -n0 -p 100 -e" \ -"$PDFLUSH -z 1073741824 -n0" - -STATUS=$? - -rm -rf ${TEST_DIR}/* - -exit $STATUS diff --git a/tests/fs-tests/stress/stress01.sh b/tests/fs-tests/stress/stress01.sh deleted file mode 100755 index 5913c1c..0000000 --- a/tests/fs-tests/stress/stress01.sh +++ /dev/null @@ -1,40 +0,0 @@ -#!/bin/sh - -TEST_DIR=$TEST_FILE_SYSTEM_MOUNT_DIR -if test -z "$TEST_DIR"; -then - TEST_DIR="/mnt/test_file_system" -fi - -FREESPACE=`../utils/free_space "$TEST_DIR"` - -if test -z "$FREESPACE"; -then - echo "Failed to determine free space" - exit 1 -fi - -if test -n "$1"; -then - DURATION="-d$1"; -else - DURATION=""; -fi - -FWRITE00=atoms/fwrite00 -RNDWR=atoms/rndwrite00 -PDFLUSH=atoms/pdfrun -FSIZE=$(( $FREESPACE/15 )); - -../utils/fstest_monitor $DURATION \ -"$FWRITE00 -z $FSIZE -n0 -p 300" \ -"$FWRITE00 -z $FSIZE -n0 -u" \ -"$FWRITE00 -z $FSIZE -n0 -u -c" \ -"$FWRITE00 -z $FSIZE -n0 -s -o" \ -"$RNDWR -z $FSIZE -n0 -e" - -STATUS=$? - -rm -rf ${TEST_DIR}/* - -exit $STATUS -- cgit v1.2.3