message-test.e 2.2 KB

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