NGAS logo small

The Next Generation Archive System


NG/AMS Unit Test Plan

Date: 2004-10-19T16:03:28.083
User: ngasmgr
Version: v2.3.1Beta1/2004-10-19T08:53:51


Test Suite: ngamsArchiveCmdTest

Description:

    Synopsis:
    Test the ARCHIVE Command.

    Description:
    The Test Suite exercises the ARCHIVE Command. It tests the normal behavior,
    but also more advanced features such as Back-Log Buffering.

    Both Archive Push and Archive Pull is tested.
    

Test Case: test_ArchiveRobustness_01_01

Description:

        Synopsis:
        Temp. Req. Prop. File found in Staging Area
        
        Description:
        If a Temp. Req. Prop. File is found in a Staging Area, something
        went wrong during the handling of the Archive Request. Such files,
        should be moved to the Bad Files Directory.

        Expected Result:
        When the server goes Online, it should find the spurious file and
        move it to the Bad Files Area.

        Test Steps:
        - Start ext. server.
        - Create Temp. Req. Prop. File in Staging Area.
        - Bring server Offline.
        - Check that Temp. Req. Prop. File moved to Bad Files Area.
        - Create Temp. Req. Prop. File in Staging Area.
        - Bring server Online.
        - Check that Temp. Req. Prop. File moved to Bad Files Area.

        Remarks:
        This Test Case is very unlikely to happen, but is covered to ensure
        correct handling nevertheless.
        

Test Case: test_ArchiveRobustness_02_01

Description:

        Synopsis:
        Req. Prop. File found in Staging Area, no Staging File.
        
        Description:
        If a Req. Prop. File is found in a Staging Area, something
        went wrong during the handling of the Archive Request. Such files,
        should be moved to the Bad Files Directory.

        Expected Result:
        When the server goes Online, it should find the spurious file and
        move it to the Bad Files Area.

        Test Steps:
        - Start ext. server.
        - Create Req. Prop. File in Staging Area.
        - Bring server Offline.
        - Check that Req. Prop. File moved to Bad Files Area.
        - Create Req. Prop. File in Staging Area.
        - Bring server Online.
        - Check that Req. Prop. File moved to Bad Files Area.
        
        Remarks:
        ...
        

Test Case: test_ArchiveRobustness_03_01

Description:

        Synopsis:
        Temp. Staging File found, no (Temp.) Req. Prop. File.
        
        Description:
        If a Temp. Staging File is found in a Staging Area, something
        went wrong during the handling of the Archive Request. Such files,
        should be moved to the Bad Files Directory.

        Expected Result:
        When the server goes Online, it should find the spurious file and
        move it to the Bad Files Area.

        Test Steps:
        - Start server crashing after saving in Temp. Staging File.
        - Archive file.
        - Check the Temp. Staging File existing.
        - Start normal server.
        - Check that Temp. Staging File moved to Bad Files Area during
          Online.

        Remarks:
        ...
        

Test Case: test_ArchiveRobustness_04_01

Description:

        Synopsis:
        Temp. Staging File and Temp. Req. Prop. Files found in Staging Area.
        
        Description:
        If Temp. Staging Files and Temp. Req. Prop. Files are found in a
        Staging Area, something went wrong during the handling of the Archive
        Request. Such files, should be moved to the Bad Files Directory.

        Expected Result:
        When the server goes Online, it should find the spurious files and
        move them to the Bad Files Area.

        Test Steps:
        - Start server crashing after creating Temp. Staging Files.
        - Archive file.
        - Check the Temp. Staging + Req. Prop. Files existing.
        - Start normal server.
        - Check that Temp. Staging + Req. Prop. Files moved to Bad Files Area.

        Remarks:
        ...
        

Test Case: test_ArchiveRobustness_05_01

Description:

        Synopsis:
        Temp. Staging File and Req. Prop. File found in Staging Area.
        
        Description:
        If Temp. Staging Files and Req. Prop. Files are found in a
        Staging Area, something went wrong during the handling of the Archive
        Request. Such files, should be moved to the Bad Files Directory.

        Expected Result:
        When the server goes Online, it should find the spurious files and
        move them to the Bad Files Area.

        Test Steps:
        - Prep. server/Auto Online=0.
        - Create dummy Temp. Staging and Req. Prop. Files.
        - Bring server Online.
        - Check that dummy Temp. Staging and Req. Prop. Files moved to
          Bad Files Area.

        Remarks:
        This Test Case is very unlikely to happen, but is covered to ensure
        correct handling nevertheless.
        

