Skip to content

Commit

Permalink
* server-src/dumper.c:Fix compiler warning
Browse files Browse the repository at this point in the history
* installcheck/Installcheck/Run.pm: Improvement
* installcheck/Makefile.am: Add new amcat* script and new test scripts
* installcheck/amcat-error-end.pl: New script that fail on exit
* installcheck/amcat-error-no-exec.pl: New script install without
  execute bit
* installcheck/amcat-error.pl: New script that fail after 65536 bytes
* installcheck/amcat.sh: New script that do a cat
* installcheck/failure-client-custom-compress-end.pl,
  installcheck/failure-client-custom-compress-no-exec.pl,
  installcheck/failure-client-custom-compress-not-found.pl,
  installcheck/failure-client-custom-compress.pl,
  installcheck/failure-client-encrypt-end.pl,
  installcheck/failure-client-encrypt-no-exec.pl,
  installcheck/failure-client-encrypt-not-found.pl,
  installcheck/failure-client-encrypt.pl,
  installcheck/failure-server-custom-compress-end.pl,
  installcheck/failure-server-custom-compress-no-exec.pl,
  installcheck/failure-server-custom-compress-not-found.pl,
  installcheck/failure-server-custom-compress.pl,
  installcheck/failure-server-encrypt-end.pl,
  installcheck/failure-server-encrypt-no-exec.pl,
  installcheck/failure-server-encrypt-not-found.pl,
  installcheck/failure-server-encrypt.pl: New scripts to test various
  error
* installcheck/failure-xfer-dest-holding-file-first-close_chunk.pl,
  installcheck/failure-xfer-dest-holding-file-open-first-header.pl,
  installcheck/failure-xfer-dest-holding-file-open-second-header.pl,
  installcheck/failure-xfer-dest-holding-file-second-close_chunk.pl,
  installcheck/failure-xfer-dest-holding-file-write-first-data.pl,
  installcheck/failure-xfer-dest-holding-file-write-first-header.pl,
  installcheck/failure-xfer-dest-holding-file-write-second-data.pl,
  installcheck/failure-xfer-dest-holding-file-write-second-header.pl,
  installcheck/failure-xfer-dest-holding-shm-first-close_chunk.pl,
  installcheck/failure-xfer-dest-holding-shm-open-first-header.pl,
  installcheck/failure-xfer-dest-holding-shm-open-second-header.pl,
  installcheck/failure-xfer-dest-holding-shm-second-close_chunk.pl,
  installcheck/failure-xfer-dest-holding-shm-write-first-data.pl,
  installcheck/failure-xfer-dest-holding-shm-write-first-header.pl,
  installcheck/failure-xfer-dest-holding-shm-write-second-data.pl,
  installcheck/failure-xfer-dest-holding-shm-write-second-header.pl:
  New script to test error in xfer-dest-holding.c
* installcheck/success-dumper-chunker+dumper-chunker-taper-flush.pl,
  installcheck/success-dumper-chunker+taper-flush.pl,
  installcheck/success-dumper-chunker-2taper-by-level.pl,
  installcheck/success-dumper-chunker-2taper.pl,
  installcheck/success-dumper-chunker-taper.pl,
  installcheck/success-dumper-taper.pl: Update for improvement in
  Installcheck/Run.pm


git-svn-id: https://svn.code.sf.net/p/amanda/code/amanda/trunk@6819 a8d146d6-cc15-0410-8900-af154a0219e0
  • Loading branch information
