question

amichaels avatar image
amichaels asked amichaels edited

file session remote file URI

I'm trying to transfer a text file from my box to a DUT and it looks like I should be able to do that in a platform-independent way using the file session, as it supports remote file access. However, I get the following error when I try to open a file on the DUT via an SFTP URI. `Initialization Failed:org.apache.commons.vfs2.FileSystemException: The file type does not support append mode.` Here's the session profile info. Am I missing something?![alt text][1] [1]: /storage/temp/4193-remote_file.png
iTestiTest Enterprisesession profile
remote_file.png (18.1 KiB)
10 |950

Up to 2 attachments (including images) can be used with a maximum of 512.0 KiB each and 1.0 MiB total.

amichaels avatar image
amichaels answered amichaels edited
An SR has been opened for this issue
2 comments
10 |950

Up to 2 attachments (including images) can be used with a maximum of 512.0 KiB each and 1.0 MiB total.

amichaels avatar image amichaels ♦ commented ·
Support has confirmed that the sftp method for the file session will not work. SFTP does not allow appending to an existing file, only whole file copy. The reason other tools work is because they transfer a temporary copy to the local machine, edit it, then replace the remote copy with the edited local copy.
0 Likes 0 ·
amichaels avatar image amichaels ♦ commented ·
Allow me to clarify. For FTP, HTTP and SFTP, READ actions will work, but WRITE actions will not. These are limitations in the underlying protocol, not the iTest implementation
0 Likes 0 ·
amichaels avatar image
amichaels answered amichaels edited
Thanks, Vijay. I tried that first, but later decided to remove the credentials from the URI and put them in the authentication tab. I am able to connect to the machine, but it's something about the file itself. I'm going to try renaming the target file with a .txt or .csv extention. I suspect there may be some logic in the apache module handling the request that is restricting file extensions.
5 comments
10 |950

Up to 2 attachments (including images) can be used with a maximum of 512.0 KiB each and 1.0 MiB total.

amichaels avatar image amichaels ♦ commented ·
no, changing the file extension to .txt results in the exact same error. The issue may be the target host system. It is OpenBSD, but maybe I'll try with another target OS.
0 Likes 0 ·
amichaels avatar image amichaels ♦ commented ·
I tried on a target host of Ubuntu 14.04 and I get the same error. I'll try the fto as opposed to sftp.
0 Likes 0 ·
amichaels avatar image amichaels ♦ commented ·
I tried ftp this time and got a different error. I can read the file, but I can't write it. I set the file permissions to ugo+rwx, so it should be world-writeable. Still not luck.
0 Likes 0 ·
amichaels avatar image amichaels ♦ commented ·
Also, if I try using READ method via sftp URI, I get this error: Error attempting to open connection to server: org.apache.commons.vfs2.FileSystemException: Could not read from "sftp://192.168.95.254/home/amichaels/test.txt" because it is a not a file.
0 Likes 0 ·
amichaels avatar image amichaels ♦ commented ·
Okay, I go the ftp URI working. The default for the ftp server is that writes are disabled. I enabled it in the ftp server config and it works now. However, sftp still fails. I tried editing the file using an external sftp client (winscp) and I can modify and save the file using sftp. But, through the sftp URI in the file session, I still get the "The file type does not support append mode." error
0 Likes 0 ·
vijaykumar avatar image
vijaykumar answered vijaykumar edited
Please try with the below syntax to connect: Syntax: ftp://[ username[: password]@] hostname[ absolute-path] Eg: ftp://Vijay.Maddukuri: vijay@ftp.spirentcom.com/users/Vijay.Maddukuri/1.txt With the above syntax I am able to connect with both READ/WRITE mode.
10 |950

Up to 2 attachments (including images) can be used with a maximum of 512.0 KiB each and 1.0 MiB total.

Write an Answer

Hint: Notify or tag a user in this post by typing @username.

Up to 2 attachments (including images) can be used with a maximum of 512.0 KiB each and 1.0 MiB total.