open-insight/LSL2/STPROC/TEST_FTP_SERVICES.txt
Infineon\StieberD 7762b129af pre cutover push
2024-09-04 20:33:41 -07:00

203 lines
5.7 KiB
Plaintext

Compile function Test_FTP_Services(@Test)
#pragma precomp SRP_PreCompiler
$insert LOGICAL
Declare function FTP_Services, Environment_Services, Error_Services, SRP_Encode
Declare subroutine FTP_Services
GotoTest
// TODO: Code to run after each test goes here
Return TestResult or 1
//-----------------------------------------------------------------------------
// TESTS
//-----------------------------------------------------------------------------
Test TestOldTemecula
Host = '10.72.176.48'
Username = 'Infineon\TEMFTPEPIMesa'
Password = 'fW&EHJhKWg!skUKV4_34'
Data = SRP_Encode('Hello World!', 'BASE64')
LocalFile = 'HelloWorld.txt'
RemoteFile = 'HelloWorld.txt'
RemoteDirectory = '\TEMFTP_EPIMesa\Archive'
SSH = False$
GoSub RunTests
End Test
Test TestNewTemecula
Host = 'ecsftp.ec.local'
Username = 'EC\ECFIFTPSVC'
Password = 'ECTemPwd@07092018'
Data = SRP_Encode('Hello World!', 'BASE64')
LocalFile = 'HelloWorld.txt'
RemoteFile = 'HelloWorld.txt'
RemoteDirectory = '\TEMFTP_EPIMesa\Archive'
SSH = False$
GoSub RunTests
End Test
Test TestOldTower
Host = 'ftps.towersemi.com'
Username = 'irepif2'
Password = 'BGfq1h'
Data = SRP_Encode('Hello World!', 'BASE64')
LocalFile = 'HelloWorld.txt'
RemoteFile = 'HelloWorld.txt'
RemoteDirectory = '/incoming'
SSH = True$
GoSub RunTests
End Test
Test TestNewTower
Host = 'sFTPNA.extra.infineon.com'
Username = 'DNAMesaFI-FTP'
Password = 'OpenInsight2018....!'
Data = SRP_Encode('Hello World!', 'BASE64')
LocalFile = 'HelloWorld.txt'
RemoteFile = 'HelloWorld.txt'
RemoteDirectory = '/Tower'
SSH = True$
GoSub RunTests
End Test
Test TestOldVanguard
Host = '210.68.154.58'
Username = 'infineon'
Password = 'infi0808'
Data = SRP_Encode('Hello World!', 'BASE64')
LocalFile = 'HelloWorld.txt'
RemoteFile = 'HelloWorld.txt'
RemoteDirectory = ''
SSH = True$
GoSub RunTests
End Test
Test TestNewVanguard
Host = 'sFTPNA.extra.infineon.com'
Username = 'DNAMesaFI-FTP'
Password = 'OpenInsight2018....!'
Data = SRP_Encode('Hello World!', 'BASE64')
LocalFile = 'HelloWorld.txt'
RemoteFile = 'HelloWorld.txt'
RemoteDirectory = '/Vanguard'
SSH = True$
GoSub RunTests
End Test
Test TestOldEpisil
Host = '59.120.190.19'
Username = 'INFINEON'
Password = 'INFINEON'
Data = SRP_Encode('Hello World!', 'BASE64')
LocalFile = 'HelloWorld.txt'
RemoteFile = 'HelloWorld.txt'
RemoteDirectory = ''
SSH = True$
GoSub RunTests
End Test
Test TestNewEpisil
Host = 'sFTPNA.extra.infineon.com'
Username = 'DNAMesaFI-FTP'
Password = 'OpenInsight2018....!'
Data = SRP_Encode('Hello World!', 'BASE64')
LocalFile = 'HelloWorld.txt'
RemoteFile = 'HelloWorld.txt'
RemoteDirectory = '/Episil'
SSH = True$
GoSub RunTests
End Test
Test TestNewNewport
Host = 'sFTPNA.extra.infineon.com'
Username = 'DNAMesaFI-FTP'
Password = 'OpenInsight2018....!'
Data = SRP_Encode('Hello World!', 'BASE64')
LocalFile = 'HelloWorld.txt'
RemoteFile = 'HelloWorld.txt'
RemoteDirectory = '/Newport'
SSH = True$
GoSub RunTests
End Test
//----------------------------------------------------------------------------------------------------------------------
// RunTests
//
// Runs the bank of unit tests for each server.
//----------------------------------------------------------------------------------------------------------------------
RunTests:
// Delete the local and remote test files to start fresh.
OSDelete LocalFile
FTP_Services('DeleteFile', Host, RemoteFile, Username, Password, RemoteDirectory, '', True$, SSH)
// Send a test file. Only check for no error messages in the error response.
FTP_Services('SendFile', Host, '', Data, Username, Password, '', RemoteDirectory, RemoteFile, '', True$, SSH)
Message = Error_Services('GetMessage')
Assert Message equals ''
// Verify the file is on the remote server. Check for no errors in the error response and check the file created
// locally for expected content.
FTP_Services('GetFile', Host, RemoteFile, LocalFile, Username, Password, '', RemoteDirectory, '', True$, SSH)
Message = Error_Services('GetMessage')
Assert Message equals ''
OSRead HelloWorld from LocalFile then
OSDelete LocalFile
end else
HelloWorld = ''
end
Assert HelloWorld equals 'Hello World!'
// Delete the remote test file. Only check for no error messages in the error response.
FTP_Services('DeleteFile', Host, RemoteFile, Username, Password, RemoteDirectory, '', True$, SSH)
Message = Error_Services('GetMessage')
Assert Message equals ''
// Verify the file is no longer on the remote server. Use error message in the error response as the indicator.
FTP_Services('GetFile', Host, RemoteFile, LocalFile, Username, Password, '', RemoteDirectory, '', True$, SSH)
Message = Error_Services('GetMessage')
Assert Message NE ''
return