testFileUpload.py

Go to the documentation of this file.
00001 #!/usr/local/bin/python
00002 #
00003 #                               Copyright 2005
00004 #                                     by
00005 #                        The Board of Trustees of the
00006 #                     Leland Stanford Junior University.
00007 #                            All rights reserved.
00008 #
00009 
00010 __facility__ = "Online"
00011 __abstract__ = "File Upload test - VSC version"
00012 __author__   = "S. Tuvi <Stuvi@SLAC.Stanford.edu> SLAC - GLAST LAT I&T/Online"
00013 __date__     = "2005/07/15 00:08:27"
00014 __updated__  = "$Date: 2006/04/14 20:55:46 $"
00015 __version__  = "$Revision: 1.10 $"
00016 __release__  = "$Name: HEAD $"
00017 __credits__  = "SLAC"
00018 
00019 import LICOS.copyright_SLAC
00020 
00021 import            os
00022 import logging as log
00023 import            time
00024 import            array
00025 
00026 from   LICOS_Scripts.lib.testAppBase import TestAppBase
00027 import LICOS.lib.cmdTlmDb.FILE    as FILE
00028 from LICOS.lib.LATconstants       import *
00029 
00030 
00031 #  Example application implementation.
00032 class testFileUpload(TestAppBase):
00033   "Test file upload to the VSC/SIU"
00034   def __init__(self, common):
00035     TestAppBase.__init__(self, common)
00036     log.debug("%s.__init__()" % self.getName())
00037 
00038   def getName(self):
00039     return self.__class__.__name__
00040 
00041   def testStartRun(self):
00042     pass
00043 
00044   def testRun(self):
00045     log.debug("%s.startRun()" % self.getName())
00046 
00047     # standard test file from CVS/release
00048     diskFileName = os.path.join(ONLINE_ROOT, 'LICOS/tests/data/12346_hdr')
00049 
00050     # compute a semi-arbitrary file ID.  Directory/fileNum up to user.
00051     fileID = FILE.FswFileID( device     = FILE.FSW_DEVICE_RAM,
00052                              directory  = 10,
00053                              fileNumber = 12346)
00054 
00055     log.debug("%s: uploading file with file ID 0x%08x=%d" %
00056               ( self.getName(), fileID.id(), fileID.id() ) )
00057 
00058     uplFile = self.lcat.FILE.uploadFileFromDisk( fileName = diskFileName,
00059                                                  unit     = FILE.FSW_UNIT_SIU,
00060                                                  fileID   = fileID)
00061 
00062     if uplFile is None:
00063       self.setCompletionStatus(self.COMPL_STATUS_FAILED)
00064     else:
00065       self.setCompletionStatus(self.COMPL_STATUS_PASSED)
00066     # End of run
00067 
00068   def testStopRun(self):
00069     pass

Generated on Thu Apr 27 20:52:44 2006 for LICOS L02-01-00 by doxygen 1.4.6-NO