* Fix the Avahi test: the start condition for the backdoor changed, so

it's now necessary to wait until networking is up.  Also, don't
  print to stderr.

svn path=/nixos/trunk/; revision=26441
This commit is contained in:
Eelco Dolstra 2011-03-21 13:01:23 +00:00
parent c430bf5cc3
commit f10376611e

View File

@ -22,39 +22,34 @@ with pkgs;
'' startAll;
# mDNS.
print STDERR
$one->mustSucceed("avahi-resolve-host-name one.local | tee out");
$one->waitForJob("network-interfaces");
$one->mustSucceed("avahi-resolve-host-name one.local | tee out >&2");
$one->mustSucceed("test \"`cut -f1 < out`\" = one.local");
print STDERR
$one->mustSucceed("avahi-resolve-host-name two.local | tee out");
$one->mustSucceed("avahi-resolve-host-name two.local | tee out >&2");
$one->mustSucceed("test \"`cut -f1 < out`\" = two.local");
print STDERR
$two->mustSucceed("avahi-resolve-host-name one.local | tee out");
$two->waitForJob("network-interfaces");
$two->mustSucceed("avahi-resolve-host-name one.local | tee out >&2");
$two->mustSucceed("test \"`cut -f1 < out`\" = one.local");
print STDERR
$two->mustSucceed("avahi-resolve-host-name two.local | tee out");
$two->mustSucceed("avahi-resolve-host-name two.local | tee out >&2");
$two->mustSucceed("test \"`cut -f1 < out`\" = two.local");
# Basic DNS-SD.
print STDERR
$one->mustSucceed("avahi-browse -r -t _workstation._tcp | tee out");
$one->mustSucceed("avahi-browse -r -t _workstation._tcp | tee out >&2");
$one->mustSucceed("test `wc -l < out` -gt 0");
print STDERR
$two->mustSucceed("avahi-browse -r -t _workstation._tcp | tee out");
$two->mustSucceed("avahi-browse -r -t _workstation._tcp | tee out >&2");
$two->mustSucceed("test `wc -l < out` -gt 0");
# More DNS-SD.
$one->execute("avahi-publish -s \"This is a test\" _test._tcp 123 one=1 &");
$one->sleep(5);
print STDERR
$two->mustSucceed("avahi-browse -r -t _test._tcp | tee out");
$two->mustSucceed("avahi-browse -r -t _test._tcp | tee out >&2");
$two->mustSucceed("test `wc -l < out` -gt 0");
# NSS-mDNS.
print STDERR $one->mustSucceed("getent hosts one.local");
print STDERR $one->mustSucceed("getent hosts two.local");
print STDERR $two->mustSucceed("getent hosts one.local");
print STDERR $two->mustSucceed("getent hosts two.local");
$one->mustSucceed("getent hosts one.local >&2");
$one->mustSucceed("getent hosts two.local >&2");
$two->mustSucceed("getent hosts one.local >&2");
$two->mustSucceed("getent hosts two.local >&2");
'';
}