testFileDump.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/11 20:56:27 $"
00015 __version__  = "$Revision: 1.9 $"
00016 __release__  = "$Name: HEAD $"
00017 __credits__  = "SLAC"
00018 
00019 import LICOS.copyright_SLAC
00020 
00021 import logging as log
00022 import            os
00023 
00024 from   LICOS_Scripts.lib.testAppBase import TestAppBase
00025 import LICOS.lib.cmdTlmDb.FILE as FILE
00026 from   LICOS.lib.LATconstants import *
00027 
00028 
00029 #  Example application implementation.
00030 class testFileDump(TestAppBase):
00031   "Test file dump a file stored on the VSC/SIU"
00032   def __init__(self, common):
00033     TestAppBase.__init__(self, common)
00034     log.debug("%s.__init__()" % self.getName())
00035 
00036   def getName(self):
00037     return self.__class__.__name__
00038 
00039   def startRun(self):
00040     TestAppBase.startRun(self)
00041     #self.__dumpCTDBtelem.enable()
00042 
00043   def run(self):
00044     log.debug("%s.startRun()" % self.getName())
00045 
00046     diskFileName = os.path.join(ONLINE_ROOT, 'LICOS/tests/data/12346_hdr_out')
00047     # compute a semi-arbitrary file ID.  Directory/fileNum up to user.
00048     fileID = FILE.FswFileID( device     = FILE.FSW_DEVICE_RAM,
00049                              directory  = 10,
00050                              fileNumber = 12346)
00051 
00052     fswFile = self.lcat.FILE.downloadFile(unit     = FILE.FSW_UNIT_SIU,
00053                                           fileID   = fileID)
00054 
00055     f = open(diskFileName, 'wb')
00056 
00057     fswFile.write(f)
00058     f.close()
00059 
00060     self.setCompletionStatus(self.COMPL_STATUS_PASSED)
00061     # End of run
00062 
00063   def stopRun(self):
00064     TestAppBase.stopRun(self)

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