misc-test.e 2.1 KB

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