File: test_self

package info (click to toggle)
burp 3.1.4-5
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid
  • size: 3,684 kB
  • sloc: ansic: 50,989; sh: 3,612; cpp: 2,859; makefile: 868
file content (50 lines) | stat: -rwxr-xr-x 1,282 bytes parent folder | download | duplicates (3)
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
#!/usr/bin/env bash
#
# Test a burp client on the same machine as the server.

DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)"
cd "$DIR"

path="$PWD"
build="$path/build"
target="$path/target"

if ! [ -c /dev/random -o -c /dev/urandom ] &&
   ! [ -e /var/run/egd-pool -o -e /dev/egd-pool -o -e /etc/egd-pool -o -e /etc/entropy ]
then
	echo "************************************************************"
	echo "WARNING: SKIPPING TESTS BECAUSE YOUR BUILD ENVIRONMENT SEEMS"
	echo "TO HAVE NO SOURCE OF RANDOMNESS FOR OPENSSL TO USE!"
	echo "************************************************************"
	exit 0
fi

. build_and_install

# args:
# 1 - directory where build was installed
# 2 - location of client burp
# 3 - location of client conf (for editing)
# 4 - location of client conf (for giving as option to burp binary)
# 5 - directory to backup
# 6 - directory to restore to
# 7 - address of the server
# 8 - ssh command (leave unset for self test)
# 9 - scp command (leave unset for self test)
# 10 - address of the client (leave unset for self test)
do_run()
{
	./test_main \
		"$target" \
		"$target/usr/sbin/burp" \
		"$target/etc/burp/burp.conf" \
		"$target/etc/burp/burp.conf" \
		"$build" \
		"$path/restore" \
		127.0.0.1 \
		"" \
		"" \
		"" || exit 1
}

do_run