From 3d06ff94ba3f7e891cbaf90e6beaaa7b7c6f80dd Mon Sep 17 00:00:00 2001 From: Mike Taylor Date: Tue, 17 Oct 2006 15:25:51 +0000 Subject: [PATCH] New -- utility used for designing IRSpy tests. --- bin/find-different-access-point.pl | 43 ++++++++++++++++++++++++++++++++++++ 1 file changed, 43 insertions(+) create mode 100755 bin/find-different-access-point.pl diff --git a/bin/find-different-access-point.pl b/bin/find-different-access-point.pl new file mode 100755 index 0000000..c820057 --- /dev/null +++ b/bin/find-different-access-point.pl @@ -0,0 +1,43 @@ +#!/usr/bin/perl -w + +# $Id: find-different-access-point.pl,v 1.1 2006-10-17 15:25:51 mike Exp $ +# +# Run like this: +# find-different-access-point.pl fish bagel:210/gils bagel:210/marc +# This is not an IRSpy program: it's a ZOOM-Perl program, which is +# used to find a BIB-1 attribute that is supported differently by two +# or more targets. Using the output of this, it's possible to create +# an IRSpy test plugin that passes one server and fails another. + +use strict; +use warnings; +use ZOOM; + +if (@ARGV < 3) { + print STDERR "Usage $0 [ ...]"; + exit 1; +} + +my $query = shift(@ARGV); +my @conns = map { new ZOOM::Connection($_) } @ARGV; + +print "$query\n"; +print "@ARGV\n"; +for (my $i = 1; $i < 9999; $i++) { + print "$i"; + my $different = 0; + my $sofar = undef; + foreach my $conn (@conns) { + my $rs; + eval { $rs = $conn->search_pqf("\@attr 1=$i $query") }; + my $ok = !$@; + print "\t", $ok ? "ok(" . $rs->size(). ")" : "FAIL($@)"; + if (!defined $sofar) { + $sofar = $ok; + } elsif ($ok != $sofar) { + $different = 1; + } + } + print "\n"; + last if $different; +} -- 1.7.10.4