Team 3: Use Cases

$Revision: 1.17 $
$Date: 2004/03/24 06:32:57 $

This document contains the use cases for this project. 

Please note that it is divided into separate sections for each of the following categories:



Section 1: Baseline Feature Use Cases

Test Number 1
Functionality Requirements 1.1 - 1.9
Use Case
  • MTA invokes SnB client
  • SnB client contacts SnB server and sends message
  • if SnB client cannot contact server, SnB client returns error to MTA
  • SnB server connects to the SpamAssassin daemon (SA) to analyze received message
  • If SnB server cannot connect to (SA), it respawns the daemon
  • Any errors received by the SnB client from the SnB server result in an error returned to the MTA
  • SA returns the original message with added X-Spam-* headers to the SnB server
  • The SnB server returns only the X-Spam-* headers to the SnB client
  • The SnB client appends the headers received by the SnB server to the SMTP headers of the original message
  • The SnB client returns the message (old headers plus new headers plus old body) to the MTA for delivery
Test distribution
> ant run.test.1
Test Sequence
  1. Checkout the team_3 repository on your favorite machine (preferably "settlers.ece.cmu.edu" in the ECE games cluster)
    > set CVSROOT = :pserver:<userid>@mse.fluid.cs.cmu.edu:/mse/17654/team_3
    > mkdir ~/repository
    > cd ~/repository
    > cvs login  (Enter the password)
    > cvs co -d -P .
    
  2. Set environment variables (suggest modifying .bashrc)
    Remember to set $CLASSPATH to point to your class build directories.
    > export PATH=/afs/ece/usr/cfry/classes/middleware/ant/bin:$PATH
    > export JAVA_HOME=/usr/local/j2sdk1.4.2_02
    > export JBOSS_HOME=/afs/ece/class/ece846/java/jboss-3.2.3
    > export SPAM_REPOS="$HOME/repository"
    > souce $REPOSITORY/scripts/classpath.dat
    
  3. Launch JBoss
    You have to run JBoss from settlers.ece.cmu.edu, or you need to modify $REPOSITORY/config/jndi.properties to point to the machine you intend to run on. In other words, the machine name in the jndi.properties file must be the machine on which you are running the JNDI naming service, or remote classes will not be able to locate the objects.
    > cd $JBOSS_HOME/bin
    > ./run.sh -c team3
    
  4. From another terminal, configure one or more replicas with the Global Replication Manager
    > java com.spamnbeans.repmgr.GlobalReplicationManager
    
  5. > ant run.test.1
    
Configuration/Deployment Issues
  • Current default configuration assumes settlers.ece.cmu.edu
  • Must have write access to JBoss server deployment directory
  • Currently using offsite Postgres database server
Known problems None


Test Number 2
Functionality Requirements 1.1-1.9
Use Case
  • The SnB client may never modify message bodies - only message headers.
Test distribution
> ant run.test.2
Test Sequence All steps are performed by the test script.
  1. message bodies are confirmed to always match originals
  2. Following test, the lines that are different are displayed and checked to ensure that the body was not modified
Configuration/Deployment Issues
  • $REPOSITORY/scripts/test2.spam must exist
Known problems None


Test Number 4
Functionality Requirements 1.10
Use Case
  • The SnB management module is invoked to add new clients to the table of valid clients
  • If the client is already present in the table the error "DuplicateClient" is returned
  • If the client does not already exist in the table, the SnB management module adds the specified client to the table and returns success
  • The SnB management module is invoked to remove clients from the client table
  • If the requested client does not exist, an "InvalidClient" error is returned
  • If the client does exist, the SnB management module removes the specified entry from the client table and returns success
Test distribution
> ant run.test.4
Test Sequence All steps are performed by the test script.
  1. Remove client, ignoring errors (it may not exist)
  2. Create client
  3. Create client, generating a "DuplicateClient" error
  4. Verify the client is valid by checking client table
  5. Remove client
  6. Remove client, generating an "InvalidClient" error
  7. Verify the client is no longer in the client table
Configuration/Deployment Issues
  • Must have write access to JBoss server deployment directory
Known problems None


Test Number 8
Functionality Requirements 2.1
Use Case
  • The SnB client receives an invalid message from the MTA
  • The SnB server rejects the message and the client drops it
Test distribution
> ant run.test.8
Test Sequence All steps are performed by the test script except for initial server registration
  1. Process an invalid message
  2. System rejects the request to process the invalid message
Configuration/Deployment Issues
  • Current default configuration assumes settlers.ece.cmu.edu
  • Must have write access to JBoss server deployment directory
  • $REPOSITORY/scripts/invalid.spam must exist
Known problems None


Test Number 9
Functionality Requirements 2.1
Use Case
  • The SnB client receives a null message from the MTA
  • The SnB server returns no headers and the client drops it
Test distribution
> ant run.test.9
Test Sequence All steps are performed by the test script except for initial server registration
  1. Process a null message
  2. System rejects the request to process the null message
Configuration/Deployment Issues
  • Current default configuration assumes settlers.ece.cmu.edu
  • Must have write access to JBoss server deployment directory
  • $REPOSITORY/scripts/null.spam must exist