Test Case: test_ArchiveRobustness_06_01

Description:

        Synopsis:
        Org. Staging File + no Req. Prop. File found in Staging Area.
        
        Description:
        If an Org. Staging File and no Req. Prop. File are found in a
        Staging Area, something went wrong during the handling of the Archive
        Request. Such files, should be moved to the Bad Files Directory.

        Expected Result:
        When the server goes Online, it should find the spurious file and
        move it to the Bad Files Area.

        Test Steps:
        - Start special server sub-class, which kills itself after having
          created the Org. Staging File.
        - Archive file.
        - Delete the Req. Prop. File.
        - Start normal server.
        - Check that Org. Staging File moved to Bad Files Area.

        Remarks:
        ...
        

Test Case: test_ArchiveRobustness_07_01

Description:

        Synopsis:
        Org. Staging File + Temp. Req. Prop. Files found in Staging Area.
        
        Description:
        If an Org. Staging File and a Temp. Req. Prop. File are found in a
        Staging Area, something went wrong during the handling of the Archive
        Request. Such files, should be moved to the Bad Files Directory.

        Expected Result:
        When the server goes Online, it should find the spurious files and
        move them to the Bad Files Area.

        Test Steps:
        - Start special server sub-class, which kills itself after having
          created the Org. Staging File.
        - Archive file.
        - Start normal server.
        - Check that Temp. Req. Prop. File moved to Bad Files Area.

        Remarks:
        This Test Case is extremely unlikely to occur.
        

Test Case: test_ArchiveRobustness_08_01

Description:

        Synopsis:
        Org. Staging File + Req. Prop. File found in Staging Area + Back-Log
        Buf.=0 + Archiving=0.
        
        Description:
        If an original Staging File + Req. Prop. File pair is found and
        Back-Log Buffering and handling of Archive Requests is disabled,
        these files should be moved to the Bad Files Area.

        Expected Result:
        When the server goes Online, it should find the spurious files and
        move them to the Bad Files Area.

        Test Steps:
        - Start server sub-class that kills itself immediately before invoking
          the DAPI.
        - Archive file, server should crash.
        - Check that Org. Staging File + Req. Prop File found in Staging Area.
        - Start normal server (Back-Log Buf.=0 + Archiving=0).
        - Check that Org. Staging File + Req. Prop File moved to Bad Files
          Area.

        Remarks:
        ...
        

Test Case: test_ArchiveRobustness_09_01

Description:

        Synopsis:
        Org. Staging File + Req. Prop. File found in Staging Area + Back-Log
        Buf.=1 + Archiving=1.
        
        Description:
        If an original Staging File + Req. Prop. File pair is found and
        Back-Log Buffering or handling of Archive Requests is disabled,
        these files should be moved to the Back-Log Buffer.

        Expected Result:
        When the server goes Online, it should find the files in the Staging
        Area and move them to the Back-Log Buffer.

        Subsequently the Janitor Thread should find the file and execute the
        archiving. Afterwards the file should be properly archived and the
        Req. Prop. File removed.

        Test Steps:
        - Start server sub-class that kills itself immediately before invoking
          the DAPI.
        - Archive file, server should crash.
        - Start normal server (Back-Log Buf.=1 + Archiving=1).
        - Check that file has been archived (Back-Log Buffered + Archived).
        - Check that Staging Area is empty.
        - Check that Bad Files Area is empty.

        Remarks:
        ...
        

Test Case: test_ArchiveRobustness_10_01

Description:

        Synopsis:
        Org. Staging File + Req. Prop. File found in Staging Area + Back-Log
        Buf.=0 + Archiving=1.
        
        Description:
        If an original Staging File + Req. Prop. File pair is found and
        Back-Log Buffering or handling of Archive Requests is disabled,
        these files should be moved to the Back-Log Buffer.

        Expected Result:
        When the server goes Online, it should find the files in the Staging
        Area and move them to the Back-Log Buffer.

        Test Steps:
        - Start server sub-class that kills itself immediately before invoking
          the DAPI.
        - Archive file, server should crash.
        - Start normal server (Back-Log Buf.=0 + Archiving=1).
        - Check that the files have been moved to the Bad Files Area.

        Remarks:
        ...
        

Test Case: test_ArchiveRobustness_11_01

