(testsuite) Add some [host]:port cases to known hosts related tests.

This commit is contained in:
Ville Skyttä 2010-09-28 17:59:31 +03:00
parent 372008342e
commit 7f5c64e580
6 changed files with 18 additions and 14 deletions

View File

@ -4,3 +4,5 @@ doo
ike ssh-rsa qwerty1234/Qwerty+1234==
jub,10.0.0.1
kyl,100.0.0.2
[10.10.0.3]:10022
[blah]:1234

View File

@ -2,3 +2,4 @@
|1|def
doo
ike ssh-rsa qwerty1234/Qwerty+1234==
[blah]:1234

View File

@ -2,3 +2,4 @@
|1|def
doo
ike ssh-rsa qwerty1234/Qwerty+1234==
[10.10.10.10]:2222

View File

@ -52,12 +52,12 @@ set test "Tab should complete known-hosts"
# Build string list of expected completions
# Get hostnames and give them a colon (:) suffix
# Hosts `gee' and `hus' are defined in ./fixtures/scp/config
# Hosts `doo' and `ike' are defined in ./fixtures/scp/known_hosts
# Hosts `blah', `doo' and `ike' are defined in ./fixtures/scp/known_hosts
set expected {}
foreach host [get_hosts] {
lappend expected "$host:"
}
lappend expected doo: gee: hus: ike:
lappend expected blah: doo: gee: hus: ike:
# Append local filenames
lappend expected config known_hosts "spaced\\ \\ conf"
set dir fixtures/scp
@ -90,8 +90,8 @@ foreach host [get_hosts] {
lappend expected "$host:"
}
# Hosts `gee', `hus' and `jar' are defined in "./fixtures/scp/spaced conf"
# Hosts `doo' and `ike' are defined in ./fixtures/scp/known_hosts
lappend expected doo: gee: hus: ike: jar:
# Hosts `blah', `doo' and `ike' are defined in ./fixtures/scp/known_hosts
lappend expected blah: doo: gee: hus: ike: jar:
# Append local filenames
lappend expected config known_hosts "spaced\\ \\ conf"
set dir fixtures/scp

View File

@ -18,8 +18,8 @@ setup
# Build string list of expected completions
set expected [get_hosts]
# Hosts `gee' and `hus' are defined in ./fixtures/sftp/config
# Hosts `doo' and `ike' are defined in ./fixtures/sftp/known_hosts
lappend expected doo gee hus ike
# Hosts `10.10.10.10', `doo' and `ike' are defined in ./fixtures/sftp/known_hosts
lappend expected 10.10.10.10 doo gee hus ike
set dir fixtures/sftp
assert_complete_dir $expected "sftp -F config " $dir
@ -46,8 +46,8 @@ sync_after_int
# Get hostnames and give them a colon (:) suffix
set expected [get_hosts]
# Hosts `gee', `hus' and `jar' are defined in "./fixtures/sftp/spaced conf"
# Hosts `doo' and `ike' are defined in ./fixtures/sftp/known_hosts
lappend expected doo gee hus ike jar
# Hosts `10.10.10.10', `doo' and `ike' are defined in ./fixtures/sftp/known_hosts
lappend expected 10.10.10.10 doo gee hus ike jar
set dir fixtures/sftp
assert_complete_dir $expected "sftp -F spaced\\ \\ conf " $dir

View File

@ -17,8 +17,8 @@ setup
set test "Hosts should be put in COMPREPLY"
set hosts [get_hosts]
# Hosts `gee', `hus' and `jar' are defined in ./fixtures/_known_hosts_real/config
# doo, ike, jub, 10.0.0.1, kyl and 100.0.0.2 in ./fixtures/_known_hosts_real/known_hosts
lappend hosts doo gee hus ike jar jub kyl 10.0.0.1 100.0.0.2
# doo, ike, jub, 10.0.0.1, kyl, 100.0.0.2, 10.10.0.3 and blah in ./fixtures/_known_hosts_real/known_hosts
lappend hosts blah doo gee hus ike jar jub kyl 10.0.0.1 100.0.0.2 10.10.0.3
set cmd {unset COMPREPLY; _known_hosts_real -aF fixtures/_known_hosts_real/config ''; echo_array COMPREPLY}
assert_bash_list $hosts $cmd $test
@ -29,8 +29,8 @@ sync_after_int
set test "Hosts should have username prefix and colon suffix"
set hosts [get_hosts]
# Hosts `gee', `hus' and `jar' are defined in ./fixtures/_known_hosts_real/config
# doo, ike jub, 10.0.0.1, kyl and 100.0.0.2 in ./fixtures/_known_hosts_real/known_hosts
lappend hosts doo gee hus ike jar jub kyl 10.0.0.1 100.0.0.2
# doo, ike, jub, 10.0.0.1, kyl, 100.0.0.2, 10.10.0.3 and blah in ./fixtures/_known_hosts_real/known_hosts
lappend hosts blah doo gee hus ike jar jub kyl 10.0.0.1 100.0.0.2 10.10.0.3
set hosts [lsort -ascii $hosts]
set expected {}
foreach host $hosts {
@ -103,8 +103,8 @@ set test "Empty COMP_KNOWN_HOSTS_WITH_HOSTFILE should omit HOSTFILE"
assert_bash_exec "COMP_KNOWN_HOSTS_WITH_HOSTFILE="
set hosts [get_hosts_avahi]
# Hosts `gee', `hus' and `jar' are defined in ./fixtures/_known_hosts_real/config
# doo, ike, jub, 10.0.0.1, kyl and 100.0.0.2 in ./fixtures/_known_hosts_real/known_hosts
lappend hosts doo gee hus ike jar jub kyl 10.0.0.1 100.0.0.2
# doo, ike, jub, 10.0.0.1, kyl, 100.0.0.2, 10.10.0.3 and blah in ./fixtures/_known_hosts_real/known_hosts
lappend hosts blah doo gee hus ike jar jub kyl 10.0.0.1 100.0.0.2 10.10.0.3
# Call _known_hosts
set cmd {unset COMPREPLY; _known_hosts_real -aF fixtures/_known_hosts_real/config ''; echo_array COMPREPLY}
assert_bash_list $hosts $cmd $test