Вы не можете выбрать более 25 тем Темы должны начинаться с буквы или цифры, могут содержать дефисы(-) и должны содержать не более 35 символов.

SNFMilterConfigTests.txt 14KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514
  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=xxx, and -auth=yyy. Verify that
  12. help 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 each of the following command line
  21. parameters:
  22. 1) -auth
  23. 2) -auth=
  24. 3) -auth=xxx
  25. 4) -id
  26. 5) -id=
  27. 6) -id=xxx
  28. Verify that in each case the help message is output, and that
  29. SNFMilterConfig takes no action.
  30. Result: Pass.
  31. CONFLICT-05: Run with -setup and -mta=XXX, where XXX is postfix,
  32. sendmail, and none. Verify that help message is output, and that
  33. SNFMilterConfig takes no action.
  34. Result: Pass.
  35. CONFLICT-06: Run with -mta=postfix and one of the following commands:
  36. 1) -auth
  37. 2) -auth=
  38. 3) -auth=xxx
  39. 4) -id
  40. 5) -id=
  41. 6) -id=xxx
  42. Verify that in each case the help message is output, and that
  43. SNFMilterConfig takes no action.
  44. Result: Pass.
  45. Setup/Repair functionality
  46. --------------------------
  47. SETUP-01: Start with no configuration files installed (SNFMilter.xml,
  48. identity.xml GBUdbIgnoreList.txt, and getRulebase). Verify that
  49. either "-setup" or "-repair" creates these files with the default
  50. credentials.
  51. Result: Pass.
  52. SETUP-02: Repeat SETUP-01 with -v and verify that files are created.
  53. Result: Pass.
  54. SETUP-03: Repeat SETUP-01 with -explain and verify that files are not created.
  55. Result: Pass? Exception thrown (as expected) when attempting to read
  56. configuration file that doesn't exist.
  57. Credential Functionality
  58. ------------------------
  59. CRED-01: Configure, and run "-id=xxx -auth=yyy" with specification of
  60. incorrect credentials. Verify:
  61. 1) getRulebase is not updated, and getRulebase.failed file is
  62. created.,
  63. 2) The rulebase downloaded fails, and an error message is output,
  64. 3) The identity.xml file is not changed.
  65. Result: Pass.
  66. CRED-02: Repeat CRED-01 with -v and verify correct operation.
  67. Result: Pass.
  68. CRED-03: Repeat CRED-01 with -explain and verify correct operation.
  69. Result: Pass.
  70. CRED-04: Install default configuration files. Modify identity.xml as
  71. follows:
  72. 1) Change the license ID to "XXX" and authentication to "YYY".
  73. 2) Add a comment.
  74. Then run with "-id=testmode -auth=setuptestingonly". Verify:
  75. 1) getRulebase is updated, and the new rulebase is downloaded.
  76. 2) identity.xml has only the license ID and authentication updated.
  77. Result: Pass.
  78. CRED-05: Repeat CRED-04 with -v and verify correct operation.
  79. Result: Pass.
  80. CRED-05: Repeat CRED-04 with -explain and verify correct operation.
  81. Result: Pass
  82. Start/stop functionality with XCI enabled
  83. -----------------------------------------
  84. START_STOP_XCI-01: Install configuration file SNFMilter_xci.xml with
  85. the following configuration:
  86. 1) Enable XCI.
  87. 2) Enable status.second logging, with no append.
  88. 3) Enable status.minute logging, with append.
  89. Do the following, specifying the configuration file SNFMilter_xci.xml:
  90. 1) Run SNFMilterConfig with "-v -start", and verify that SNFMilter
  91. starts.
  92. 2) Run SNFMilterConfig with "-start -v" again and verify that
  93. SNFMilter is still running.
  94. 3) Run SNFMitlerConfig with "-stop -v" and verify that SNFMilter
  95. stops.
  96. 4) Run SNFMitlerConfig with "-stop -v" again and verify that
  97. SNFMilter is still stopped.
  98. Result: Pass.
  99. START_STOP_XCI-02: Repeat START_STOP_XCI-01 but without "-v" in the
  100. command-line.
  101. Result: Pass.
  102. START_STOP_XCI-03: Configure as for START_STOP_XCI-01, and do the following:
  103. 1) Run SNFMilterConfig with "-start -explain". Verify correct
  104. output, and that SNFMilter isn't started.
  105. 2) Run SNFMilterConfig with "-stop -explain". Verify correct
  106. output, and that SNFMilter isn't started.
  107. 3) Start SNFMilter.
  108. 4) Run SNFMilterConfig with "-start -explain". Verify correct
  109. output, and that SNFMilter is still running.
  110. 5) Run SNFMilterConfig with "-stop -explain". Verify correct
  111. output, and that SNFMilter is still running.
  112. Result: Pass.
  113. Start/stop functionality with XCI disabled, status.second enabled
  114. -----------------------------------------------------------------
  115. START_STOP_SEC-01: Install configuration file SNFMilter_second.xml
  116. with the following configuration:
  117. 1) Disable XCI.
  118. 2) Enable status.second logging, with no append.
  119. 3) Enable status.minute logging, with append.
  120. Do the following:
  121. 1) Run "SNFMilterConfig -start -v", and verify that SNFMilter
  122. starts.
  123. 2) Run "SNFMilterConfig -start -v" again and verify that SNFMilter
  124. is still running.
  125. 3) Run "SNFMilterConfig -stop -v" and verify that SNFMilter stops.
  126. 4) Run "SNFMilterConfig -stop -v" again and verify that SNFMilter is
  127. still stopped.
  128. Result: Pass.
  129. START_STOP_SEC-02: Repeat START_STOP_SEC-01 but without "-v" in the
  130. command-line.
  131. Result: Pass.
  132. START_STOP_SEC-03: Configure as for START_STOP_SEC-01, and do the
  133. following:
  134. 1) Run SNFMilterConfig with "-start -explain". Verify correct
  135. output, and that SNFMilter is still stopped.
  136. 2) Run SNFMilterConfig with "-stop -explain". Verify correct
  137. output, and that SNFMilter is still stopped.
  138. 3) Start SNFMilter.
  139. 4) Run SNFMilterConfig with "-start -explain". Verify correct
  140. output, and that SNFMilter is still running.
  141. 5) Run SNFMilterConfig with "-stop -explain". Verify correct
  142. output, and that SNFMilter is still running.
  143. Result: Pass.
  144. Start/stop functionality with XCI disabled and status.second enabled, append mode
  145. ---------------------------------------------------------------------------------
  146. START_STOP_SEC_APP-01: Install configuration file
  147. SNFMilter_second_append.xml with the following configuration:
  148. 1) Disable XCI.
  149. 2) Enable status.second logging with append.
  150. 3) Enable status.minute logging, with append.
  151. 4) Set localtime to "no" for rotation.
  152. Do the following when the local date is different from the date from
  153. gmtime(). In each step, verify that the datestamp is the universal
  154. date.
  155. 1) Run "SNFMilterConfig -start -v", and verify that SNFMilter
  156. starts.
  157. 2) Run "SNFMilterConfig -start -v" again and verify that SNFMilter
  158. is still running.
  159. 3) Run "SNFMilterConfig -v -stop" and verify that SNFMilter stops.
  160. 4) Run "SNFMilterConfig -stop -v" again and verify that SNFMilter is
  161. still stopped.
  162. Result: Pass.
  163. START_STOP_SEC_APP-02: Repeat START_STOP_SEC_APP-01 but without "-v"
  164. in the command-line.
  165. Result: Pass.
  166. START_STOP_SEC_APP-03: Configure as for START_STOP_SEC_APP-01, and do
  167. the following when the local date is different from the date from
  168. gmtime(). In each step, verify that the datestamp is the universal
  169. date.
  170. 1) Run SNFMilterConfig with "-start -explain". Verify correct
  171. output, and that SNFMilterConfig doesn't start SNFMilter.
  172. 2) Run SNFMilterConfig with "-stop -explain". Verify correct
  173. output, and that SNFMilterConfig doesn't stop SNFMilter.
  174. 3) Start SNFMilter.
  175. 4) Run SNFMilterConfig with "-start -explain". Verify correct
  176. output, and that SNFMilterConfig doesn't start SNFMilter.
  177. 5) Run SNFMilterConfig with "-stop -explain". Verify correct
  178. output, and that SNFMilterConfig doesn't stop SNFMilter.
  179. Result: Pass.
  180. Start/stop functionality with XCI and status.second disabled, status.minute enabled
  181. -----------------------------------------------------------------------------------
  182. START_STOP_MIN-01: Install default configuration files, and ensure
  183. that SNFMilter is stopped. Create a configuration file
  184. SNFMilter_minute.xml as follows:
  185. 1) Disable XCI.
  186. 2) Disable status.second logging.
  187. 3) Enable status.minute logging, with append.
  188. 4) Set localtime to "yes" for rotation.
  189. Do the following when the local date is different from the date from
  190. gmtime(). In each step, verify that the datestamp is the local date.
  191. 1) Run "SNFMilterConfig -start -v", and verify that SNFMilter
  192. starts.
  193. 2) Run "SNFMilterConfig -v -start" again and verify that SNFMilter
  194. is not started again.
  195. 3) Run "SNFMilterConfig -v -stop" and verify that SNFMilter stops.
  196. 4) Run "SNFMilterConfig -stop -v" again and verify that SNFMilter is
  197. not stopped again.
  198. Result: Pass.
  199. START_STOP_MIN-02: Repeat START_STOP_MIN-01 but with the following
  200. changes:
  201. 1) Delete all files in the SNFMilter log directory.
  202. 2) Set the time to 23:59:30 and immediately run "SNFMilterConfig
  203. -start -v".
  204. 3) Verify that:
  205. a) SNFMilter starts.
  206. b) SNFMilterConfig changed the name of the log file it was
  207. checking when checking whether SNFMilter is running before
  208. starting SNFMilter.
  209. Result:
  210. START_STOP_MIN-03: Configure as for START_STOP_MIN-01, and do the
  211. following when the local date is different from the date from
  212. gmtime(). In each step, verify that the datestamp is the local date.
  213. 1) Run SNFMilterConfig with "-start -explain". Verify correct
  214. output, and that SNFMilterConfig doesn't start SNFMilter.
  215. 2) Run SNFMilterConfig with "-stop -explain". Verify correct
  216. output, and that SNFMilterConfig doesn't stop SNFMilter.
  217. 3) Start SNFMilter.
  218. 4) Run SNFMilterConfig with "-start -explain". Verify correct
  219. output, and that SNFMilterConfig doesn't start SNFMilter.
  220. 5) Run SNFMilterConfig with "-stop -explain". Verify correct
  221. output, and that SNFMilterConfig doesn't stop SNFMilter.
  222. Result:
  223. Integration with postfix
  224. ------------------------
  225. POSTFIX-01: On Ubuntu, set up the environment as follows:
  226. 1) Default configuration files for SNFMilter.
  227. 2) SNFMilter stopped.
  228. 3) Default configuration files for postfix.
  229. 4) postfix stopped.
  230. Do the following:
  231. 1) Run SNFMilterConfig with "-with=postfix -v" and verify that the
  232. postfix configuration files are updated to be integrated with
  233. SNFMilter. Verify also that both postfix and SNFMilter are
  234. stopped.
  235. 2) Run SNFMilterConfig with "-with=postfix -v" and verify that the
  236. postfix configuration files are not updated, and that both
  237. postfix and SNFMilter are stopped.
  238. 3) Run SNFMilterConfig with "-with=none -v" and verify that the
  239. postfix configuration files are updated such that the integration
  240. with SNFMilter is removed. Verify also that both postfix and
  241. SNFMilter are stopped.
  242. 4) Run SNFMilterConfig with "-with=none -v" and verify that the
  243. postfix configuration files are not updated, and that both
  244. postfix and SNFMilter are stopped.
  245. Result: Pass.
  246. POSTFIX-02: Repeat POSTFIX-01 but without "-v".
  247. Result: Pass.
  248. POSTFIX-03: Configure as for POSTFIX-01, and do the following:
  249. 1) Run SNFMilterConfig with "-with=postfix -explain". Verify
  250. correct output, and that SNFMilterConfig doesn't update the
  251. postfix configuration files or reload any MTA.
  252. 2) Run SNFMilterConfig with "-with=none -explain". Verify correct
  253. output, and that SNFMilterConfig doesn't update the postfix
  254. configuration files or reload any MTA.
  255. 3) Run SNFMilterConfig with "-with=postfix". Verify correct output,
  256. and that SNFMilterConfig updates the postfix configuration files.
  257. 4) Run SNFMilterConfig with "-with=postfix -explain". Verify
  258. correct output, and that SNFMilterConfig doesn't update the
  259. postfix configuration files or reload any MTA.
  260. 5) Run SNFMilterConfig with "-with=none -explain". Verify correct
  261. output, and that SNFMilterConfig doesn't update the postfix
  262. configuration files or reload any MTA.
  263. Result: Pass
  264. POSTFIX-04: On Ubuntu, set up the environment as follows:
  265. 1) Default configuration files for SNFMilter.
  266. 2) SNFMilter stopped.
  267. 3) Default configuration files for postfix.
  268. 4) postfix running.
  269. Do the following:
  270. 1) Run SNFMilterConfig with "-with=postfix -v" and verify that the
  271. postfix configuration files are updated to be integrated with
  272. SNFMilter. Verify also that SNFMilter is not running and that
  273. postfix is running and was reloaded.
  274. 2) Run SNFMilterConfig with "-with=postfix -v" and verify that the
  275. postfix configuration files are not updated, that SNFMilter is
  276. not running, and that postfix is running and was not reloaded.
  277. 3) Run SNFMilterConfig with "-with=none -v" and verify that the
  278. postfix configuration files are updated such that the integration
  279. with SNFMilter is removed. Verify also that SNFMilter is not
  280. running, and that postfix is running and was not reloaded.
  281. 4) Run SNFMilterConfig with "-with=none -v" and verify that the
  282. postfix configuration files are not updated, and that SNFMilter
  283. is not running and that postfix is running and was not reloaded.
  284. Result: Pass.
  285. POSTFIX-05: Repeat POSTFIX-04 but without "-v".
  286. Result: Pass.
  287. POSTFIX-06: Configure as for POSTFIX-04, and do the following:
  288. 1) Run SNFMilterConfig with "-with=postfix -explain". Verify
  289. correct output, and that SNFMilterConfig doesn't update the
  290. postfix configuration files or reload any MTA.
  291. 2) Run SNFMilterConfig with "-with=none -explain". Verify correct
  292. output, and that SNFMilterConfig doesn't update the postfix
  293. configuration files or reload any MTA.
  294. 3) Run SNFMilterConfig with "-with=postfix". Verify correct output,
  295. and that SNFMilterConfig updates the postfix configuration files
  296. and reloads the MTA.
  297. 4) Run SNFMilterConfig with "-with=postfix -explain". Verify
  298. correct output, and that SNFMilterConfig doesn't update the
  299. postfix configuration files or reload any MTA.
  300. 5) Run SNFMilterConfig with "-with=none -explain". Verify correct
  301. output, and that SNFMilterConfig doesn't update the postfix
  302. configuration files or reload any MTA.
  303. Result: Pass.
  304. POSTFIX-07: Repeat POSTFIX-01 thru POSTFIX-06 on Fedora.
  305. Result: Pass.
  306. POSTFIX-08: Repeat POSTFIX-01 thru POSTFIX-07 on OpenSuse.
  307. Result:
  308. POSTFIX-09: Repeat POSTFIX-01 thru POSTFIX-07 on CentOS.
  309. Result:
  310. POSTFIX-10: Repeat POSTFIX-01 thru POSTFIX-07 on OpenBSD.
  311. Result:
  312. POSTFIX-11: Repeat POSTFIX-01 thru POSTFIX-07 on FreeBSD.
  313. Result: