Commit 332bb59b authored by Per Cederqvist's avatar Per Cederqvist
Browse files

Initial commit.

parent 2b5b3d78
# Test what happens when too many clients try to connect.
# This test makes some assumptions:
# The server reserves file descriptor 0-11 for internal use.
# File descriptor 12 is used to listen for clients.
# File descriptor 13 is used to listen for muxes.
lyskomd_start "" "Open files: 18"
# fd 14
client_start 1
talk_to client 1
send "A3Hone\n"
simple_expect "LysKOM" "one up"
# fd 15
client_start 2
talk_to client 2
send "A3Htwo\n"
simple_expect "LysKOM" "two up"
# fd 16
client_start 3
talk_to client 3
send "A5Hthree\n"
simple_expect "LysKOM" "three up"
# fd 17
client_start 4
talk_to client 4
send "A4Hfour\n"
simple_expect "LysKOM" "four up"
# fd 18 -- not available
client_start 5
talk_to client 5
simple_expect "%% No connections left." "five closing down"
client_death 5
talk_to client 1
simple_expect ":0 11"
talk_to client 2
simple_expect ":0 11"
talk_to client 3
simple_expect ":0 11"
talk_to client 4
simple_expect ":0 11"
# fd 18 -- still not available
client_start 6
talk_to client 6
simple_expect "%% No connections left." "six closing down"
client_death 6
# The server sends at most one ":0 11" per minute. This test *should*
# never take more than a minute, so don't expect any ":0 11" here.
##
## talk_to client 1
## simple_expect ":0 11"
## talk_to client 2
## simple_expect ":0 11"
## talk_to client 3
## simple_expect ":0 11"
## talk_to client 4
## simple_expect ":0 11"
# Shut down fd 16
talk_to client 3
send "1 55 3\n"
simple_expect "=1"
simple_expect ":2 13 0 3"
client_death 3
talk_to client 1
simple_expect ":2 13 0 3"
talk_to client 2
simple_expect ":2 13 0 3"
talk_to client 4
simple_expect ":2 13 0 3"
# fd 16
client_start 7
talk_to client 7
send "A5Hseven\n"
simple_expect "LysKOM" "seven up"
# fd 18 -- not available again
client_start 8
talk_to client 8
simple_expect "%% No connections left." "eight closing down"
client_death 8
# The minute should not be up yet.
##
## talk_to client 1
## simple_expect ":0 11"
## talk_to client 2
## simple_expect ":0 11"
## talk_to client 4
## simple_expect ":0 11"
## talk_to client 7
## simple_expect ":0 11"
# Check that everything is up
talk_to client 1
send "31 56\n"
simple_expect "=31 1"
talk_to client 2
send "32 56\n"
simple_expect "=32 2"
talk_to client 4
send "33 56\n"
simple_expect "=33 4"
talk_to client 7
send "34 56\n"
simple_expect "=34 5"
# shut 'em all down
talk_to client 1
send "2 55 0\n"
simple_expect "=2"
simple_expect ":2 13 0 1"
client_death 1
talk_to client 2
simple_expect ":2 13 0 1"
talk_to client 4
simple_expect ":2 13 0 1"
talk_to client 7
simple_expect ":2 13 0 1"
talk_to client 2
send "20 55 0\n"
simple_expect "=20"
simple_expect ":2 13 0 2"
client_death 2
talk_to client 4
simple_expect ":2 13 0 2"
talk_to client 7
simple_expect ":2 13 0 2"
talk_to client 4
send "24 55 0\n"
simple_expect "=24"
simple_expect ":2 13 0 4"
client_death 4
talk_to client 7
simple_expect ":2 13 0 4"
talk_to client 7
send "27 55 0\n"
simple_expect "=27"
simple_expect ":2 13 0 5"
client_death 7
# Test shutdown via a signal
system "kill -HUP $lyskomd_pid"
lyskomd_death
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment