added basic ssl support to ircu
[ircu2.10.12-pk.git] / tests / bug-1840011.cmd
1 define srv1 localhost:7601
2 define srv1-name irc.example.net
3 define hidden-srv *.undernet.org
4 define channel #random-channel
5 define cl1-nick Ch4n0pm4n
6
7 # Connect a client and join it to the test channel.
8 connect cl1 %cl1-nick% op3rm4n %srv1% :Some Chanop
9 :cl1 join %channel%
10
11 # Issue a variety of bans, all of which should be accepted.
12 :cl1 mode %channel% +b *!*@1.0.0.0/16
13 :cl1 mode %channel% +b *!*@1.0.0.*
14 :cl1 mode %channel% +b *!*@*.example.com
15 :cl1 mode %channel% +b *!foo@*.example.org
16 :cl1 mode %channel% +b *!*@*.bar.example.*
17
18 # Check the modes on the channel.
19 :cl1 mode %channel% +b
20 # These regexps make my eyes bleed almost enough to add a load of code to test-driver.pl.
21 # There's another test-driver problem here, too: one "expect" works fine, but a second
22 # one never sees the second numeric response from the server.
23 :cl1 expect %srv1-name% 367 %channel% \\*!\\*@\\*\\.bar\\.example\\.* %cl1-nick% \\d+
24
25 # Check that a more-encompassing ban removes the old bans.
26 :cl1 mode %channel% +b *!*@1.0.*
27 :cl1 expect %cl1-nick% mode %channel% -bb\\+b \\*!\\*@1\\.0\\.0\\.\\* \\*!\\*@1\\.0\\.0\\.0/16 \\*!\\*@1\\.0\\.\\*
28
29 # Check that a narrower ban cannot be added.
30 # Somewhat sadly, the first command gets no response at all.
31 :cl1 mode %channel% +b *!*@1.0.0.1
32 :cl1 mode %channel% +b
33 :cl1 expect %srv1-name% 367 %channel% \\*!\\*@1\\.0\\.\\* %cl1-nick% \\d+
34
35 # Can we remove a broader ban and add a narrow ban at the same time?
36 # This was the core of the bug report (SF#1840011).
37 :cl1 mode %channel% -b+b *!*@1.0.* *!*@1.0.0.1
38 :cl1 expect %cl1-nick% mode %channel% -b\\+b \\*!\\*@1\\.0\\.\\* \\*!\\*@1\\.0\\.0\\.1
39 :cl1 quit done