Você não pode selecionar mais de 25 tópicos Os tópicos devem começar com uma letra ou um número, podem incluir traços ('-') e podem ter até 35 caracteres.

SNFMilterConfigTests.txt 9.4KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332
  1. SNFMilterConfig Tests
  2. $Id$
  3. SNFUtility revision 9
  4. Help functionality
  5. ------------------
  6. HELP-01: SNFMilterConfig without any command options outputs a help
  7. message.
  8. Result: Pass.
  9. Conflict detection
  10. ------------------
  11. CONFLICT-01: Run with -setup, -id, and -auth. Verify that help
  12. message is output, and that SNFMilterConfig takes no action.
  13. Result: Pass.
  14. CONFLICT-02: Run with -setup and -start. Verify that help message is
  15. output, and that SNFMilterConfig takes no action.
  16. Result: Pass.
  17. CONFLICT-03: Run with -setup and -stop. Verify that help message is
  18. output, and that SNFMilterConfig takes no action.
  19. Result: Pass.
  20. CONFLICT-04: Run with -setup and -mta=XXX, where XXX is postfix,
  21. sendmail, and none. Verify that help message is output, and that
  22. SNFMilterConfig takes no action.
  23. Result: Pass.
  24. CONFLICT-05: Run with -config=SNFMilter_second.xml -start. Verify
  25. that help message is output, and that SNFMilterConfig takes no action.
  26. Result: Pass.
  27. Setup/Repair functionality
  28. --------------------------
  29. SETUP-01: Start with no configuration files installed (SNFMilter.xml,
  30. identity.xml GBUdbIgnoreList.txt, and getRulebase). Verify that
  31. either "-setup" or "-repair" creates these files with the default
  32. credentials.
  33. Result: Pass.
  34. SETUP-02: Repeat SETUP-01 with -v and verify that files are created.
  35. Result: Pass.
  36. SETUP-03: Repeat SETUP-01 with -explain and verify that files are not created.
  37. Result: Pass? Exception thrown (as expected) when attempting to read
  38. configuration file that doesn't exist.
  39. Config file specification
  40. -------------------------
  41. CONF-01: Start with no configuration files, and copy the sample
  42. configuration file to test.xml. Run with "-setup -config=test.xml",
  43. and verify that all configuration files except
  44. /etc/snf-milter/SNFMilter.xml are created.
  45. Result: Pass.
  46. CONF-02: Repeat with -v and verify the same behavior.
  47. Result: Pass.
  48. CONF-03: Repeat with -explain.
  49. Result: Pass.
  50. Credential Functionality
  51. ------------------------
  52. CRED-01: Configure, and run "-id=xxx -auth=yyy" with specification of
  53. incorrect credentials. Verify:
  54. 1) getRulebase is not updated, and getRulebase.failed file is
  55. created.,
  56. 2) The rulebase downloaded fails, and an error message is output,
  57. 3) The identity.xml file is not changed.
  58. Result: Pass.
  59. CRED-02: Repeat CRED-01 with -v and verify correct operation.
  60. Result: Pass.
  61. CRED-03: Repeat CRED-01 with -explain and verify correct operation.
  62. Result: Pass.
  63. CRED-04: Install default configuration files. Modify identity.xml as
  64. follows:
  65. 1) Change the license ID to "XXX" and authentication to "YYY".
  66. 2) Add a comment.
  67. Then run with "-id=testmode -auth=setuptestingonly". Verify:
  68. 1) getRulebase is updated, and the new rulebase is downloaded.
  69. 2) identity.xml has only the license ID and authentication updated.
  70. Result: Pass.
  71. CRED-05: Repeat CRED-04 with -v and verify correct operation.
  72. Result: Pass.
  73. CRED-05: Repeat CRED-04 with -explain and verify correct operation.
  74. Result: Pass
  75. Start/stop functionality with XCI enabled
  76. -----------------------------------------
  77. START_STOP_XCI-01: Install default configuration files, and ensure
  78. that SNFMilter is stoped. Create a configuration file
  79. SNFMilter_xci.xml as follows:
  80. 1) Enable XCI.
  81. 2) Enable status.second logging, with no append.
  82. 3) Enable status.minute logging, with append.
  83. Do the following, specifying the configuration file SNFMilter_xci.xml:
  84. 1) Run SNFMilterConfig with "-start", and verify that SNFMilter starts.
  85. 2) Run SNFMilterConfig with "-start" again and verify that SNFMilter
  86. is not started again.
  87. 3) Run SNFMitlerConfig with "-stop" and verify that SNFMilter stops.
  88. 4) Run SNFMitlerConfig with "-stop" again and verify that SNFMilter
  89. is not stopped again.
  90. Result: Pass
  91. START_STOP_XCI-02: Repeat START_STOP_XCI-01 but with "-v" in the command-line.
  92. Result: Pass
  93. START_STOP_XCI-03: Configure as for START_STOP_XCI-01, and do the following:
  94. 1) Run SNFMilterConfig with "-start -explain". Verify correct
  95. output, and that SNFMilterConfig doesn't start SNFMilter.
  96. 2) Run SNFMilterConfig with "-stop -explain". Verify correct
  97. output, and that SNFMilterConfig doesn't stop SNFMilter.
  98. 3) Start SNFMilter.
  99. 4) Run SNFMilterConfig with "-start -explain". Verify correct
  100. output, and that SNFMilterConfig doesn't start SNFMilter.
  101. 5) Run SNFMilterConfig with "-stop -explain". Verify correct
  102. output, and that SNFMilterConfig doesn't stop SNFMilter.
  103. Result: Pass
  104. Start/stop functionality with XCI disabled, status.second enabled
  105. -----------------------------------------------------------------
  106. START_STOP_SEC-01: Install default configuration files, and ensure
  107. that SNFMilter is stopped. Install configuration file
  108. SNFMilter_second.xml with the following configuration:
  109. 1) Disable XCI.
  110. 2) Enable status.second logging, with no append.
  111. 3) Enable status.minute logging, with append.
  112. Do the following, specifying the configuration file SNFMilter_second.xml:
  113. 1) Run "SNFMilterConfig -start -v", and verify that SNFMilter
  114. starts.
  115. 2) Run "SNFMilterConfig -start -v" again and verify that SNFMilter
  116. is not started again.
  117. 3) Run "SNFMilterConfig -stop -v" and verify that SNFMilter stops.
  118. 4) Run "SNFMilterConfig -stop -v" again and verify that SNFMilter is
  119. not stopped again.
  120. Result:
  121. START_STOP_SEC-02: Repeat START_STOP_SEC-01 but without "-v" in the
  122. command-line.
  123. Result:
  124. START_STOP_SEC-03: Configure as for START_STOP_SEC-01, and do the
  125. following:
  126. 1) Run SNFMilterConfig with "-start -explain". Verify correct
  127. output, and that SNFMilterConfig doesn't start SNFMilter.
  128. 2) Run SNFMilterConfig with "-stop -explain". Verify correct
  129. output, and that SNFMilterConfig doesn't stop SNFMilter.
  130. 3) Start SNFMilter.
  131. 4) Run SNFMilterConfig with "-start -explain". Verify correct
  132. output, and that SNFMilterConfig doesn't start SNFMilter.
  133. 5) Run SNFMilterConfig with "-stop -explain". Verify correct
  134. output, and that SNFMilterConfig doesn't stop SNFMilter.
  135. Result:
  136. Start/stop functionality with XCI and status.second enabled, append mode
  137. ------------------------------------------------------------------------
  138. START_STOP_SEC_APP-01: Install default configuration files, and ensure
  139. that SNFMilter is stopped. Create a configuration file
  140. SNFMilter_second_append.xml as follows:
  141. 1) Disable XCI.
  142. 2) Enable status.second logging with append.
  143. 3) Enable status.minute logging, with append.
  144. Do the following, specifying the configuration file SNFMilter_second_append.xml:
  145. 1) Run "SNFMilterConfig -config=SNFMilter_second_append.xml -start",
  146. and verify that SNFMilter starts.
  147. 2) Run "SNFMilterConfig -config=SNFMilter_second_append.xml -start"
  148. again and verify that SNFMilter is not started again.
  149. 3) Run "SNFMilterConfig -config=SNFMilter_second_append.xml -stop"
  150. and verify that SNFMilter stops.
  151. 4) Run "SNFMilterConfig -config=SNFMilter_second_append.xml -stop"
  152. again and verify that SNFMilter is not stopped again.
  153. Result:
  154. START_STOP_SEC_APP-02: Repeat START_STOP_SEC_APP-01 but with "-v" in
  155. the command-line.
  156. Result:
  157. START_STOP_SEC_APP-03: Configure as for START_STOP_SEC_APP-01, and do
  158. the following:
  159. 1) Run SNFMilterConfig with "-start -explain". Verify correct
  160. output, and that SNFMilterConfig doesn't start SNFMilter.
  161. 2) Run SNFMilterConfig with "-stop -explain". Verify correct
  162. output, and that SNFMilterConfig doesn't stop SNFMilter.
  163. 3) Start SNFMilter.
  164. 4) Run SNFMilterConfig with "-start -explain". Verify correct
  165. output, and that SNFMilterConfig doesn't start SNFMilter.
  166. 5) Run SNFMilterConfig with "-stop -explain". Verify correct
  167. output, and that SNFMilterConfig doesn't stop SNFMilter.
  168. Result:
  169. Start/stop functionality with XCI and status.second disabled, status.minute enabled
  170. -----------------------------------------------------------------------------------
  171. START_STOP_MIN-01: Install default configuration files, and ensure
  172. that SNFMilter is stopped. Create a configuration file
  173. SNFMilter_minute.xml as follows:
  174. 1) Disable XCI.
  175. 2) Disable status.second logging.
  176. 3) Enable status.minute logging, with append.
  177. Do the following, specifying the configuration file SNFMilter_minute.xml:
  178. 1) Run "SNFMilterConfig -config=SNFMilter_minute.xml -start", and verify that SNFMilter starts.
  179. 2) Run "SNFMilterConfig -config=SNFMilter_minute.xml -start" again
  180. and verify that SNFMilter is not started again.
  181. 3) Run "SNFMilterConfig -config=SNFMilter_minute.xml -stop" and
  182. verify that SNFMilter stops.
  183. 4) Run "SNFMilterConfig -config=SNFMilter_minute.xml -stop" again
  184. and verify that SNFMilter is not stopped again.
  185. Result:
  186. START_STOP_MIN-02: Repeat START_STOP_MIN-01 but with "-v" in the
  187. command-line.
  188. Result:
  189. START_STOP_MIN-03: Configure as for START_STOP_MIN-01, and do the
  190. following:
  191. 1) Run SNFMilterConfig with "-start -explain". Verify correct
  192. output, and that SNFMilterConfig doesn't start SNFMilter.
  193. 2) Run SNFMilterConfig with "-stop -explain". Verify correct
  194. output, and that SNFMilterConfig doesn't stop SNFMilter.
  195. 3) Start SNFMilter.
  196. 4) Run SNFMilterConfig with "-start -explain". Verify correct
  197. output, and that SNFMilterConfig doesn't start SNFMilter.
  198. 5) Run SNFMilterConfig with "-stop -explain". Verify correct
  199. output, and that SNFMilterConfig doesn't stop SNFMilter.
  200. Result: