Fixes testsuite:

- Fix get_hosts_avahi() if avahi-browse not available
- Removed test "Tab should complete hostnames" from finger since it's
  returning (for the moment) undetectable ip-addresses from known_hosts
  files.  Furthermore the next test "Tab should complete partial
  hostname" is testing the same.
This commit is contained in:
Freddy Vulto 2009-09-13 18:05:58 +02:00
parent 5999df7fea
commit 03526772fa
2 changed files with 8 additions and 16 deletions

View File

@ -30,19 +30,6 @@ assert_complete_partial [exec bash -c "compgen -A user"] "finger"
sync_after_int sync_after_int
set test "Tab should complete hostnames"
# Build string list of hostnames
set hosts {}
foreach h [get_hosts] {
# Prefix hosts with username 'test@'
lappend hosts "test@$h"
}; # foreach
assert_complete_partial $hosts finger test@ $test
sync_after_int
set test "Tab should complete partial hostname" set test "Tab should complete partial hostname"
# Build string list of hostnames, starting with the character of the first # Build string list of hostnames, starting with the character of the first
# host. # host.

View File

@ -311,10 +311,15 @@ proc get_hosts {} {
# Get hostnames according to avahi # Get hostnames according to avahi
# @return list Hostnames # @return list Hostnames
proc get_hosts_avahi {} { proc get_hosts_avahi {} {
set hosts [exec bash -c { # Retrieving hosts is successful?
if { [catch {exec bash -c {
type avahi-browse >&/dev/null && [ -n "$(pidof avahi-daemon)" ] type avahi-browse >&/dev/null && [ -n "$(pidof avahi-daemon)" ]
avahi-browse -cpr _workstation._tcp | grep ^= | cut -d\; -f7 | sort -u && avahi-browse -cpr _workstation._tcp | grep ^= | cut -d\; -f7 | sort -u
}] }} hosts] } {
# No, retrieving hosts yields error;
# Reset hosts
set hosts {}
}; # if
return $hosts return $hosts
}; # get_hosts_avahi() }; # get_hosts_avahi()