| Commit message (Collapse) | Author | Age |
|
|
|
|
|
|
| |
Use an individual target for each test. This allows parallel make to
get its teeth into the problem.
Signed-off-by: Ian Jackson <ijackson@chiark.greenend.org.uk>
|
|
|
|
| |
Signed-off-by: Ian Jackson <ijackson@chiark.greenend.org.uk>
|
|
|
|
| |
Signed-off-by: Ian Jackson <ijackson@chiark.greenend.org.uk>
|
|
|
|
|
|
|
| |
You can now set the option `adns_ignoreunkcfg'. This is relevant to
Debian #411263.
Signed-off-by: Ian Jackson <ijackson@chiark.greenend.org.uk>
|
|
|
|
|
|
| |
Debian #411263. I also read wheezy's resolv.conf(5).
Signed-off-by: Ian Jackson <ijackson@chiark.greenend.org.uk>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Check for unknown flags in adns_initflags, adns_queryflags, and
adns_rrtype.
This will allow us to extend the API in the future but still retain
backward-ABI-safety: new applications which pass a new flag but are
run against old adns will get an error (typically, ENOSYS).
In each case we reserve a few of the spare bits for `harmless'
extensions: flags which we decide, at the time of introduction, that
it is harmless for old implementations to ignore.
We simply provide explicit hex values for the flags. This is easier
than listing all of the actually-defined flags, and probably no less
reliable. Failing to add a new flag to the check as well as to the
enum will produce an obvious error (unless the `harmless' flag is used
- and those are at the top of the space to reduce that probability).
In the case of adns_rrtype, all of the external functions quickly pass
the type to adns__findtype, so we can do the check there.
Signed-off-by: Ian Jackson <ijackson@chiark.greenend.org.uk>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
The declaration mentioning CLIENTS has an unfortunate side-effect: it
`mentions' the file adnshost_c.o, which is not part of the build and
is not buildable.
According to the rules in `(make)Implicit Rule Search' this causes
make to try to build adnshost_playback from adnshost_c.o (rule 5).
This is because files whose names are `mentioned' are taken to `ought
to exist'.
This causes adns to be unbuildable on the make from Debian sid
(4.0-8); it is not visible on earlier makes (eg 3.81-8.2) because they
don't appear to actually follow the documented algorithm.
Bodge this (further) by filtering adnshost out of the client list. It
is currently the only client made out of multiple object files.
(Cherry-picked from Debian's adns dgit/experimental branch.)
Signed-off-by: Ian Jackson <ijackson@chiark.greenend.org.uk>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
This makes the tests clearer to read. No functional change.
Change was made with
for f in regress/*.sys; do perl -i~ -p ../t.pl $f; done
where t.pl is this script
if ($.==1) { $at=m{^(?:\./)?adnstest\b}; }
if ($at && $.==2 && m/^:/) {
m/^:(\S+)/ or die;
$r=$'; #';
$_=$1;
s{\b(\d+)\b}{
sprintf "0x%x|%d", ($1 & ~0xffff), ($1 & 0xffff)
}ge;
$_=":$_$r";
}
Signed-off-by: Ian Jackson <ijackson@chiark.greenend.org.uk>
|
|
|
|
| |
Signed-off-by: Ian Jackson <ijackson@chiark.greenend.org.uk>
|
|
|
|
| |
Signed-off-by: Ian Jackson <ijackson@chiark.greenend.org.uk>
|
|
|
|
| |
Signed-off-by: Ian Jackson <ijackson@chiark.greenend.org.uk>
|
|
|
|
| |
Signed-off-by: Ian Jackson <ijackson@chiark.greenend.org.uk>
|
|
|
|
|
|
|
|
|
|
|
| |
I don't much like PF_. None of the modern specs or docs talk about PF
any more.
Entirely formulaic patch:
perl -i~ -pe 's/\bPF_INET\b/AF_INET/g' regress/*
perl -i~ -pe 's/\bPF_INET6\b/AF_INET6/g' regress/*
Signed-off-by: Ian Jackson <ijackson@chiark.greenend.org.uk>
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Otherwise you can get this:
regress$ make adnstest_record -j2
gcc -g -O2 -Wall -Wmissing-prototypes -Wwrite-strings -Wstrict-prototypes -Wcast-qual -Wpointer-arith -Wno-pointer-sign -I../src -I. -I./../src -DADNS_REGRESS_TEST -I. -c -g -o addrfam_d.o ../src/addrfam.c
gcc adnstest_c.o hrecord.o hcommon.o types_d.o event_d.o query_d.o reply_d.o general_d.o setup_d.o transmit_d.o parse_d.o poll_d.o check_d.o addrfam_d.o -o adnstest_record
gcc: error: adnstest_c.o: No such file or directory
make: *** [adnstest_record] Error 1
regress$
Signed-off-by: Ian Jackson <ijackson@chiark.greenend.org.uk>
|
|
|
|
|
|
|
|
| |
Check that the reverse parser rejects labels with leading zeroes, with
digits out of range, or with out-of-range label values. And check
uppercase IPv6 PTRs.
Signed-off-by: Ian Jackson <ijackson@chiark.greenend.org.uk>
|
|
|
|
|
|
|
|
|
|
| |
This lets you run gdb from within r1test with appropriate fd plumbing.
(It's a shame gdb doesn't have a way to simply tell it to take its
commands from /dev/tty.)
Add the suggested example gdb script file, x.gdb, to .gitignore.
Signed-off-by: Ian Jackson <ijackson@chiark.greenend.org.uk>
|
|
|
|
|
|
|
| |
Exercise the code which checks the sortlist for invalid address/mask
pairs.
Signed-off-by: Ian Jackson <ijackson@chiark.greenend.org.uk>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
This is the end-game. Add flags and options to allow clients and
administrators to choose which address families they want returned. For
logical compatibility with old clients, don't return foreign address
families unless explicitly requested.
Lots of tests are modified to select only IPv4 addresses. There's
nothing else up my sleeve. A new test is added for the additional
functionality; more are expected later.
Signed-off-by: Mark Wooding <mdw@distorted.org.uk>
Signed-off-by: Ian Jackson <ijackson@chiark.greenend.org.uk>
|
|
|
|
|
|
|
|
| |
Not available if the client doesn't have the larger adns_rr_addr
structure.
Signed-off-by: Mark Wooding <mdw@distorted.org.uk>
Signed-off-by: Ian Jackson <ijackson@chiark.greenend.org.uk>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
The way addr queries work internally is now very different. The
toplevel query is now `virtual', and exists to spawn subqueries for each
applicable address type (currently hardcoded to A only, but this will
change later).
The toplevel query has a callback function which assembles its answer
from the various child queries, and there's a collection of support
machinery too. (Some of the bookkeeping done during this may seem
unnecessary, but it will come in handy later.)
Because more of the work is now done in internal query callbacks, some
of the answers in the tests are reported in different order. See
`Reentrancy: Avoid reentrant callbacks' for more detailed explanation
of a similar change.
Signed-off-by: Mark Wooding <mdw@distorted.org.uk>
Signed-off-by: Ian Jackson <ijackson@chiark.greenend.org.uk>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Avoid making reentrant callbacks for internal queries during other
processing.
Currently there is a theoretical reentrancy bug in
adns__submit_internal, if the internal query can itself be persuaded
to fail immediately. The result would be a reentrant call to
callback() for the child query inside functions like typei->parse.
The possibility of such reentrancy is a bug waiting to happen - and
indeed we are going to introduce more complicated query submissions
which are more likely to fail immediately, turning this from a
theoretical to a real bug.
Solve this as follows: when an internal query completes, just put it
on a list. Whenever we are on our way out of adns, we look through
this list and make the callbacks (until the list is empty).
This means that a fair amount of code needs to be taught that it might
encounter queries in this callback pending state.
We have to update some of the tests' expected output:
Because adns now processes the callback later, a number of the
parallel subqueries made by some of the tests end up finishing before
being cancelled - and therefore the replies to those subqueries don't
show up in the debug output as unrecognised.
Also, in case-norecurse, the deferral of the callback causes the order
of result reporting to be changed: the main query due to subqueries
finishing (`PTR(checked)') ends up later on the results queue than the
other queries dealt with in the same event loop iteration. (The
actual answer packet to final query, `CNAME(-)', arrives later.)
Signed-off-by: Ian Jackson <ijackson@chiark.greenend.org.uk>
|
|
|
|
|
|
|
|
|
| |
We create a UDP socket for each distinct protocol family during
initialization, and then use the appropriate one for each server. The
changes are somewhat invasive, but not really very complicated.
Signed-off-by: Mark Wooding <mdw@distorted.org.uk>
Signed-off-by: Ian Jackson <ijackson@chiark.greenend.org.uk>
|
|
|
|
|
|
|
|
|
| |
I updated the test files with this rune:
grep -lZ "^ socket type=" *.sys | xargs -0r sed -i \
's/^ socket type=/ socket domain=PF_INET type=/'
Signed-off-by: Mark Wooding <mdw@distorted.org.uk>
|
|
|
|
|
|
| |
Makes the test harness agnostic regarding address families.
Signed-off-by: Mark Wooding <mdw@distorted.org.uk>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
This involves moving most of the label parser in ckl_ptr, and the
reverse-domain constructor, into addrfam and teaching them about IPv6.
The label parser is a little tricky because it involves keeping track of
a parse state for each possible address family until we run out of
possibilities or the parse is complete.
Moving the reverse-domain constructor introduces a slightly unpleasant
hack: because knowledge of the right reverse-lookup zone belongs in
addrfam, we get adns_submit_reverse to pass a sentinel through
_reverse_any to addrfam.
Signed-off-by: Mark Wooding <mdw@distorted.org.uk>
|
|
|
|
|
|
| |
I've added a couple of simple test cases.
Signed-off-by: Mark Wooding <mdw@distorted.org.uk>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
This uses the recently introduced variable-size record structure
machinery so that only clients compiled against the new header file see
the larger record structure.
Note that we don't even try to actually do lookups for IPv6 addresses.
That will come later on. This is just about sorting out the binary
interface.
Arrange that regress/case-brokenmail.sys asks for the correct record
size, because otherwise the answers get printed out wrongly.
[ I have done git-grep sizeof on a version of the head of this series
and found no un-corrected uses of sizeof(adns_rr_addr) -iwj. ]
Signed-off-by: Mark Wooding <mdw@distorted.org.uk>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
A future change is going to change how query-ids are allocated for
adns_r_addr queries. So here we apply a simple bodge which will produce
the same allocation pattern, but without the complexity of the rest of
the change, and fix the test suite to match.
I used the script regress/hack-query-ids to help me modify the
case-*.sys files, though this was primarily a rather tedious manual
process.
Signed-off-by: Mark Wooding <mdw@distorted.org.uk>
Signed-off-by: Ian Jackson <ijackson@chiark.greenend.org.uk>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Soon we're going to change the way adns_r_ptr queries work: in
particular, queries with names which can't be parsed back into addresses
will be rejected during submission rather than waiting for the answer to
the initial PTR question to come back.
So here we apply a really simple temporary hack to adns_submit which
approximately captures the behaviour we're after, and adjust the various
test cases to match. We'll take this hack out when we make the proper
change to the PTR handling.
Hopefully this will persuade reviewers that there's nothing up my
sleeves while I mess with the regression tests.
Signed-off-by: Mark Wooding <mdw@distorted.org.uk>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Amazingly, sometimes the tests don't pass. When that happens, it's
handy to be able to debug the library and find out why.
It's a little tricky to attach GDB to the running process directly. I
used the following:
$ ADNS_TEST_DEBUG"noip gdbserver localhost:666" ./r1test CASE
and then, in another terminal, something like
$ noip gdb adnstest_s
(gdb) target remote localhost:666
to debug the program.
Signed-off-by: Mark Wooding <mdw@distorted.org.uk>
Signed-off-by: Ian Jackson <ijackson@chiark.greenend.org.uk>
|
|
|
|
|
|
|
| |
This is system specific, and (more annoyingly) will break the tests if
additional address families are supported in the future.
Signed-off-by: Mark Wooding <mdw@distorted.org.uk>
|
|
|
|
| |
Signed-off-by: Mark Wooding <mdw@distorted.org.uk>
|
|
|
|
|
|
|
|
| |
This is mostly standard. The regression-test scripts have had an
interface enhancement: they will look for source-like files using the
$srcdir environment variable, which defaults to `.' for compatibility.
Signed-off-by: Mark Wooding <mdw@distorted.org.uk>
|
|
|
|
|
|
|
| |
egrep . */.cvsignore | perl -pe 's#/\.cvsignore:#/#' >>.gitignore
git-rm */.cvsignore
Signed-off-by: Ian Jackson <ijackson@chiark.greenend.org.uk>
|
| |
|
| |
|
| |
|
| |
|
| |
|
|
|
|
|
| |
mentioned in adns.h, at least. This makes the regression test
more portable (fixes problem noticed by Bernd Eckenfels).
|
|
|
|
|
| |
regression test failure on some platforms).
|
|
|
|
|
|
|
|
|
|
| |
@@ -11,6 +11,11 @@
updated).
+ * Call Tensurerecordfile in Hgettimeofday (Tensurerecordfile was
+ Tensureinputfile/Tensureoutputfile).
+ * Add bind(2) and listen(2) to test harness (for epithet's benefit, but
+ harmless in adns).
+ * Add missing ENOTSOCK to hcommon.c.m4 (was already in hcommon.c!)
|
|
|
|
|
|
|
|
| |
@@ -4,9 +4,12 @@
+ * Fix bogus multiple updates to p in transmit.c (!)
+ * Fix up spurious #undef's in hredirect.h.
(and there doesn't seem to be much explanation why).
+ * #include <stdlib.h> in internal.h (for abort etc).
|
|
|
|
|
|
| |
@@ -1,6 +1,7 @@
Bugfixes:
+ * Do not spin if connect() fails immediately (!)
|
| |
|
|
|
|
|
|
| |
@@ -6,6 +6,7 @@
(and there doesn't seem to be much explanation why).
+ * Always #include <sys/types.h> before <sys/socket.h> (for FreeBSD 4.6).
|
| |
|
| |
|
| |
|
| |
|