Description:

        Synopsis:
        Org. Staging File + Req. Prop. File found in Staging Area + Back-Log
        Buf.=1 + Archiving=0.
        
        Description:
        If an original Staging File + Req. Prop. File pair is found and
        Back-Log Buffering or handling of Archive Requests is disabled,
        these files should be moved to the Back-Log Buffer.

        Expected Result:
        When the server goes Online, it should find the files in the Staging
        Area and move them to the Back-Log Buffer.

        Test Steps:
        - Start server sub-class that kills itself immediately before invoking
          the DAPI.
        - Archive file, server should crash.
        - Start normal server (Back-Log Buf.=1 + Archiving=0).
        - Check that the files have been moved to the Bad Files Area.

        Remarks:
        ...
        

Test Case: test_ArchiveRobustness_12_01

Description:

        Synopsis:
        Kill server during processing (compression) in DAPI.
        
        Description:
        If the processing carried out by a DAPI is interrupted, there might
        be temporary/processing files left-over in the Staging Area.

        The purpose of this test is to verify that even though the server
        crashes, the file is correctly archived via the Back-Log Buffering
        system and the temporary files in the Staging Area are moved to the
        Bad Files Area.

        Expected Result:
        When the server is restarted, the files in the Staging Area should
        be found. The Original Staging File and the Request Properties File
        should be moved to the Back-Log Area and archived. The Staging File
        and the temporary compressed files should be moved to the Bad Files
        Area.

        Test Steps:
        - Prepare WFI test file for archiving.
        - Start server.
        - Start small thread to supervise when compression takes place, and
          kills the server.
        - Archive file.
        - Check the Org. Stg. File, Req. Prop. File, temporary
          processing file are found in the Staging Area.
        - Restart the server.
        - Check that the file is archived (via Back-Log Buffering).
        - Check that the temporary processing file is moved to the Bad
          Files Area.
          
        Remarks:
        During this Test Case the server should have been killed while
        the file is being compressed. Unfortunately, it seems not possible
        to kill the compress command, even with kill -9.

        The test is not yet implemented.
        

Test Case: test_ArchiveRobustness_13_01

Description:

        Synopsis:
        Kill server after DAPI, before moving Proc. Staging File to final
        destination.
        
        Description:
        If an Archive Request is is interrupted immediately after the
        execution of a DAPI, there might be temporary/processing files
        left-over in the Staging Area.

        The purpose of this test is to verify that even though the server
        crashes, the file is correctly archived via the Back-Log Buffering
        system and the temporary files in the Staging Area are moved to the
        Bad Files Area.

        Expected Result:
        When the server is restarted, the files in the Staging Area should
        be found. The Original Staging File and the Request Properties File
        should be moved to the Back-Log Area and archived. The Staging File
        and the temporary compressed files should be moved to the Bad Files
        Area.

        Test Steps:
        - Prepare WFI test file for archiving.
        - Start special version of server that kills itself immediately
          after the execution of the DAPI.
        - Archive file, server should crash.
        - Check the Org. Stg. File, Req. Prop. File, temporary
          processing file are found in the Staging Area.
        - Restart the server (normal server class).
        - Check that the file is archived (via Back-Log Buffering).
        - Check that the temporary processing file is moved to the Bad
          Files Area.

        Remarks:
        ...
        

Test Case: test_ArchiveRobustness_14_01

Description:

        Synopsis:
        Kill server after moving Proc. Staging File to final destination,
        before updating DB.
        
        Description:
        ...

        Expected Result:
        ...

        Test Steps:
        - ...

        Remarks:
        ...
        

Test Case: test_ArchiveRobustness_15_01

Description:

        Synopsis:
        Kill server after handling Main File, before creating Rep. File.
        
        Description:
        ...

        Expected Result:
        ...

        Test Steps:
        - ...

        Remarks:
        ...
        

Test Case: test_ArchiveRobustness_16_01

Description:

        Synopsis:
        Kill server server after creating Re. File copy, before updating DB
        with info. for Rep. File.
        
        Description:
        ...

        Expected Result:
        ...

        Test Steps:
        - ...

        Remarks:
        ...
        

Test Case: test_ArchiveRobustness_17_01

Description:

        Synopsis:
        Kill server after handling Rep. File, before deleting Org. Staging
        File and Req. Prop. File.
        
        Description:
        ...

        Expected Result:
        ...

        Test Steps:
        - ...

        Remarks:
        ...
        

Test Case: test_ArchiveRobustness_18_01

Description:

        Synopsis:
        Test that Back-Log Buffering carried out only if Req. Prop. File
        found.
        
        Description:
        ...

        Expected Result:
        ...

        Test Steps:
        - ...

        Remarks:
        ...