Version: v2.3/2004-07-12T11:39:39
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_BackLogBuf_1
Description:
Synopsis:
Test handling of Back-Log Buffering (basic test).
Description:
The purpose of this test is to check that the method used to
carry Back-Log Buffering (ngamsArchiveUtils.backLogBuffer())
is working as expected.
Expected Result:
The data specified via a URI is received into the Back-Log Buffer.
The Req. Prop. Pickle File is created.
Test Steps:
- Load the test configuration into an ngamsConfig object.
- Create a dummy ngamsReqPropsObj and define the reference to the
data file (Archive Pull Request).
- Clean up Back-Log Buffer to ensure it is empty.
- Invoke ngamsArchiveUtils.backLogBuffer() with reference to the
ngamsConfig and ngamsReqProps objects.
- Check that Back-Log Buffered Data File and Req. Prop. Pickle File
are created.
Remarks:
IMPL: Check that contents of the Back-Log Buffer Data File and the
Req. Prop. Pickle File is as expected.
Test Case: test_BackLogBuf_1_1
Description:
Synopsis:
Online/Offline: Staging File in a Staging Area + a Req. Prop. File.
Description:
Staging File is found in a Staging Area + a Req. Prop. File is found.
A special DAPI is used for the test, that makes the server terminate
when entering the DAPI.
Expected Result:
Both files should be moved to the Back-Log Buffer when the server
goes Online.
Both files should be archived successfully by the Janitor Thread at
a later stage.
Test Steps:
- Configure server to use the test DAPI + start single server.
- Archive small FITS file. Server should terminate.
- Check that Staging File + Req. Prop. File found in a
Staging Area.
- Start the server and check that Staging File + Req. Prop.
File are moved to the Back-Log Buffer.
- Check that the files are archived successfully by the Janitor Thread.
Remarks:
Question: Is it really correct to archive such left-over files?
Maybe it should only be done if wait=0 in the Req. Prop.
File, since otherwise the client would have detected, that
the request was not handled properly (broken socket
connection).
This also goes for: - test_CrashCompression_1_1()
Test Case: test_BackLogBuf_2
Description:
Synopsis:
Archiving of Back-Log Buffered files (basic).
Description:
Test that files contained in the Back-Log Buffer are properly handled
by the Janitor Thread.
Expected Result:
The Janitor Thread should find the back-log buffered file and archive
it. Afterwards the archived file should be properly registered and
the Req. Prop. Pickle File removed.
Test Steps:
- Prepare an external NG/AMS Server. Start server (Auto Online=0).
- Back-log buffer a file using ngamsArchiveUtils.backLogBuffer().
- Bring the server Online.
- Wait until back-log buffered file has been handle by the Janitor
Thread.
- Check that disk info for Main/Rep. Disks correctly updated in the DB.
- Check that Main/Rep. Files correctly created.
- Check that info for Main/Rep. file created in DB.
Remarks:
...
Test Case: test_BackLogBuf_2_1
Description:
Synopsis:
Online/Offline: Staging File + Temp. Req. Prop. File found
in Staging Area.
Description:
Staging File is found in a Staging Area, a corresponding Temp. Req.
Prop. File is found. In this case, the handling of the Archive Request
was interrupted and not properly handled. The file should therefore
not be back-log buffered, but moved to the Bad Files Area together
with the Temp. Req. Prop. File.
Expected Result:
Both files should be moved to the Bad Files Area.
Test Steps:
- Create Staging File in a Staging Area.
- Create Temp. Req. Prop. File in a Staging Area.
- Start server.
- Check that both files moved to the Bad Files Area.
Remarks:
...
Test Case: test_BackLogBuf_3_1
Description:
Synopsis:
Online/Offline: Staging File is found, no Req. Prop. File is found
Description:
The purpose of this Test Case is to ensure that if a Staging File found
in the Staging Area, does not have a corresponding Req. Prop. File,
this means that something went wrong while handling the Archive
Request and the file should be moved to the Bad Files Area since it
cannot be handled properly.
Expected Result:
The Staging File in the Staging Area should be moved to the Bad Files
Area.
Test Steps:
- Create Staging File in a Staging Area.
- Start server.
- Check that Staging File is moved from Staging Area to Bad Files Area.
Remarks:
...
Test Case: test_BackLogBuf_4_1
Description:
Synopsis:
Temp. Staging File and Temp. Req. Prop. File found in Staging Area.
Description:
A Temp. Staging File and a Temp. Req. Prop. File are found in a
Staging Area. This means that something wen wrong during the handling
of the Archive Request, and the files cannot be handled.
Expected Result:
When the server goes Online or Offline the two spurious files should
be detected and should be moved to the Bad Files Area.
Test Steps:
- Create a Temp. Staging and a Temp. Req. Prop. File.
- Start server and bring it Online.
- Check that the Temp. Staging and Temp. Req. Prop. Files are moved
to the Bad Files Area.
Remarks:
...
Test Case: test_CrashCompression_1_1
Description:
Synopsis:
Test that interrupted compression in DAPI is properly handled
Description:
If the server is killed (dies) while the DAPI is performing
compression (UNIX compress) it should be ensured that the files in
question are handled correctly. In the case of 'compress', a temporary
file is created, whereas the original file remains until the
compression finishes. This means, that afterwards, it will still be
possible to archive the file, but the temporary, compressed file
should be moved to the Bad Files Area.
Expected Result:
A Staging File + its corresponding Temp. Req. Prop. File + the
temporary compressed file should be found in a Staging Area when
the server goes Online. The Staging File should be archived and the
two files disappear from the Staging Area, the temporary, compressed
file should be moved to the Bad Files Area.
Test Steps:
- Make uncompressed copy of WFI test file.
- Start server.
- Start thread in Test Case checking when the compression of the file
begins and which kills the server (kill -9) when this is the case.
- Archive file.
- Check that Staging File, Temp. Req Prop. File and the temporary,
compressed file are found in the Staging Area.
- Start the server.
- Check that: - Staging File is archived.
- Temp. Req. Prop. File is removed.
- Temp. compressed file is moved to the Bad Files Area.
Remarks:
See remark in test_BackLogBuf_1_1()