Browse Source

Load credentials when starting or stopping SNFMilter.


git-svn-id: https://svn.microneil.com/svn/SNFUtility/trunk@22 aa37657e-1934-4a5f-aa6d-2d8eab27ff7c
master
adeniz 12 years ago
parent
commit
4d8afb2508
2 changed files with 117 additions and 9 deletions
  1. 2
    0
      SNFMilterConfig/SNFMilterConfig.cpp
  2. 115
    9
      SNFMilterConfig/SNFMilterConfigTests.txt

+ 2
- 0
SNFMilterConfig/SNFMilterConfig.cpp View File

LoadConfig(); LoadConfig();
LoadInfo(); LoadInfo();
LoadSocketInfo(); LoadSocketInfo();
LoadCredentials();
StartSniffer("snf-milter start", ApplicationName); StartSniffer("snf-milter start", ApplicationName);
break; break;
LoadConfig(); LoadConfig();
LoadInfo(); LoadInfo();
LoadSocketInfo(); LoadSocketInfo();
LoadCredentials();
StopSniffer("snf-milter stop", ApplicationName); StopSniffer("snf-milter stop", ApplicationName);
break; break;

+ 115
- 9
SNFMilterConfig/SNFMilterConfigTests.txt View File

----------------------------------------------------------------- -----------------------------------------------------------------


START_STOP_SEC-01: Install default configuration files, and ensure START_STOP_SEC-01: Install default configuration files, and ensure
that SNFMilter is stoped. Create a configuration file
that SNFMilter is stopped. Create a configuration file
SNFMilter_second.xml as follows: SNFMilter_second.xml as follows:


1) Disable XCI. 1) Disable XCI.


Do the following, specifying the configuration file SNFMilter_second.xml: Do the following, specifying the configuration file SNFMilter_second.xml:


1) Run SNFMilterConfig with "-start", and verify that SNFMilter starts.
1) Run "SNFMilterConfig -config=SNFMilter_second.xml -start", and verify that SNFMilter starts.


2) Run SNFMilterConfig with "-start" again and verify that SNFMilter
is not started again.
2) Run "SNFMilterConfig -config=SNFMilter_second.xml -start" again
and verify that SNFMilter is not started again.


3) Run SNFMitlerConfig with "-stop" and verify that SNFMilter stops.
3) Run "SNFMilterConfig -config=SNFMilter_second.xml -stop" and
verify that SNFMilter stops.


4) Run SNFMitlerConfig with "-stop" again and verify that SNFMilter
is not stopped again.
4) Run "SNFMilterConfig -config=SNFMilter_second.xml -stop" again
and verify that SNFMilter is not stopped again.


Result:
Result: Pass


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


Result:
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:


3) Start SNFMilter. 3) Start SNFMilter.


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

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

Result: Pass

Start/stop functionality with XCI and status.second enabled, append mode
------------------------------------------------------------------------

START_STOP_SEC_APP-01: Install default configuration files, and ensure
that SNFMilter is stopped. Create a configuration file
SNFMilter_second_append.xml as follows:

1) Disable XCI.

2) Enable status.second logging with append.

3) Enable status.minute logging, with append.

Do the following, specifying the configuration file SNFMilter_second_append.xml:

1) Run "SNFMilterConfig -config=SNFMilter_second_append.xml -start",
and verify that SNFMilter starts.

2) Run "SNFMilterConfig -config=SNFMilter_second_append.xml -start"
again and verify that SNFMilter is not started again.

3) Run "SNFMilterConfig -config=SNFMilter_second_append.xml -stop"
and verify that SNFMilter stops.

4) Run "SNFMilterConfig -config=SNFMilter_second_append.xml -stop"
again and verify that SNFMilter is not stopped again.

Result:

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

Result:

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

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

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

3) Start SNFMilter.

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

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

Result:

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

START_STOP_MIN-01: Install default configuration files, and ensure
that SNFMilter is stopped. Create a configuration file
SNFMilter_minute.xml as follows:

1) Disable XCI.

2) Disable status.second logging.

3) Enable status.minute logging, with append.

Do the following, specifying the configuration file SNFMilter_minute.xml:

1) Run "SNFMilterConfig -config=SNFMilter_minute.xml -start", and verify that SNFMilter starts.

2) Run "SNFMilterConfig -config=SNFMilter_minute.xml -start" again
and verify that SNFMilter is not started again.

3) Run "SNFMilterConfig -config=SNFMilter_minute.xml -stop" and
verify that SNFMilter stops.

4) Run "SNFMilterConfig -config=SNFMilter_minute.xml -stop" again
and verify that SNFMilter is not stopped again.

Result:

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

Result:

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

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

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

3) Start SNFMilter.

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



Loading…
Cancel
Save