Jean-Louis Martineau committed Aug 17, 2016
1 parent 94e1b30 commit f97c179
Show file tree
Hide file tree
Showing 10 changed files with 146 additions and 25 deletions.
59 changes: 55 additions & 4 deletions ChangeLog
@@ -1,3 +1,54 @@
2016-08-17 Jean-Louis Martineau <JMartineau@carbonite.com>
* server-src/dumper.c:Fix compiler warning
* installcheck/Installcheck/Run.pm: Improvement
* installcheck/Makefile.am: Add new amcat* script and new test scripts
* installcheck/amcat-error-end.pl: New script that fail on exit
* installcheck/amcat-error-no-exec.pl: New script install without
execute bit
* installcheck/amcat-error.pl: New script that fail after 65536 bytes
* installcheck/amcat.sh: New script that do a cat
* installcheck/failure-client-custom-compress-end.pl,
installcheck/failure-client-custom-compress-no-exec.pl,
installcheck/failure-client-custom-compress-not-found.pl,
installcheck/failure-client-custom-compress.pl,
installcheck/failure-client-encrypt-end.pl,
installcheck/failure-client-encrypt-no-exec.pl,
installcheck/failure-client-encrypt-not-found.pl,
installcheck/failure-client-encrypt.pl,
installcheck/failure-server-custom-compress-end.pl,
installcheck/failure-server-custom-compress-no-exec.pl,
installcheck/failure-server-custom-compress-not-found.pl,
installcheck/failure-server-custom-compress.pl,
installcheck/failure-server-encrypt-end.pl,
installcheck/failure-server-encrypt-no-exec.pl,
installcheck/failure-server-encrypt-not-found.pl,
installcheck/failure-server-encrypt.pl: New scripts to test various
error
* installcheck/failure-xfer-dest-holding-file-first-close_chunk.pl,
installcheck/failure-xfer-dest-holding-file-open-first-header.pl,
installcheck/failure-xfer-dest-holding-file-open-second-header.pl,
installcheck/failure-xfer-dest-holding-file-second-close_chunk.pl,
installcheck/failure-xfer-dest-holding-file-write-first-data.pl,
installcheck/failure-xfer-dest-holding-file-write-first-header.pl,
installcheck/failure-xfer-dest-holding-file-write-second-data.pl,
installcheck/failure-xfer-dest-holding-file-write-second-header.pl,
installcheck/failure-xfer-dest-holding-shm-first-close_chunk.pl,
installcheck/failure-xfer-dest-holding-shm-open-first-header.pl,
installcheck/failure-xfer-dest-holding-shm-open-second-header.pl,
installcheck/failure-xfer-dest-holding-shm-second-close_chunk.pl,
installcheck/failure-xfer-dest-holding-shm-write-first-data.pl,
installcheck/failure-xfer-dest-holding-shm-write-first-header.pl,
installcheck/failure-xfer-dest-holding-shm-write-second-data.pl,
installcheck/failure-xfer-dest-holding-shm-write-second-header.pl:
New script to test error in xfer-dest-holding.c
* installcheck/success-dumper-chunker+dumper-chunker-taper-flush.pl,
installcheck/success-dumper-chunker+taper-flush.pl,
installcheck/success-dumper-chunker-2taper-by-level.pl,
installcheck/success-dumper-chunker-2taper.pl,
installcheck/success-dumper-chunker-taper.pl,
installcheck/success-dumper-taper.pl: Update for improvement in
Installcheck/Run.pm

2016-08-17 Jean-Louis Martineau <JMartineau@carbonite.com>
* amandad-src/amandad.c: Fix closing service
* client-src/sendbackup.c (stderr_thread): Cancel the shm_ring
Expand Down Expand Up @@ -1995,8 +2046,8 @@
script.

2015-08-31 Jean-Louis Martineau <martineau@zmanda.com>
* patching file perl/Amanda/FetchDump.pm: Fix perl warning
* patching file server-src/amcheck-device.pl: Fix
* perl/Amanda/FetchDump.pm: Fix perl warning
* server-src/amcheck-device.pl: Fix
* installcheck/Amanda_Rest_Amcheck.pl: Fix

2015-08-27 Jean-Louis Martineau <martineau@zmanda.com>
Expand Down Expand Up @@ -3957,7 +4008,7 @@
* server-src/driver.c: Remove useless space.

