message-test.e 2.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148
  1. # ngIRCd test suite
  2. # PRIVMSG and NOTICE test
  3. spawn telnet localhost 6789
  4. expect {
  5. timeout { exit 1 }
  6. "Connected"
  7. }
  8. send "nick nick\r"
  9. send "user user . . :User\r"
  10. expect {
  11. timeout { exit 1 }
  12. "376"
  13. }
  14. send "privmsg nick :test\r"
  15. expect {
  16. timeout { exit 1 }
  17. "@* PRIVMSG nick :test"
  18. }
  19. send "privmsg nick\r"
  20. expect {
  21. timeout { exit 1 }
  22. "412"
  23. }
  24. send "privmsg\r"
  25. expect {
  26. timeout { exit 1 }
  27. "411"
  28. }
  29. send "privmsg nick,nick :test\r"
  30. expect {
  31. timeout { exit 1 }
  32. "@* PRIVMSG nick :test\r*@* PRIVMSG nick :test"
  33. }
  34. send "privmsg Nick,#testChannel,nick :test\r"
  35. expect {
  36. timeout { exit 1 }
  37. "@* PRIVMSG nick :test\r*401*@* PRIVMSG nick :test"
  38. }
  39. send "privmsg doesnotexist :test\r"
  40. expect {
  41. timeout { exit 1 }
  42. "401"
  43. }
  44. send "privmsg ~UsEr@ngIRCd.Test.Server :test\r"
  45. expect {
  46. timeout { exit 1 }
  47. "@* PRIVMSG nick :test"
  48. }
  49. send "mode nick +b\r"
  50. expect {
  51. timeout { exit 1 }
  52. "MODE nick :+b"
  53. }
  54. send "privmsg nick :test\r"
  55. expect {
  56. timeout { exit 1 }
  57. "486"
  58. }
  59. send "mode nick -b\r"
  60. expect {
  61. timeout { exit 1 }
  62. "MODE nick :-b"
  63. }
  64. # The following two tests using "localhost" as host name
  65. # had to be disabled, because there are operating systems
  66. # out there, that use "localhost.<domain>" as host name
  67. # for 127.0.0.1 instead of just "localhost".
  68. # (for example OpenBSD 4, OpenSolaris, ...)
  69. #
  70. #send "privmsg ~user\%localhost :test\r"
  71. #expect {
  72. # timeout { exit 1 }
  73. # "@* PRIVMSG nick :test"
  74. #}
  75. #
  76. #send "privmsg Nick!~User@LocalHost :test\r"
  77. #expect {
  78. # timeout { exit 1 }
  79. # "@* PRIVMSG nick :test"
  80. # "401"
  81. #}
  82. send "away :away\r"
  83. expect {
  84. timeout { exit 1 }
  85. "306"
  86. }
  87. send "privmsg nick :test\r"
  88. expect {
  89. timeout { exit 1 }
  90. "301"
  91. }
  92. send "away\r"
  93. expect {
  94. timeout { exit 1 }
  95. "305"
  96. }
  97. send "privmsg \$ngircd.test.server :test\r"
  98. expect {
  99. timeout { exit 1 }
  100. "481"
  101. }
  102. send "privmsg #*.de :test\r"
  103. expect {
  104. timeout { exit 1 }
  105. "481"
  106. }
  107. send "oper TestOp 123\r"
  108. send "privmsg \$ngircd.test.server :test\r"
  109. expect {
  110. timeout { exit 1 }
  111. "@* PRIVMSG nick :test"
  112. }
  113. send "privmsg \$*.test*.server :test\r"
  114. expect {
  115. timeout { exit 1 }
  116. "@* PRIVMSG nick :test"
  117. }
  118. send "privmsg \$noDotServer :test\r"
  119. expect {
  120. timeout { exit 1 }
  121. "401"
  122. }
  123. send "quit\r"
  124. expect {
  125. timeout { exit 1 }
  126. "Connection closed"
  127. }