Skip to content

Commit e5a807a

Browse files
committed
1. Add test files
2. Add Makefile to run the tests Makefile usage: To run all tests: make To run individual tests: cd tests make pjd.<mode> -- where mode is oneof: (posix,sync,strict)
1 parent dca98b3 commit e5a807a

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

192 files changed

+8297
-0
lines changed

Makefile

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
all:
2+
@echo Nothing here
3+
4+
test:
5+
$(MAKE) -C tests
6+

tests/Makefile

Lines changed: 49 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,49 @@
1+
# Run tests for splitfs
2+
3+
# The current working directory
4+
CWD=$(shell pwd)
5+
# Root of the repo
6+
ROOT=$(CWD)/..
7+
# SplitFS path
8+
SFS_PATH=/mnt/pmem_emul/
9+
# PJD Dir
10+
PJD_DIR=$(CWD)/pjd-fstest-20080816
11+
12+
all: pjd.posix pjd.sync pjd.strict
13+
14+
# Compile with posix specific flags
15+
pjd.posix_compile:
16+
export LEDGER_DATAJ=0 && \
17+
export LEDGER_POSIX=1 && \
18+
$(MAKE) -C ../splitfs clean && \
19+
$(MAKE) -e -C ../splitfs
20+
21+
# Compile with sync specific flags
22+
pjd.sync_compile:
23+
export LEDGER_DATAJ=0 && \
24+
export LEDGER_POSIX=0 && \
25+
$(MAKE) -C ../splitfs clean && \
26+
$(MAKE) -e -C ../splitfs
27+
28+
# Compile with strict specific flags
29+
pjd.strict_compile:
30+
export LEDGER_DATAJ=1 && \
31+
export LEDGER_POSIX=0 && \
32+
$(MAKE) -C ../splitfs clean && \
33+
$(MAKE) -e -C ../splitfs
34+
35+
pjd.compile:
36+
$(MAKE) -C $(PJD_DIR) clean
37+
$(MAKE) -C $(PJD_DIR)
38+
39+
pjd.run:
40+
export LD_LIBRARY_PATH=$(ROOT)/splitfs; \
41+
export NVP_TREE_FILE=$(ROOT)/splitfs/bin/nvp_nvp.tree; \
42+
export LD_PRELOAD=$(ROOT)/splitfs/libnvp.so; \
43+
cd $(SFS_PATH) && prove -r $(PJD_DIR)/tests
44+
45+
pjd.posix: pjd.posix_compile pjd.compile pjd.run
46+
47+
pjd.sync: pjd.sync_compile pjd.compile pjd.run
48+
49+
pjd.strict: pjd.strict_compile pjd.compile pjd.run

tests/pjd-fstest-20080816/LICENSE

Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,27 @@
1+
$FreeBSD: src/tools/regression/fstest/LICENSE,v 1.1 2007/01/17 01:42:07 pjd Exp $
2+
3+
License for all regression tests available with fstest:
4+
5+
Copyright (c) 2006-2007 Pawel Jakub Dawidek <[email protected]>
6+
All rights reserved.
7+
8+
Redistribution and use in source and binary forms, with or without
9+
modification, are permitted provided that the following conditions
10+
are met:
11+
1. Redistributions of source code must retain the above copyright
12+
notice, this list of conditions and the following disclaimer.
13+
2. Redistributions in binary form must reproduce the above copyright
14+
notice, this list of conditions and the following disclaimer in the
15+
documentation and/or other materials provided with the distribution.
16+
17+
THIS SOFTWARE IS PROVIDED BY THE AUTHORS AND CONTRIBUTORS ``AS IS'' AND
18+
ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
19+
IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
20+
ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHORS OR CONTRIBUTORS BE LIABLE
21+
FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
22+
DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
23+
OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
24+
HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
25+
LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
26+
OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
27+
SUCH DAMAGE.

tests/pjd-fstest-20080816/Makefile

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
# $FreeBSD: src/tools/regression/fstest/Makefile,v 1.1 2007/01/17 01:42:07 pjd Exp $
2+
3+
#CFLAGS+=-DHAS_LCHMOD
4+
#CFLAGS+=-DHAS_CHFLAGS
5+
#CFLAGS+=-DHAS_LCHFLAGS
6+
#CFLAGS+=-DHAS_TRUNCATE64
7+
#CFLAGS+=-DHAS_STAT64
8+
9+
all: fstest
10+
11+
fstest: fstest.c
12+
gcc -Wall ${CFLAGS} fstest.c -o fstest
13+
14+
clean:
15+
rm -f fstest

tests/pjd-fstest-20080816/README

Lines changed: 28 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,28 @@
1+
$FreeBSD: src/tools/regression/fstest/README,v 1.1 2007/01/28 00:10:28 pjd Exp $
2+
3+
Few notes on how to use fstest in short steps:
4+
5+
# cd fstest
6+
# vi tests/conf
7+
Change 'fs' to file system type you want to test. These can be:
8+
UFS, ZFS, ext3, ntfs-3g and xfs.
9+
# vi Makefile
10+
You may need to manually tweak few things by editing CFLAGS lines
11+
at the top of the file.
12+
# make
13+
It will compile fstest utility which is used by regression tests.
14+
# cd /path/to/file/system/you/want/to/test/
15+
The test must be run as root user.
16+
# prove -r /path/to/fstest/
17+
18+
That's all. Enjoy.
19+
20+
Currently supported operating systems: FreeBSD, Solaris, Linux.
21+
Currently supported file system types: UFS, ZFS, ext3, ntfs-3g, xfs.
22+
23+
Author:
24+
Pawel Jakub Dawidek <[email protected]>
25+
26+
Linux port:
27+
Jean-Pierre Andre <[email protected]>
28+
Szabolcs Szakacsits <[email protected]>

0 commit comments

Comments
 (0)