added basic ssl support to ircu
[ircu2.10.12-pk.git] / tests / channel-keys.cmd
1 define srv1 localhost:7601
2 define srv1-name irc.example.net
3 define srv2 localhost:7611
4 define srv2-name irc-2.example.net
5 define cl1-nick Op3rm4n
6 define cl2-nick Monitor
7 define channel #keytest
8
9 # Connect a client to each server, and join them to the same channel.
10 connect cl1 %cl1-nick% oper %srv1% :Some Channel Operator
11 connect cl2 %cl2-nick% oper %srv2% :Snoopy
12 :cl1 join %channel%
13 sync cl1,cl2
14 :cl2 join %channel%
15 sync cl1,cl2
16
17 # Set a plain and simple key initially.
18 :cl1 mode %channel% +k foo
19 :cl2 expect %cl1-nick% mode %channel% \\+k foo
20
21 # Slighly funny quoting here: one : for test-driver.pl and one for quoting.
22 # The final : makes the key invalid.
23 :cl1 mode %channel% -k+k foo :::badkey
24 :cl1 expect %srv1-name% 525 %channel% :Key is not well-formed
25 :cl2 expect %cl1-nick% mode %channel% -k foo
26
27 # Non-ASCII characters should be accepted in the key, and colons after the first character.
28 :cl1 mode %channel% +k mötör:head
29 :cl2 expect %cl1-nick% mode %channel% \\+k mötör:head
30
31 # We need to have a key, too.
32 :cl1 mode %channel% -k+k mötör:head
33 :cl1 expect %srv1-name% 461 MODE \\+k :Not enough parameters
34
35 # Are spaces accepted anywhere in the key?
36 :cl1 mode %channel% +k :: spaced key
37 :cl1 expect %srv1-name% 525 %channel% :Key is not well-formed
38
39 # What about commas?
40 :cl1 mode %channel% +k foo,bar
41 :cl1 expect %srv1-name% 525 %channel% :Key is not well-formed
42
43 # Is the key too long?
44 :cl1 mode %channel% +k 123456789012345678901234567890
45 :cl1 expect %srv1-name% 525 %channel% :Key is not well-formed