2014-06-19 Jean-Louis Martineau <martineau@zmanda.com>
* device-src/Makefile.am, patching file ndmp-src/Makefile.am,
* device-src/Makefile.am, ndmp-src/Makefile.am,
xfer-src/Makefile.am: Fix install-build-dependencies.

2014-06-18 Jean-Louis Martineau <martineau@zmanda.com>
Expand Down Expand Up @@ -10262,7 +10313,7 @@

2010-10-26 Jean-Louis Martineau <martineau@zmanda.com>
* common-src/fileheader.c (parse_file_header): Print buf.
* patching file recover-src/extract_list.c: Read header in multiple
* recover-src/extract_list.c: Read header in multiple
block.

2010-10-26 Jean-Louis Martineau <martineau@zmanda.com>
Expand Down
55 changes: 45 additions & 10 deletions installcheck/Installcheck/Run.pm
Expand Up @@ -556,22 +556,51 @@ bail:

sub diag_diff
{
my ( $a, $b, $msg ) = @_;
my ( $a, $b, $text ) = @_;

# line betwwen ' /--' and ' \--------' can be in varying order

my $fail = 0;

my @a = split /\n/, $a;
my @b = split /\n/, $b;
foreach my $la (@a) {
while (defined(my $la = shift @a)) {
my $lb = shift @b;

if ($la =~ /^ \/-- /) {
my @ax;
my @bx;
push @ax, $la;
push @bx, $lb;
while (($la = shift @a) !~ / \\--------/) {
$lb = shift @b;
push @ax, $la;
push @bx, $lb;
}
$lb = shift @b;

@ax = sort @ax;
@bx = sort @bx;
while (defined(my $xa = shift @ax)) {
my $xb = shift @bx;
if ($xa !~ /^$xb$/){
$fail = 1;
diag("-$xa");
diag("+$xb");
}
}
}
if ($la !~ /^$lb$/){
$fail = 1;
diag("-$la");
diag("+$lb");
}
}
foreach my $lb (@b) {
$fail = 1;
diag("+$lb");
}
ok(!$fail, "$text: match");

}

Expand All @@ -583,11 +612,16 @@ sub check_amreport
my $sorting = shift;
my $got_report;

$report =~ s/\\/\\\\/g;
$report =~ s/\?/\\?/g;
$report =~ s/\(/\\(/g;
$report =~ s/\)/\\)/g;
$report =~ s/\[/\\[/g;
$report =~ s/\]/\\]/g;
$report =~ s/0:00/\\d:\\d\\d/g;
$report =~ s/\+/\\+/g;
$report =~ s/sendbackup: (.*)-CRC [^:]*:(\d*)/sendbackup: $1-CRC \(\.\*\):$2/g;
$report =~ s/PID/\\d\+/g;
$report =~ s/999999\.9/\[ \\d\]*\\.\\d/g;
my ($year, $month, $day) = ($timestamp =~ m/^(\d\d\d\d)(\d\d)(\d\d)/);
my $date = POSIX::strftime('%B %e, %Y', 0, 0, 0, $day, $month - 1, $year - 1900);
Expand All @@ -598,9 +632,7 @@ sub check_amreport
$report =~ s/Hostname: .*$/Hostname: $hostname/mg;
$report =~ s/brought to you by Amanda version .*\\/brought to you by Amanda version $Amanda::Constants::VERSION\\/g;

ok(run("amreport", 'TESTCONF'),
"$text: run amreport")
or diag($Installcheck::Run::stderr);
run("amreport", 'TESTCONF');

if ($sorting) {
my @lines = split "\n", $Installcheck::Run::stdout;
Expand Down Expand Up @@ -642,7 +674,8 @@ sub check_amreport
$got_report = $Installcheck::Run::stdout;
}

ok($got_report =~ $report, "$text: match") || diag_diff($got_report, $report);
# ok($got_report =~ $report, "$text: match") || diag_diff($got_report, $report, $text);
diag_diff($got_report, $report, $text);
#diag("stdout::::${Installcheck::Run::stdout}::::\n");
#diag("got_report::::${got_report}::::\n");
#diag("report::::${report}::::\n");
Expand All @@ -655,6 +688,8 @@ sub check_amstatus
my $tracefile = shift;
my $text = shift || 'amstatus';

$status =~ s/\\/\\\\/g;
$status =~ s/\+/\\\\+/g;
$status =~ s/\[/\\[/g;
$status =~ s/\]/\\]/g;
$status =~ s/Using: .*$/Using: $tracefile/mg;
Expand All @@ -666,15 +701,15 @@ sub check_amstatus
$status =~ s/^(.*dumpers busy[^\)]*\))/$1.*/mg;
$status =~ s/^(.*dumper busy[^\)]*\))/$1.*/mg;
$status =~ s/^ *not-idle.*\n//mg;
$status =~ s/^holding space : \d+k/holding space : \\d\+k/mg;

