Du kan inte välja fler än 25 ämnen Ämnen måste starta med en bokstav eller siffra, kan innehålla bindestreck ('-') och vara max 35 tecken långa.

SNFMilterConfigTests.txt 9.1KB

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 configuration file SNFMilter_second.xml
  107. with the following configuration:
  108. 1) Disable XCI.
  109. 2) Enable status.second logging, with no append.
  110. 3) Enable status.minute logging, with append.
  111. Do the following:
  112. 1) Run "SNFMilterConfig -start -v", and verify that SNFMilter
  113. starts.
  114. 2) Run "SNFMilterConfig -start -v" again and verify that SNFMilter
  115. is still running.
  116. 3) Run "SNFMilterConfig -stop -v" and verify that SNFMilter stops.
  117. 4) Run "SNFMilterConfig -stop -v" again and verify that SNFMilter is
  118. still stopped.
  119. Result: Pass
  120. START_STOP_SEC-02: Repeat START_STOP_SEC-01 but without "-v" in the
  121. command-line.
  122. Result: Pass
  123. START_STOP_SEC-03: Configure as for START_STOP_SEC-01, and do the
  124. following:
  125. 1) Run SNFMilterConfig with "-start -explain". Verify correct
  126. output, and that SNFMilter is still stopped.
  127. 2) Run SNFMilterConfig with "-stop -explain". Verify correct
  128. output, and that SNFMilter is still stopped.
  129. 3) Start SNFMilter.
  130. 4) Run SNFMilterConfig with "-start -explain". Verify correct
  131. output, and that SNFMilter is still running.
  132. 5) Run SNFMilterConfig with "-stop -explain". Verify correct
  133. output, and that SNFMilter is still running.
  134. Result: Pass
  135. Start/stop functionality with XCI disabled and status.second enabled, append mode
  136. ---------------------------------------------------------------------------------
  137. START_STOP_SEC_APP-01: Install configuration file
  138. SNFMilter_second_append.xml with the following configuration:
  139. 1) Disable XCI.
  140. 2) Enable status.second logging with append.
  141. 3) Enable status.minute logging, with append.
  142. 4) Set localtime to "no" for rotation.
  143. Do the following when the local date is different from the date from
  144. gmtime():
  145. 1) Run "SNFMilterConfig -start -v", and verify that SNFMilter
  146. starts.
  147. 2) Run "SNFMilterConfig -start -v" again and verify that SNFMilter
  148. is still running.
  149. 3) Run "SNFMilterConfig -v -stop" and verify that SNFMilter stops.
  150. 4) Run "SNFMilterConfig -stop -v" again and verify that SNFMilter is
  151. still stopped.
  152. Result: Pass
  153. START_STOP_SEC_APP-02: Repeat START_STOP_SEC_APP-01 but without "-v"
  154. in the command-line.
  155. Result:
  156. START_STOP_SEC_APP-03: Configure as for START_STOP_SEC_APP-01, and do
  157. the following:
  158. 1) Run SNFMilterConfig with "-start -explain". Verify correct
  159. output, and that SNFMilterConfig doesn't start SNFMilter.
  160. 2) Run SNFMilterConfig with "-stop -explain". Verify correct
  161. output, and that SNFMilterConfig doesn't stop SNFMilter.
  162. 3) Start SNFMilter.
  163. 4) Run SNFMilterConfig with "-start -explain". Verify correct
  164. output, and that SNFMilterConfig doesn't start SNFMilter.
  165. 5) Run SNFMilterConfig with "-stop -explain". Verify correct
  166. output, and that SNFMilterConfig doesn't stop SNFMilter.
  167. Result:
  168. Start/stop functionality with XCI and status.second disabled, status.minute enabled
  169. -----------------------------------------------------------------------------------
  170. START_STOP_MIN-01: Install default configuration files, and ensure
  171. that SNFMilter is stopped. Create a configuration file
  172. SNFMilter_minute.xml as follows:
  173. 1) Disable XCI.
  174. 2) Disable status.second logging.
  175. 3) Enable status.minute logging, with append.
  176. Do the following, specifying the configuration file SNFMilter_minute.xml:
  177. 1) Run "SNFMilterConfig -config=SNFMilter_minute.xml -start", and verify that SNFMilter starts.
  178. 2) Run "SNFMilterConfig -config=SNFMilter_minute.xml -start" again
  179. and verify that SNFMilter is not started again.
  180. 3) Run "SNFMilterConfig -config=SNFMilter_minute.xml -stop" and
  181. verify that SNFMilter stops.
  182. 4) Run "SNFMilterConfig -config=SNFMilter_minute.xml -stop" again
  183. and verify that SNFMilter is not stopped again.
  184. Result:
  185. START_STOP_MIN-02: Repeat START_STOP_MIN-01 but with "-v" in the
  186. command-line.
  187. Result:
  188. START_STOP_MIN-03: Configure as for START_STOP_MIN-01, and do the
  189. following:
  190. 1) Run SNFMilterConfig with "-start -explain". Verify correct
  191. output, and that SNFMilterConfig doesn't start SNFMilter.
  192. 2) Run SNFMilterConfig with "-stop -explain". Verify correct
  193. output, and that SNFMilterConfig doesn't stop SNFMilter.
  194. 3) Start SNFMilter.
  195. 4) Run SNFMilterConfig with "-start -explain". Verify correct
  196. output, and that SNFMilterConfig doesn't start SNFMilter.
  197. 5) Run SNFMilterConfig with "-stop -explain". Verify correct
  198. output, and that SNFMilterConfig doesn't stop SNFMilter.
  199. Result: