Browse Source

Test start/stop functionality with different configuration of log file

rotation, and local/GMT time.


git-svn-id: https://svn.microneil.com/svn/SNFUtility/trunk@27 aa37657e-1934-4a5f-aa6d-2d8eab27ff7c
master
adeniz 12 years ago
parent
commit
9694cfa00f

+ 3
- 2
Common/UtilityConfig.cpp View File

NewLogFileName = (this->*GetLogFileNamePtr)(); NewLogFileName = (this->*GetLogFileNamePtr)();
if (IncreasedTimeoutTime && (NewLogFileName != LogFileName)) { // Filename changes if it contains a
if (!IncreasedTimeoutTime && (NewLogFileName != LogFileName)) { // Filename changes if it contains a
// date stemp and the time is close // date stemp and the time is close
// to midnight. // to midnight.
TimeoutTime_msec *= 2; TimeoutTime_msec *= 2;
FinalContents = ReadLastPartOfFile(LogFileName, LogFileReportSize); // Read again. FinalContents = ReadLastPartOfFile(LogFileName, LogFileReportSize); // Read again.
if (InitialContents != FinalContents) { // Contents have changed.
if ( (FinalContents.length() != 0) && // There is a report, and
(InitialContents != FinalContents) ) { // the contents have changed.
if (Verbose()) { if (Verbose()) {

+ 79
- 19
SNFMilterConfig/SNFMilterConfigTests.txt View File

Conflict detection Conflict detection
------------------ ------------------


CONFLICT-01: Run with -setup, -id, and -auth. Verify that help
message is output, and that SNFMilterConfig takes no action.
CONFLICT-01: Run with -setup, -id=xxx, and -auth=yyy. Verify that
help message is output, and that SNFMilterConfig takes no action.


Result: Pass. Result: Pass.




Result: Pass. Result: Pass.


CONFLICT-04: Run with -setup and -mta=XXX, where XXX is postfix,
CONFLICT-04: Run with -setup and each of the following command line
parameters:

1) -auth

2) -auth=

3) -auth=xxx

4) -id

5) -id=

6) -id=xxx

Verify that in each case the help message is output, and that
SNFMilterConfig takes no action.

Result: Pass.

CONFLICT-05: Run with -setup and -mta=XXX, where XXX is postfix,
sendmail, and none. Verify that help message is output, and that sendmail, and none. Verify that help message is output, and that
SNFMilterConfig takes no action. SNFMilterConfig takes no action.


Result: Pass. Result: Pass.


CONFLICT-06: Run with -mta=postfix and one of the following commands:

1) -auth

2) -auth=

3) -auth=xxx

4) -id

5) -id=

6) -id=xxx

Verify that in each case the help message is output, and that
SNFMilterConfig takes no action.

Result: Pass.

Setup/Repair functionality Setup/Repair functionality
-------------------------- --------------------------


4) Run SNFMitlerConfig with "-stop -v" again and verify that 4) Run SNFMitlerConfig with "-stop -v" again and verify that
SNFMilter is still stopped. SNFMilter is still stopped.


Result: Pass
Result: Pass.


START_STOP_XCI-02: Repeat START_STOP_XCI-01 but without "-v" in the START_STOP_XCI-02: Repeat START_STOP_XCI-01 but without "-v" in the
command-line. command-line.


Result:
Result: Pass.


START_STOP_XCI-03: Configure as for START_STOP_XCI-01, and do the following: START_STOP_XCI-03: Configure as for START_STOP_XCI-01, and do the following:


5) Run SNFMilterConfig with "-stop -explain". Verify correct 5) Run SNFMilterConfig with "-stop -explain". Verify correct
output, and that SNFMilter is still running. output, and that SNFMilter is still running.


Result:
Result: Pass.


Start/stop functionality with XCI disabled, status.second enabled Start/stop functionality with XCI disabled, status.second enabled
----------------------------------------------------------------- -----------------------------------------------------------------
4) Run "SNFMilterConfig -stop -v" again and verify that SNFMilter is 4) Run "SNFMilterConfig -stop -v" again and verify that SNFMilter is
still stopped. still stopped.


Result: Pass
Result: Pass.


START_STOP_SEC-02: Repeat START_STOP_SEC-01 but without "-v" in the START_STOP_SEC-02: Repeat START_STOP_SEC-01 but without "-v" in the
command-line. command-line.


Result: Pass
Result: Pass.


START_STOP_SEC-03: Configure as for START_STOP_SEC-01, and do the START_STOP_SEC-03: Configure as for START_STOP_SEC-01, and do the
following: following:
5) Run SNFMilterConfig with "-stop -explain". Verify correct 5) Run SNFMilterConfig with "-stop -explain". Verify correct
output, and that SNFMilter is still running. output, and that SNFMilter is still running.


Result: Pass
Result: Pass.


Start/stop functionality with XCI disabled and status.second enabled, append mode Start/stop functionality with XCI disabled and status.second enabled, append mode
--------------------------------------------------------------------------------- ---------------------------------------------------------------------------------
4) Set localtime to "no" for rotation. 4) Set localtime to "no" for rotation.


Do the following when the local date is different from the date from Do the following when the local date is different from the date from
gmtime():
gmtime(). In each step, verify that the datestamp is the universal
date.


1) Run "SNFMilterConfig -start -v", and verify that SNFMilter 1) Run "SNFMilterConfig -start -v", and verify that SNFMilter
starts. starts.
4) Run "SNFMilterConfig -stop -v" again and verify that SNFMilter is 4) Run "SNFMilterConfig -stop -v" again and verify that SNFMilter is
still stopped. still stopped.


Result: Pass
Result: Pass.


START_STOP_SEC_APP-02: Repeat START_STOP_SEC_APP-01 but without "-v" START_STOP_SEC_APP-02: Repeat START_STOP_SEC_APP-01 but without "-v"
in the command-line. in the command-line.


Result:
Result: Pass.


START_STOP_SEC_APP-03: Configure as for START_STOP_SEC_APP-01, and do START_STOP_SEC_APP-03: Configure as for START_STOP_SEC_APP-01, and do
the following:
the following when the local date is different from the date from
gmtime(). In each step, verify that the datestamp is the universal
date.


1) Run SNFMilterConfig with "-start -explain". Verify correct 1) Run SNFMilterConfig with "-start -explain". Verify correct
output, and that SNFMilterConfig doesn't start SNFMilter. output, and that SNFMilterConfig doesn't start SNFMilter.
5) Run SNFMilterConfig with "-stop -explain". Verify correct 5) Run SNFMilterConfig with "-stop -explain". Verify correct
output, and that SNFMilterConfig doesn't stop SNFMilter. output, and that SNFMilterConfig doesn't stop SNFMilter.


Result:
Result: Pass.


Start/stop functionality with XCI and status.second disabled, status.minute enabled Start/stop functionality with XCI and status.second disabled, status.minute enabled
----------------------------------------------------------------------------------- -----------------------------------------------------------------------------------


3) Enable status.minute logging, with append. 3) Enable status.minute logging, with append.


Do the following, specifying the configuration file SNFMilter_minute.xml:
4) Set localtime to "yes" for rotation.

Do the following when the local date is different from the date from
gmtime(). In each step, verify that the datestamp is the local date.


1) Run "SNFMilterConfig -start -v", and verify that SNFMilter 1) Run "SNFMilterConfig -start -v", and verify that SNFMilter
starts. starts.
4) Run "SNFMilterConfig -stop -v" again and verify that SNFMilter is 4) Run "SNFMilterConfig -stop -v" again and verify that SNFMilter is
not stopped again. not stopped again.


Result:
Result: Pass.

START_STOP_MIN-02: Repeat START_STOP_MIN-01 but with the following
changes:

1) Delete all files in the SNFMilter log directory.

2) Set the time to 23:59:30 and immediately run "SNFMilterConfig
-start -v".

3) Verify that:

a) SNFMilter starts.

b) SNFMilterConfig changed the name of the log file it was
checking when checking whether SNFMilter is running before
starting SNFMilter.


START_STOP_MIN-02: Repeat START_STOP_MIN-01 but without "-v" in the
command-line.


Result: Result:


START_STOP_MIN-03: Configure as for START_STOP_MIN-01, and do the START_STOP_MIN-03: Configure as for START_STOP_MIN-01, and do the
following:
following when the local date is different from the date from
gmtime(). In each step, verify that the datestamp is the local date.


1) Run SNFMilterConfig with "-start -explain". Verify correct 1) Run SNFMilterConfig with "-start -explain". Verify correct
output, and that SNFMilterConfig doesn't start SNFMilter. output, and that SNFMilterConfig doesn't start SNFMilter.

+ 1
- 1
SNFMilterConfig/SNFMilter_minute.xml View File

<logs> <logs>
<rotation localtime='no'/>
<rotation localtime='yes'/>
<status> <status>
<second log='no' append='no'/> <second log='no' append='no'/>

Loading…
Cancel
Save