ok(run("amstatus", 'TESTCONF', '--file', $tracefile),
"$text: run amstatus")
or diag($Installcheck::Run::stderr);
run("amstatus", 'TESTCONF', '--file', $tracefile);

my $got_status = $Installcheck::Run::stdout;
$got_status =~ s/^ *not-idle.*\n//mg;

ok($got_status =~ $status, "$text: match") || diag_diff($got_status, $status);
# ok($got_status =~ $status, "$text: match") || diag_diff($got_status, $status, $text);
diag_diff($got_status, $status, $text);
#diag("stdout $got_status");
#diag("status: $status");
}
Expand Down
43 changes: 39 additions & 4 deletions installcheck/Makefile.am
Expand Up @@ -74,9 +74,41 @@ server_tests = \
amtapetype \
chunker \
dump-client-custom-compress+amfetchdump \
dump-server-custom-compress+amfetchdump \
dump-client-encrypt+amfetchdump \
dump-server-custom-compress+amfetchdump \
dump-server-encrypt+amfetchdump \
failure-client-custom-compress \
failure-client-custom-compress-end \
failure-client-custom-compress-not-found \
failure-client-custom-compress-no-exec \
failure-client-encrypt \
failure-client-encrypt-end \
failure-client-encrypt-not-found \
failure-client-encrypt-no-exec \
failure-server-custom-compress \
failure-server-custom-compress-end \
failure-server-custom-compress-not-found \
failure-server-custom-compress-no-exec \
failure-server-encrypt \
failure-server-encrypt-end \
failure-server-encrypt-not-found \
failure-server-encrypt-no-exec \
failure-xfer-dest-holding-file-first-close_chunk \
failure-xfer-dest-holding-file-second-close_chunk \
failure-xfer-dest-holding-file-open-first-header \
failure-xfer-dest-holding-file-open-second-header \
failure-xfer-dest-holding-file-write-first-data \
failure-xfer-dest-holding-file-write-first-header \
failure-xfer-dest-holding-file-write-second-data \
failure-xfer-dest-holding-file-write-second-header \
failure-xfer-dest-holding-shm-first-close_chunk \
failure-xfer-dest-holding-shm-second-close_chunk \
failure-xfer-dest-holding-shm-open-first-header \
failure-xfer-dest-holding-shm-open-second-header \
failure-xfer-dest-holding-shm-write-first-data \
failure-xfer-dest-holding-shm-write-first-header \
failure-xfer-dest-holding-shm-write-second-data \
failure-xfer-dest-holding-shm-write-second-header \
success-dumper-chunker-taper \
success-dumper-chunker-2taper \
success-dumper-chunker-2taper-by-level \
Expand Down Expand Up @@ -137,7 +169,7 @@ mocks = \
test_data = \
data/aws-bundle.crt
EXTRA_DIST += $(test_data)
CLEANFILES += $(all_tests) $(mocks) $(noinst_SCRIPTS)
CLEANFILES += $(all_tests) $(mocks) $(noinst_SCRIPTS) amcat amcat-error amcat-error-end amcat-error-no-exec
DISTCLEANFILES += config.log

tests =
Expand Down Expand Up @@ -237,7 +269,9 @@ noinst_SCRIPTS = \

CHECK_PERL_FLAGS=-I$(top_srcdir)/installcheck

SCRIPTS_PERL = $(tests) $(mocks) $(noinst_SCRIPTS)
SCRIPTS_PERL = $(tests) $(mocks) $(noinst_SCRIPTS) amcat-error amcat-error-end amcat-error-no-exec
SCRIPTS_SHELL = amcat

SCRIPTS_EXTRA_DIST = $(all_tests)

# skip syntax checks on these files, since we're about to run all of them
Expand All @@ -262,7 +296,8 @@ clobber_my_config_is_ok:

# newer Test::Harness (v3.18-3.21) implementations get confused by executable
# test scripts, so this rule chmod a-x's them first
installcheck-local: clobber_my_config_is_ok $(SCRIPTS_PERL)
installcheck-local: clobber_my_config_is_ok $(SCRIPTS_PERL) $(SCRIPTS_SHELL)
chmod a-x amcat-error-no-exec
rm -rf "$(AMANDA_TMPDIR)/installchecks"
$(MKDIR_P) "$(AMANDA_TMPDIR)/installchecks"
@if test -f "$(CONFIG_DIR)/amanda-client.conf" -a ! -f "$(CONFIG_DIR)/amanda-client.conf.install-backup"; then \
Expand Down
Expand Up @@ -55,7 +55,7 @@
plan skip_all => "Can't start JSON Rest server: $rest->{'error'}: see " . Amanda::Debug::dbfn();
exit 1;
}
plan tests => 100;
plan tests => 96;

my $reply;

Expand Down
2 changes: 1 addition & 1 deletion installcheck/success-dumper-chunker+taper-flush.pl
Expand Up @@ -55,7 +55,7 @@
plan skip_all => "Can't start JSON Rest server: $rest->{'error'}: see " . Amanda::Debug::dbfn();
exit 1;
}
plan tests => 86;
plan tests => 82;

my $reply;

Expand Down
2 changes: 1 addition & 1 deletion installcheck/success-dumper-chunker-2taper-by-level.pl
Expand Up @@ -55,7 +55,7 @@
plan skip_all => "Can't start JSON Rest server: $rest->{'error'}: see " . Amanda::Debug::dbfn();
exit 1;
}
plan tests => 104;
plan tests => 100;

my $reply;

Expand Down
2 changes: 1 addition & 1 deletion installcheck/success-dumper-chunker-2taper.pl
Expand Up @@ -55,7 +55,7 @@
plan skip_all => "Can't start JSON Rest server: $rest->{'error'}: see " . Amanda::Debug::dbfn();
exit 1;
}
plan tests => 63;
plan tests => 61;

my $reply;

Expand Down
2 changes: 1 addition & 1 deletion installcheck/success-dumper-chunker-taper.pl
Expand Up @@ -55,7 +55,7 @@
plan skip_all => "Can't start JSON Rest server: $rest->{'error'}: see " . Amanda::Debug::dbfn();
exit 1;
}
plan tests => 47;
plan tests => 45;

my $reply;

Expand Down
2 changes: 1 addition & 1 deletion installcheck/success-dumper-taper.pl
Expand Up @@ -55,7 +55,7 @@
plan skip_all => "Can't start JSON Rest server: $rest->{'error'}: see " . Amanda::Debug::dbfn();
exit 1;
}
plan tests => 47;
plan tests => 45;

my $reply;

Expand Down
2 changes: 1 addition & 1 deletion server-src/dumper.c
Expand Up @@ -2516,7 +2516,7 @@ read_datafd(
/* write the header on the first bytes */
if (ISSET(status, HEADER_DONE) && !ISSET(status, HEADER_SENT) && size > 0) {
/* Use the first in the dataport_list */
in_port_t data_port;
in_port_t data_port = 0;
char *data_host = g_strdup(dataport_list);
char *s;

Expand Down

0 comments on commit f97c179

Please sign in to comment.