File: runtests.sh

package info (click to toggle)
sleuthkit 4.10.1%2Bdfsg-1
  • links: PTS, VCS
  • area: main
  • in suites: bullseye, sid
  • size: 17,248 kB
  • sloc: ansic: 142,208; cpp: 50,346; java: 27,140; xml: 2,419; perl: 882; python: 508; makefile: 416; sh: 184
file content (101 lines) | stat: -rwxr-xr-x 2,027 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
#!/bin/bash

# NOTE: This script is not currently being used anywhere. 
# it curently runs fs_thread_test on a set of images that
# are not public
#
# This could probably be renamed to something with threadtest in the name


EXIT_SUCCESS=0;
EXIT_FAILURE=1;
EXIT_IGNORE=77;

IMAGE_DIR=${HOME}/from_brian
NTHREADS=1
NITERS=1

check_diffs()
{
	for LOG_FILE in thread-*.log;
	do
		echo diff base.log ${LOG_FILE};
		diff base.log ${LOG_FILE} || return ${EXIT_FAILURE};
	done;

	return ${EXIT_SUCCESS};
}

if ! test -d ${IMAGE_DIR};
then
	echo "Missing image directory: ${IMAGE_DIR}";

	exit ${EXIT_IGNORE};
fi

FS_THREAD_TEST="./fs_thread_test";

if ! test -x ${FS_THREAD_TEST};
then
	FS_THREAD_TEST="./fs_thread_test.exe";
fi

if ! test -x ${FS_THREAD_TEST};
then
	echo "Missing test executable: ${IMAGE_DIR}";

	exit ${EXIT_IGNORE};
fi

rm -f base.log thread-*.log
${FS_THREAD_TEST} -f ext2 ${IMAGE_DIR}/ext2fs.dd 1 1
mv thread-0.log base.log
${FS_THREAD_TEST} -f ext2 ${IMAGE_DIR}/ext2fs.dd ${NTHREADS} ${NITERS}

if ! check_diffs;
then
	exit ${EXIT_FAILURE};
fi

rm -f base.log thread-*.log
${FS_THREAD_TEST} -f ufs ${IMAGE_DIR}/misc-ufs1.dd 1 1
mv thread-0.log base.log
${FS_THREAD_TEST} -f ufs ${IMAGE_DIR}/misc-ufs1.dd ${NTHREADS} ${NITERS}

if ! check_diffs;
then
	exit ${EXIT_FAILURE};
fi

rm -f base.log thread-*.log
${FS_THREAD_TEST} -f hfs -o 64 ${IMAGE_DIR}/test_hfs.dmg 1 1
mv thread-0.log base.log
${FS_THREAD_TEST} -f hfs -o 64 ${IMAGE_DIR}/test_hfs.dmg ${NTHREADS} ${NITERS}

if ! check_diffs;
then
	exit ${EXIT_FAILURE};
fi

rm -f base.log thread-*.log
${FS_THREAD_TEST} -f ntfs ${IMAGE_DIR}/ntfs-img-kw-1.dd 1 1
mv thread-0.log base.log
${FS_THREAD_TEST} -f ntfs ${IMAGE_DIR}/ntfs-img-kw-1.dd ${NTHREADS} ${NITERS}

if ! check_diffs;
then
	exit ${EXIT_FAILURE};
fi

rm -f base.log thread-*.log
${FS_THREAD_TEST} -f fat ${IMAGE_DIR}/fat32.dd 1 1
mv thread-0.log base.log
${FS_THREAD_TEST} -f fat ${IMAGE_DIR}/fat32.dd ${NTHREADS} ${NITERS}

if ! check_diffs;
then
	exit ${EXIT_FAILURE};
fi

exit ${EXIT_SUCCESS};