Known problems None


Test Number 10
Functionality Requirements 2.1
Use Case
  • The SnB client receives a double message from the MTA
  • The SnB server processes only the first message
Test distribution
> ant run.test.10
Test Sequence All steps are performed by the test script execpt for initial server registration
  1. Process a double message
  2. System processes the first message and ignores the second message
Configuration/Deployment Issues
  • Current default configuration assumes settlers.ece.cmu.edu
  • Must have write access to JBoss server deployment directory
  • $REPOSITORY/scripts/double.spam must exist
Known problems None



Section 2: Use Cases for Fault Tolerance

Test Number FT-1
Functionality Requirements 2.1 - 2.4
Use Case
  1. The MTA invokes the SnB client
  2. If the MTA is unable to invoke the SnB Client, the error is immediately returned to the MTA
  3. The SnB client contacts the Replication Manager for a replica JNDI
  4. The Global Replication Manager returns to the client the JNDI of the replica with the lowest utilization
  5. If the SnB client is unable to contact the Replication Manager it throws a Fatal exception.
  6. If the SnB client receives a Fatal exception, it will attempt to notify the Replication Manager and then returns the exception to the MTA
  7. If the Replication Manager receives notification of a FATAL error, it will attempt to contact the system administrator
  8. If the client handles an Application Exception, it returns the error to the MTA
  9. The SnB client contacts the replica to process a message
  10. If the SnB client is unable to contact the replica, it throws a Non-Fatal Exception.
  11. If the SnB client handles a Non-Fatal exception, it fails-over (goto step #3)
  12. The replica contacts the backend (database) to confirm the request is from a valid/active SnB client
  13. If the replica is unable to contact the database, it throws a FATAL exception (goto #6).
  14. If the replica determines the request is NOT from an active/valid client, it returns a Application Exception to the client (goto #8)
  15. The replica submits the message to SpamAssassin for processing
  16. If the replica is unable to submit the message for processing, it throws a Non-Fatal exception (goto #11)
  17. SpamAssassin returns to the replica the X-Spam message headers
  18. The replica records the transaction into the backend (database)
  19. If the replica is unable to record the transaction into the database, it throws a Fatal Exception (goto #6)
  20. The replica returns the Spam-X headers to the client
  21. The client inserts the headers into message
  22. The client returns the modified message to the MTA for delivery
Test distribution
> ant run.test.ft1
Test Sequence
  1. Launch the golden machine (listed in config/jndi.properties)
  2. Launch the Global Replication Manager (GRM) with
    > java com.spamnbeans.repmgr.GlobalReplicationManager
    
  3. Configure a cluster of at least 2 SnB replicas using P4-1.4GHz machines
  4. In another terminal, start message processing with
    > ant run.test.ft1
    
  5. In a third terminal, start the fault injector with
    > cd scripts
    > ./FaultInjector.pl -d 180
    
  6. The Perl script will periodically kill SnB replicas; the GRM will restart them
Configuration/Deployment Issues
  • System must be configured for at least 2 SnB replicas
  • Golden machine must be run external to the GRM or it may be killed
Known problems
  • Perl script may kill all of the replicas if recovery is too slow



Section 3: Use Cases for "Real-Time" Requirements


Test Number 6
Functionality Requirements 3.3
Use Case
  • If the SnB client is does not receive an SMTP header from the SnB server within 5 seconds, the original unprocessed message is sent to the MTA for delivery
  • If the SnB client receives an "InvalidClient" error from the SnB server, it immediately sends the original unprocessed message to the MTA for delivery
Test distribution NOT-IMPLEMENTED
Test Sequence
  1. A time consuming process is started on the SnB server which consumes processing time
  2. A large message is fed to SnB which is known to take more than 5 seconds to process
  3. The server is monitored to ensure the SnB server did not respond within 5 seconds
  4. The client is monitored to ensure the original message was returned with this time cap was exceeded
Configuration/Deployment Issues  
Known problems  



Section 4: Use Cases for High-Performance Requirements


Test Number 7
Functionality Requirements 4.1, 4.2
Use Case
  • When the SnB system is started, the JBoss name server queries the SnB server table in the database and builds an array of available servers.
  • The JBoss name server maintains an index into this table.
  • For each SnB client request, the JBoss name server returns the servers at the current SnB server index and then increments the SnB server index.
  • If the SnB server index has reached the end of the array, the SnB server resets the index to the beginning of the array.
Test distribution NOT-IMPLEMENTED
Test Sequence
  1. System is configured for multiple SnB servers
  2. One or more clients are configured to send several hundred messages
  3. Following the test, the server statistics table is queried to determine if the load was balanced across all the SnB servers
Configuration/Deployment Issues  
Known problems  



Template


Test Number #n
Functionality Requirements tested
Use Case Description of use case under test
Test distribution Where to find the source (IDL, Java, test script)
Test Sequence
  1. ...
  2. Sequence of steps for performing the test
  3. ...
Configuration/Deployment Issues Any known issues, such as hostname, pathname
Known problems Any conditions under which test is known to fail