00001
00002
00003
00004
00005
00006
00007
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
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
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
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
00062
00063 def stopRun(self):
00064 TestAppBase.stopRun(self)