mode-test.e 2.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176
  1. # $Id: mode-test.e,v 1.7 2008/02/16 11:27:49 fw Exp $
  2. spawn telnet localhost 6789
  3. expect {
  4. timeout { exit 1 }
  5. "Connected"
  6. }
  7. send "nick nick\r"
  8. send "user user . . :User\r"
  9. expect {
  10. timeout { exit 1 }
  11. "376"
  12. }
  13. send "mode nick +i\r"
  14. expect {
  15. timeout { exit 1 }
  16. "@* MODE nick :+i"
  17. }
  18. send "mode nick\r"
  19. expect {
  20. timeout { exit 1 }
  21. "221 nick +i"
  22. }
  23. send "mode nick -i\r"
  24. expect {
  25. timeout { exit 1 }
  26. "@* MODE nick :-i"
  27. }
  28. send "join #usermode\r"
  29. expect {
  30. timeout { exit 1 }
  31. "@* JOIN :#usermode"
  32. }
  33. expect {
  34. timeout { exit 1 }
  35. "366"
  36. }
  37. send "mode #usermode +v nick\r"
  38. expect {
  39. timeout { exit 1 }
  40. "@* MODE #usermode +v nick\r"
  41. }
  42. send "mode #usermode +h nick\r"
  43. expect {
  44. timeout { exit 1 }
  45. "@* MODE #usermode +h nick\r"
  46. }
  47. send "mode #usermode +a nick\r"
  48. expect {
  49. timeout { exit 1 }
  50. "482 nick"
  51. }
  52. send "mode #usermode +q nick\r"
  53. expect {
  54. timeout { exit 1 }
  55. "482 nick"
  56. }
  57. send "mode #usermode -vho nick nick nick\r"
  58. expect {
  59. timeout { exit 1 }
  60. "@* MODE #usermode -vho nick nick nick"
  61. }
  62. send "oper TestOp 123\r"
  63. expect {
  64. timeout { exit 1 }
  65. "MODE nick :+o"
  66. }
  67. expect {
  68. timeout { exit 1 }
  69. "381 nick"
  70. }
  71. send "mode nick\r"
  72. expect {
  73. timeout { exit 1 }
  74. "221 nick +o"
  75. }
  76. send "mode #usermode +a nick\r"
  77. expect {
  78. timeout { exit 1 }
  79. "@* MODE #usermode +a nick"
  80. }
  81. send "mode #usermode +q nick\r"
  82. expect {
  83. timeout { exit 1 }
  84. "@* MODE #usermode +q nick"
  85. }
  86. send "names #usermode\r"
  87. expect {
  88. timeout { exit 1 }
  89. "353 nick = #usermode :~nick"
  90. }
  91. expect {
  92. timeout { exit 1 }
  93. "366 nick #usermode"
  94. }
  95. send "part #usermode\r"
  96. expect {
  97. timeout { exit 1 }
  98. "@* PART #usermode"
  99. }
  100. send "join #channel\r"
  101. expect {
  102. timeout { exit 1 }
  103. "@* JOIN :#channel"
  104. }
  105. expect {
  106. timeout { exit 1 }
  107. "366"
  108. }
  109. send "mode #channel +tn\r"
  110. expect {
  111. timeout { exit 1 }
  112. "@* MODE #channel +tn"
  113. }
  114. send "mode #channel\r"
  115. expect {
  116. timeout { exit 1 }
  117. "324 nick #channel +tn"
  118. }
  119. send "mode #channel +v nick\r"
  120. expect {
  121. timeout { exit 1 }
  122. "@* MODE #channel +v nick\r"
  123. }
  124. send "mode #channel +I nick1\r"
  125. expect {
  126. timeout { exit 1 }
  127. "@* MODE #channel +I nick1!*@*"
  128. }
  129. send "mode #channel +b nick2@domain\r"
  130. expect {
  131. timeout { exit 1 }
  132. "@* MODE #channel +b nick2!*@domain"
  133. }
  134. send "mode #channel +I nick3!user\r"
  135. expect {
  136. timeout { exit 1 }
  137. "@* MODE #channel +I nick3!user@*"
  138. }
  139. send "mode #channel -vo nick nick\r"
  140. expect {
  141. timeout { exit 1 }
  142. "@* MODE #channel -vo nick nick\r"
  143. }
  144. send "quit\r"
  145. expect {
  146. timeout { exit 1 }
  147. "Connection closed"
  148. }
  149. # -eof-