misc-test.e 2.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165
  1. # $Id: misc-test.e,v 1.2 2008/02/17 13:51:00 alex 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. # RFC 2812 Section 3.4.1
  14. send "motd\r"
  15. expect {
  16. timeout { exit 1 }
  17. "375"
  18. }
  19. expect {
  20. timeout { exit 1 }
  21. "372"
  22. }
  23. expect {
  24. timeout { exit 1 }
  25. "376"
  26. }
  27. send "motd ngircd.test.server\r"
  28. expect {
  29. timeout { exit 1 }
  30. "375"
  31. }
  32. expect {
  33. timeout { exit 1 }
  34. "372"
  35. }
  36. expect {
  37. timeout { exit 1 }
  38. "376"
  39. }
  40. send "motd doesnotexist\r"
  41. expect {
  42. timeout { exit 1 }
  43. "402"
  44. # note this is not specified in RFC 2812, but probably should be
  45. }
  46. # RFC 2812 Section 3.4.3
  47. send "version\r"
  48. expect {
  49. timeout { exit 1 }
  50. "351"
  51. }
  52. send "version ngircd.test.server\r"
  53. expect {
  54. timeout { exit 1 }
  55. "351"
  56. }
  57. send "version doesnotexist\r"
  58. expect {
  59. timeout { exit 1 }
  60. "402"
  61. }
  62. # RFC 2812 Section 3.4.6
  63. send "time\r"
  64. expect {
  65. timeout { exit 1 }
  66. "391"
  67. }
  68. send "time ngircd.test.server\r"
  69. expect {
  70. timeout { exit 1 }
  71. "391"
  72. }
  73. send "time doesnotexist\r"
  74. expect {
  75. timeout { exit 1 }
  76. "402"
  77. }
  78. # RFC 2812 Section 3.4.10
  79. send "info\r"
  80. expect {
  81. timeout { exit 1 }
  82. "371"
  83. }
  84. expect {
  85. timeout { exit 1 }
  86. "374"
  87. }
  88. # RFC 2812 Section 4.5
  89. send "summon\r"
  90. expect {
  91. timeout { exit 1 }
  92. "445"
  93. }
  94. # RFC 2812 Section 4.6
  95. send "users\r"
  96. expect {
  97. timeout { exit 1 }
  98. "446"
  99. }
  100. # RFC 2812 Section 4.8
  101. send "userhost\r"
  102. expect {
  103. timeout { exit 1 }
  104. "461"
  105. }
  106. send "userhost nick\r"
  107. expect {
  108. timeout { exit 1 }
  109. -re ":ngircd.test.server 302 nick :?nick=+.*@(localhos.*|127.0.0.1)"
  110. }
  111. send "userhost doesnotexist\r"
  112. expect {
  113. timeout { exit 1 }
  114. ":ngircd.test.server 302 nick :\r"
  115. }
  116. send "userhost nick doesnotexist nick doesnotexist\r"
  117. expect {
  118. timeout { exit 1 }
  119. -re ":ngircd.test.server 302 nick :nick=+.*@(localhos.*|127.0.0.1) nick=+.*@(localhos.*|127.0.0.1)"
  120. }
  121. send "away :testing\r"
  122. expect {
  123. timeout { exit 1 }
  124. "306 nick"
  125. }
  126. send "userhost nick nick nick nick nick nick\r"
  127. expect {
  128. timeout { exit 1 }
  129. -re ":ngircd.test.server 302 nick :nick=-.*@(localhos.*|127.0.0.1) nick=-.*@(localhos.*|127.0.0.1) nick=-.*@(localhos.*|127.0.0.1) nick=-.*@(localhos.*|127.0.0.1) nick=-.*@(localhos.*|127.0.0.1)\r"
  130. }
  131. send "quit\r"
  132. expect {
  133. timeout { exit 1 }
  134. "ERROR"
  135. }
  136. # -eof-