message-test.e 2.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133
  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. # The following two tests using "localhost" as host name
  48. # had to be disabled, because there are operating systems
  49. # out there, that use "localhost.<domain>" as host name
  50. # for 127.0.0.1 instead of just "localhost".
  51. # (for example OpenBSD 4, OpenSolaris, ...)
  52. #
  53. #send "privmsg ~user\%localhost :test\r"
  54. #expect {
  55. # timeout { exit 1 }
  56. # "@* PRIVMSG nick :test"
  57. #}
  58. #
  59. #send "privmsg nick!~user@localhost :test\r"
  60. #expect {
  61. # timeout { exit 1 }
  62. # "@* PRIVMSG nick :test"
  63. # "401"
  64. #}
  65. send "away :away\r"
  66. expect {
  67. timeout { exit 1 }
  68. "306"
  69. }
  70. send "privmsg nick :test\r"
  71. expect {
  72. timeout { exit 1 }
  73. "301"
  74. }
  75. send "away\r"
  76. expect {
  77. timeout { exit 1 }
  78. "305"
  79. }
  80. send "privmsg \$ngircd.test.server :test\r"
  81. expect {
  82. timeout { exit 1 }
  83. "481"
  84. }
  85. send "privmsg #*.de :test\r"
  86. expect {
  87. timeout { exit 1 }
  88. "481"
  89. }
  90. send "oper TestOp 123\r"
  91. send "privmsg \$ngircd.test.server :test\r"
  92. expect {
  93. timeout { exit 1 }
  94. "@* PRIVMSG nick :test"
  95. }
  96. send "privmsg \$*.test*.server :test\r"
  97. expect {
  98. timeout { exit 1 }
  99. "@* PRIVMSG nick :test"
  100. }
  101. send "privmsg \$noDotServer :test\r"
  102. expect {
  103. timeout { exit 1 }
  104. "401"
  105. }
  106. #cannot test host mask since localhost has no '.' as RFC requires
  107. send "quit\r"
  108. expect {
  109. timeout { exit 1 }
  110. "Connection closed"
  111. }
  112. # -eof-