Skip to content

Commit

Permalink
[test] add configure_build.sh convenience script for builds suitable …
Browse files Browse the repository at this point in the history
…for the test suite
  • Loading branch information
mrash committed Dec 9, 2019
1 parent 4df4b1a commit ffe040c
Show file tree
Hide file tree
Showing 4 changed files with 25 additions and 8 deletions.
1 change: 1 addition & 0 deletions Makefile.am
Original file line number Diff line number Diff line change
Expand Up @@ -489,6 +489,7 @@ EXTRA_DIST = \
test/long_spa.key \
test/invalid.args \
test/test-fwknop.pl \
test/configure_build.sh \
test/generate_cores.sh \
test/fko-python.py \
test/run-test-suite.sh \
Expand Down
12 changes: 7 additions & 5 deletions test/README
Original file line number Diff line number Diff line change
@@ -1,12 +1,14 @@

This directory contains the fwknop test suite. After compiling the fwknop
sources in the parent directory of test/ the test suite can be executed. One
of the most comprehensive ways of executing the test suite is as follows:
This directory contains the fwknop test suite. After compiling the fwknop
sources in the parent directory of test/ the test suite can be executed. The
test/configure_build.sh script provides recommended defaults for the
'configure' script, and should be used before compiling. After this, one of
the most comprehensive ways of executing the test suite is as follows:

# ./run-test-suite.sh --enable-all

This mode enables IP resolution tests, so you will need Internet access in this
case. If this is not possible or desirable, then another comprehensive testing
case. If this is not possible or desirable, then another comprehensive testing
mode can be achieved with:

# ./run-test-suite.sh --enable-recompile --enable-perl-module-checks --enable-distcheck
Expand All @@ -17,7 +19,7 @@ modes) may be found in the fwknop tutorial available here:
http://www.cipherdyne.org/fwknop/docs/fwknop-tutorial.html#3.5

For even more comprehensive testing than the --enable-all switch, you can use
--enable-complete. However, before doing this, you will want to install the
--enable-complete. However, before doing this, you will want to install the
'libfiu' fault injection library (available here: http://blitiri.com.ar/p/libfiu/),
and then compile fwknop with the 'test/configure_max_coverage.sh' script. This
provides additional arguments to the 'configure' script to build fwknop with a
Expand Down
14 changes: 14 additions & 0 deletions test/configure_build.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
#!/bin/sh -x

#
# This is a convenience script to run ./configure with the command line args
# that the test suite needs (sets up binary locations, sysconfdir,
# etc.). Execute this script from the top level fwknop sources directory, and
# then run the test-fwknop.pl script from the test/ directory.
#

if [ -x ./configure ]; then
./configure --prefix=/usr --sysconfdir=`pwd`/test/conf --localstatedir=`pwd`/test/run $@
else
echo "[*] Execute from the fwknop top level sources directory"
fi
6 changes: 3 additions & 3 deletions test/test-fwknop.pl
Original file line number Diff line number Diff line change
Expand Up @@ -20,9 +20,9 @@
our $long_key_file = 'long_spa.key'; ### > 16 bytes
our $local_spa_key = 'fwknoptest';
our $local_hmac_key_file = 'local_hmac_spa.key';
my $output_dir = 'output';
our $conf_dir = 'conf';
my $run_dir = 'run';
my $output_dir = cwd() . '/output';
our $conf_dir = cwd() . '/conf';
our $run_dir = cwd() . '/run';
our $run_tmp_dir_top = 'runtmp';
our $run_tmp_dir = "$run_tmp_dir_top/subdir1/subdir2";
my $cmd_out_tmp = 'cmd.out';
Expand Down

0 comments on commit ffe040c

Please sign in to comment.