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/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
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
00048 diskFileName = os.path.join(ONLINE_ROOT, 'LICOS/tests/data/12346_hdr')
00049
00050
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
00067
00068 def testStopRun(self):
00069 pass