6 new revisions:
Revision: dfe53fd54b62
Author: Anssi Syrjäsalo <[email protected]>
Date: Mon Jul 29 05:34:38 2013
Log: Initial implementation and tests
http://code.google.com/p/robotframework-sshlibrary/source/detail?r=dfe53fd54b62
Revision: aec2e856f043
Author: Anssi Syrjäsalo <[email protected]>
Date: Mon Jul 29 05:48:06 2013
Log: Split test resources and test data
http://code.google.com/p/robotframework-sshlibrary/source/detail?r=aec2e856f043
Revision: 54cddf157082
Author: Anssi Syrjäsalo <[email protected]>
Date: Mon Jul 29 05:54:35 2013
Log: Subdirectories into test data
http://code.google.com/p/robotframework-sshlibrary/source/detail?r=54cddf157082
Revision: b9b2459012cd
Author: Anssi Syrjäsalo <[email protected]>
Date: Mon Jul 29 05:54:56 2013
Log: Added example outputs to gitignore
http://code.google.com/p/robotframework-sshlibrary/source/detail?r=b9b2459012cd
Revision: 9b7bbb4840e0
Author: Anssi Syrjäsalo <[email protected]>
Date: Mon Jul 29 06:11:13 2013
Log: Fixed headers and line spacing in test files
http://code.google.com/p/robotframework-sshlibrary/source/detail?r=9b7bbb4840e0
Revision: b0372d0a3c8a
Author: Anssi Syrjäsalo <[email protected]>
Date: Mon Jul 29 06:19:14 2013
Log: Put Dir: Handling subdirs correctly on different target name
http://code.google.com/p/robotframework-sshlibrary/source/detail?r=b0372d0a3c8a
==============================================================================
Revision: dfe53fd54b62
Author: Anssi Syrjäsalo <[email protected]>
Date: Mon Jul 29 05:34:38 2013
Log: Initial implementation and tests
http://code.google.com/p/robotframework-sshlibrary/source/detail?r=dfe53fd54b62
Added:
/atest/put_dir.txt
Modified:
/atest/put_file.txt
/atest/resources/ssh_library_resources.txt
/src/SSHLibrary/abstractclient.py
=======================================
--- /dev/null
+++ /atest/put_dir.txt Mon Jul 29 05:34:38 2013
@@ -0,0 +1,40 @@
+*** Settings ***
+Force Tags pybot jybot
+Suite Setup Login As Valid User
+Suite Teardown Run Keywords Remove Test Files and Close Connections
+Resource resources/ssh_library_resources.txt
+
+
+*** Test Cases ***
+Put Dir With Absolute Destination
+ Put Dir And Verify ${TEXTFILES} ${USER HOME}/new_dir/ ${USER
HOME}/new_dir/textfiles
+ [Teardown] Execute Command rm -rf ${USER HOME}/new_dir
+
+Put Dir With Relative Destination
+ Put Dir And Verify ${TEXTFILES} new_dir/ ${USER
HOME}/new_dir/textfiles
+ [Teardown] Execute Command rm -rf ${USER HOME}/new_dir
+
+Put Dir To Home Directory
+ Put Dir And Verify ${TEXTFILES} ./ ${USER HOME}/textfiles
+ [Teardown] Execute Command rm -rf ${USER HOME}/textfiles
+
+Put Dir With Different Name
+ Put Dir And Verify ${TEXTFILES} ${USER HOME}/another_dir_name
${USER HOME}/another_dir_name
+ [Teardown] Execute Command rm -rf ${USER HOME}/another_dir_name
+
+*** Keywords ***
+Put Dir And Verify
+ [Arguments] ${source} ${destination} ${expected}
+ Verify Remote Dir Does Not Exist ${expected}
+ Put Dir ${source} ${destination}
+ Verify Remote Dir Exists ${expected}
+
+Verify Remote Dir Does Not Exist
+ [Arguments] ${expected}
+ ${rc} = Execute Command test -d ${expected} return_stdout=${EMPTY}
return_rc=true
+ Should Be Equal As Integers ${rc} 1
+
+Verify Remote Dir Exists
+ [Arguments] ${expected}
+ ${rc} = Execute Command test -d ${expected} return_stdout=${EMPTY}
return_rc=true
+ Should Be Equal As Integers ${rc} 0
=======================================
--- /atest/put_file.txt Fri Jul 26 05:01:03 2013
+++ /atest/put_file.txt Mon Jul 29 05:34:38 2013
@@ -1,5 +1,4 @@
*** Settings ***
-Documentation This suite contains test for 'Put File 'keywords These
tests use some dummy test files from under the scripts directory.
Force Tags pybot jybot
Suite Setup Login As Valid User
Suite Teardown Run Keywords Remove Test Files and Close Connections
Remove Local Tempdir
@@ -62,7 +61,7 @@
[Teardown] Execute Command rm -rf robotdir
Put File With Pattern Matching Directory
- Put Files And Verify ${TEXTFILES}test_fi* ${USER HOME}/ ${TEST FILE
NAME} ${TEST FILE 2 NAME}
+ Put Files And Verify ${TEXTFILES}/test_fi* ${USER HOME}/ ${TEST
FILE NAME} ${TEST FILE 2 NAME}
[Teardown] Execute Command rm -f ${TEST FILE NAME} ${TEST FILE 2
NAME}
Put File Should Fail When There Are No Source Files
=======================================
--- /atest/resources/ssh_library_resources.txt Fri Jul 26 05:01:03 2013
+++ /atest/resources/ssh_library_resources.txt Mon Jul 29 05:34:38 2013
@@ -5,7 +5,7 @@
*** Variables ***
${SCRIPTS} ${CURDIR}${/}scripts${/}
-${TEXTFILES} ${CURDIR}${/}textfiles${/}
+${TEXTFILES} ${CURDIR}${/}textfiles
${TEST SCRIPT NAME} test.sh
${TEST SCRIPT} ${SCRIPTS}${TEST SCRIPT NAME}
${INTERACTIVE TEST SCRIPT NAME} test_interactive.sh
@@ -14,16 +14,16 @@
${REPEAT TEST SCRIPT} ${SCRIPTS}${REPEAT TEST SCRIPT NAME}
${COUNTER NAME} counter.txt
${TEST FILE NAME} test_file.txt
-${TEST FILE} ${TEXTFILES}${TEST FILE NAME}
+${TEST FILE} ${TEXTFILES}${/}${TEST FILE NAME}
${TEST FILE 2 NAME} test_file2.txt
-${TEST FILE 2} ${TEXTFILES}${TEST FILE 2 NAME}
-${TEST FILE PATTERN} ${TEXTFILES}test*.txt
+${TEST FILE 2} ${TEXTFILES}${/}${TEST FILE 2 NAME}
+${TEST FILE PATTERN} ${TEXTFILES}${/}test*.txt
${FILE WITH NEWLINES NAME} file_with_newlines.txt
-${FILE WITH NEWLINES} ${TEXTFILES}${FILE WITH NEWLINES NAME}
+${FILE WITH NEWLINES} ${TEXTFILES}${/}${FILE WITH NEWLINES NAME}
${FILE WITH NON-ASCII NAME} aaääöö.txt
-${FILE WITH NON-ASCII} ${TEXTFILES}${FILE WITH NON-ASCII NAME}
+${FILE WITH NON-ASCII} ${TEXTFILES}${/}${FILE WITH NON-ASCII NAME}
${FILE WITH SPECIAL CHARS NAME} foo%2Fbar.txt
-${FILE WITH SPECIAL CHARS} ${TEXTFILES}${FILE WITH SPECIAL CHARS NAME}
+${FILE WITH SPECIAL CHARS} ${TEXTFILES}${/}${FILE WITH SPECIAL CHARS NAME}
*** Keywords ***
Login And Move Test Files
=======================================
--- /src/SSHLibrary/abstractclient.py Fri Jul 26 05:01:03 2013
+++ /src/SSHLibrary/abstractclient.py Mon Jul 29 05:34:38 2013
@@ -272,6 +272,14 @@
sftp_client.close()
return sources, destinations
+ def put_dir(self, source, destination='.', mode='0744',
+ newline='default', path_separator='/'):
+ sftp_client = self._create_sftp_client()
+ sources, destinations = sftp_client.put_dir(source, destination,
mode,
+ newline,
path_separator)
+ sftp_client.close()
+ return sources, destinations
+
def get_file(self, source, destination='.', path_separator='/'):
"""Get file(s) from the remote host to localhost.
@@ -305,19 +313,12 @@
def close(self):
self._client.close()
- def get_file(self, source, destination, path_separator='/'):
- remotefiles = self._get_get_file_sources(source, path_separator)
- localfiles = self._get_get_file_destinations(remotefiles,
destination)
- for src, dst in zip(remotefiles, localfiles):
- self._get_file(src, dst)
- return remotefiles, localfiles
-
def get_dir(self, source, destination, path_separator='/'):
remotefiles = []
localfiles = []
subdirs = [os.path.split(source)[1]]
for path in subdirs:
- [subdirs.append(os.path.join(path, subdir_name))
+ [subdirs.append(path_separator.join([path, subdir_name]))
for subdir_name in self._listdirs(path)]
remote_path = path + path_separator + "*"
local_path = os.path.join(destination, path) + path_separator
@@ -326,6 +327,13 @@
localfiles.extend(l)
return remotefiles, localfiles
+ def get_file(self, source, destination, path_separator='/'):
+ remotefiles = self._get_get_file_sources(source, path_separator)
+ localfiles = self._get_get_file_destinations(remotefiles,
destination)
+ for src, dst in zip(remotefiles, localfiles):
+ self._get_file(src, dst)
+ return remotefiles, localfiles
+
def _get_get_file_sources(self, source, path_separator):
if path_separator in source:
path, pattern = source.rsplit(path_separator, 1)
@@ -364,6 +372,27 @@
if not os.path.exists(dest):
os.makedirs(dest)
+ def put_dir(self, source, destination, mode, newline,
path_separator='/'):
+ os.chdir(os.path.split(source)[0])
+ parent = os.path.split(source)[1]
+ localfiles = []
+ remotefiles = []
+ for path, _, files in os.walk(parent):
+ for file in files:
+ local_path = os.path.join(path, file)
+ if destination.endswith('./'):
+ remote_path = path_separator.join([path, file])
+ elif destination.endswith('/'):
+ remote_path = path_separator.join([destination[:-1],
path,
+ file])
+ else:
+ remote_path = path_separator.join([destination, file])
+ l, r = self.put_file(local_path, remote_path, mode,
newline,
+ path_separator)
+ localfiles.extend(l)
+ remotefiles.extend(r)
+ return localfiles, remotefiles
+
def put_file(self, sources, destination, mode, newline,
path_separator='/'):
mode = int(mode, 8)
@@ -376,31 +405,6 @@
self._put_file(src, dst, mode, newline)
return localfiles, remotefiles
- def _put_file(self, source, destination, mode, newline):
- remotefile = self._create_remote_file(destination, mode)
- with open(source, 'rb') as localfile:
- position = 0
- while True:
- data = localfile.read(4096)
- if not data:
- break
- if newline and '\n' in data:
- data = data.replace('\n', newline)
- self._write_to_remote_file(remotefile, data, position)
- position += len(data)
- self._close_remote_file(remotefile)
-
- def _parse_path_elements(self, dest, path_separator):
- def _isabs(path):
- if dest.startswith(path_separator):
- return True
- if path_separator == '\\' and path[1:3] == ':\\':
- return True
- return False
- if not _isabs(dest):
- dest = path_separator.join([self._homedir, dest])
- return dest.rsplit(path_separator, 1)
-
def _get_put_file_sources(self, source):
sources = [f for f in glob.glob(source.replace('/', os.sep))
if os.path.isfile(f)]
@@ -424,6 +428,31 @@
for path in sources]
return files, dirpath
+ def _parse_path_elements(self, dest, path_separator):
+ def _isabs(path):
+ if dest.startswith(path_separator):
+ return True
+ if path_separator == '\\' and path[1:3] == ':\\':
+ return True
+ return False
+ if not _isabs(dest):
+ dest = path_separator.join([self._homedir, dest])
+ return dest.rsplit(path_separator, 1)
+
+ def _put_file(self, source, destination, mode, newline):
+ remotefile = self._create_remote_file(destination, mode)
+ with open(source, 'rb') as localfile:
+ position = 0
+ while True:
+ data = localfile.read(4096)
+ if not data:
+ break
+ if newline and '\n' in data:
+ data = data.replace('\n', newline)
+ self._write_to_remote_file(remotefile, data, position)
+ position += len(data)
+ self._close_remote_file(remotefile)
+
class AbstractCommand(object):
"""Base class for remote commands."""
==============================================================================
Revision: aec2e856f043
Author: Anssi Syrjäsalo <[email protected]>
Date: Mon Jul 29 05:48:06 2013
Log: Split test resources and test data
http://code.google.com/p/robotframework-sshlibrary/source/detail?r=aec2e856f043
Added:
/atest/testdata/keyfiles/id_rsa_inaccessible
/atest/testdata/keyfiles/id_rsa_invalid
/atest/testdata/scripts/test.sh
/atest/testdata/scripts/test_interactive.sh
/atest/testdata/scripts/test_repeat.sh
/atest/testdata/textfiles/aaääöö.txt
/atest/testdata/textfiles/file_with_newlines.txt
/atest/testdata/textfiles/foo%2Fbar.txt
/atest/testdata/textfiles/test_file.txt
/atest/testdata/textfiles/test_file2.txt
Deleted:
/atest/resources/keyfiles/id_rsa_inaccessible
/atest/resources/keyfiles/id_rsa_invalid
/atest/resources/scripts/test.sh
/atest/resources/scripts/test_interactive.sh
/atest/resources/scripts/test_repeat.sh
/atest/resources/textfiles/aaääöö.txt
/atest/resources/textfiles/file_with_newlines.txt
/atest/resources/textfiles/foo%2Fbar.txt
/atest/resources/textfiles/test_file.txt
/atest/resources/textfiles/test_file2.txt
Modified:
/.gitignore
/atest/login_with_public_key.txt
/atest/resources/ssh_library_resources.txt
=======================================
--- /dev/null
+++ /atest/testdata/keyfiles/id_rsa_inaccessible Mon Jul 29 05:48:06 2013
@@ -0,0 +1,30 @@
+-----BEGIN RSA PRIVATE KEY-----
+Proc-Type: 4,ENCRYPTED
+DEK-Info: DES-EDE3-CBC,128A0719BCB2B030
+
+cuDVjGr0qTI4UcuMhlQwEvKBGK5LmHB5PPsMF4ydMJ/esPVa+Itv/mwNlqGAdLkN
+I4xGvnoyTKQ3RnqkXcf7Tl8d5DJc1mBJkf6AcYrEDmXo/NZAr8A1eFjJTDUgV/ct
+c3wNRQCOkK9Q5WYqkSbPdrFf/+CnwepM+mFa4N8JB6Jkn30/SIR1jEz3HxpTt1bd
+avPADpBof1g+KkVZ8w0YgeH5LlaBGdoqQte8WOV14v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qJQHLG9pFrW+QZNCnsJqhLKS4zqUT/YgMfmPP5BAVwnLNiqznNBUgcP0KiZshuqq
+sbbJ5UNR7WE7o6Kwyn0OBsFgjiY+5V89EuZiJYkrtY0qU2oVeiIJ5DitDaVvXZ2v
+XGaQCdsMYgkrjF+5UfwZVgzJt6UYEPoE79SxYm3cfDSHfRmaLRtpYoQ+KH/+RQce
+5/nuQbKd0k1tx84NJSw/4BItczDuwbiMJdFHe3pqZFFQa54G7/8xpodaQ310vJa3
+RDwhrYfMdVK3zxeFRNyPkjlPBQ4Is47PMZg1aY/yA/KwJUP/2KbRYQ==
+-----END RSA PRIVATE KEY-----
=======================================
--- /dev/null
+++ /atest/testdata/keyfiles/id_rsa_invalid Mon Jul 29 05:48:06 2013
@@ -0,0 +1,1 @@
+invalid private key file
=======================================
--- /dev/null
+++ /atest/testdata/scripts/test.sh Mon Jul 29 05:48:06 2013
@@ -0,0 +1,8 @@
+#!/bin/sh
+
+if [ "$1" != "" ]; then
+ echo $1
+else
+ echo This is stdout
+ echo This is stderr 1>&2
+fi
=======================================
--- /dev/null
+++ /atest/testdata/scripts/test_interactive.sh Mon Jul 29 05:48:06 2013
@@ -0,0 +1,8 @@
+#!/bin/sh
+
+echo -n "Give your name?"
+read NAME
+if [ "$NAME" = "Error" ]; then
+ echo This is Error 1>&2;
+fi
+echo Hello $NAME
=======================================
--- /dev/null
+++ /atest/testdata/scripts/test_repeat.sh Mon Jul 29 05:48:06 2013
@@ -0,0 +1,11 @@
+#!/bin/sh
+
+if [ -f counter.txt ]
+then
+ count=$(cat counter.txt)
+ echo Current count is $count
+ echo $((1+$count)) > counter.txt
+else
+ echo started counter;
+ echo 1 > counter.txt;
+fi
=======================================
--- /dev/null
+++ /atest/testdata/textfiles/aaääöö.txt Mon Jul 29 05:48:06 2013
@@ -0,0 +1,4 @@
+This is a test file used to test non-ASCII character encoding
+
+ää
+öö
=======================================
--- /dev/null
+++ /atest/testdata/textfiles/file_with_newlines.txt Mon Jul 29 05:48:06
2013
@@ -0,0 +1,4 @@
+
+This is a test file used in Get File and Put File tests.
+
+And it contains newlines.
=======================================
--- /dev/null
+++ /atest/testdata/textfiles/foo%2Fbar.txt Mon Jul 29 05:48:06 2013
@@ -0,0 +1,1 @@
+This is a test file used in Get File and Put File tests.
=======================================
--- /dev/null
+++ /atest/testdata/textfiles/test_file.txt Mon Jul 29 05:48:06 2013
@@ -0,0 +1,1 @@
+This is a test file used in Get File and Put File tests.
=======================================
--- /dev/null
+++ /atest/testdata/textfiles/test_file2.txt Mon Jul 29 05:48:06 2013
@@ -0,0 +1,1 @@
+This is another test file used in Get File and Put File tests.
=======================================
--- /atest/resources/keyfiles/id_rsa_inaccessible Sun Nov 7 23:16:55 2010
+++ /dev/null
@@ -1,30 +0,0 @@
------BEGIN RSA PRIVATE KEY-----
-Proc-Type: 4,ENCRYPTED
-DEK-Info: DES-EDE3-CBC,128A0719BCB2B030
-
-cuDVjGr0qTI4UcuMhlQwEvKBGK5LmHB5PPsMF4ydMJ/esPVa+Itv/mwNlqGAdLkN
-I4xGvnoyTKQ3RnqkXcf7Tl8d5DJc1mBJkf6AcYrEDmXo/NZAr8A1eFjJTDUgV/ct
-c3wNRQCOkK9Q5WYqkSbPdrFf/+CnwepM+mFa4N8JB6Jkn30/SIR1jEz3HxpTt1bd
-avPADpBof1g+KkVZ8w0YgeH5LlaBGdoqQte8WOV14vu5lBZGG+O/VVHODjQ5/YvW
-qah7zC0pzaThRDA4Z/ZKqV+A43obju8ngzF48I2+omRPdO6+fWjpdMZb9Z+o15jq
-JuSr80xHxbmR6SYN+M25it9qgx55bXVdGRrxGft0crKmE/hiFfo1T3hJj/xcWcwc
-bPxEckkfcO2FIeZDlGgv4mGvUaXzzHLzr/JpwNjMa3vE2GeEfzrmuOL/gPe1FtMS
-Es9c+ZndOyYoZUi13eTXTtReEKPMc4sp0vr8tNNopSCOeOk8KUO7npwLGIfXpARY
-k/Au2ktpiIHORK6iyPgK8MNuKiabhOEGG8zv7G7qI+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==
------END RSA PRIVATE KEY-----
=======================================
--- /atest/resources/keyfiles/id_rsa_invalid Sun Nov 7 23:16:55 2010
+++ /dev/null
@@ -1,1 +0,0 @@
-invalid private key file
=======================================
--- /atest/resources/scripts/test.sh Thu Feb 26 22:16:03 2009
+++ /dev/null
@@ -1,8 +0,0 @@
-#!/bin/sh
-
-if [ "$1" != "" ]; then
- echo $1
-else
- echo This is stdout
- echo This is stderr 1>&2
-fi
=======================================
--- /atest/resources/scripts/test_interactive.sh Thu Feb 26 22:16:03 2009
+++ /dev/null
@@ -1,8 +0,0 @@
-#!/bin/sh
-
-echo -n "Give your name?"
-read NAME
-if [ "$NAME" = "Error" ]; then
- echo This is Error 1>&2;
-fi
-echo Hello $NAME
=======================================
--- /atest/resources/scripts/test_repeat.sh Thu Feb 26 22:16:03 2009
+++ /dev/null
@@ -1,11 +0,0 @@
-#!/bin/sh
-
-if [ -f counter.txt ]
-then
- count=$(cat counter.txt)
- echo Current count is $count
- echo $((1+$count)) > counter.txt
-else
- echo started counter;
- echo 1 > counter.txt;
-fi
=======================================
--- /atest/resources/textfiles/aaääöö.txt Fri Jul 26 05:01:03 2013
+++ /dev/null
@@ -1,4 +0,0 @@
-This is a test file used to test non-ASCII character encoding
-
-ää
-öö
=======================================
--- /atest/resources/textfiles/file_with_newlines.txt Fri Jul 26 05:01:03
2013
+++ /dev/null
@@ -1,4 +0,0 @@
-
-This is a test file used in Get File and Put File tests.
-
-And it contains newlines.
=======================================
--- /atest/resources/textfiles/foo%2Fbar.txt Fri Jul 26 05:01:03 2013
+++ /dev/null
@@ -1,1 +0,0 @@
-This is a test file used in Get File and Put File tests.
=======================================
--- /atest/resources/textfiles/test_file.txt Fri Jul 26 05:01:03 2013
+++ /dev/null
@@ -1,1 +0,0 @@
-This is a test file used in Get File and Put File tests.
=======================================
--- /atest/resources/textfiles/test_file2.txt Fri Jul 26 05:01:03 2013
+++ /dev/null
@@ -1,1 +0,0 @@
-This is another test file used in Get File and Put File tests.
=======================================
--- /.gitignore Tue Jun 18 03:59:17 2013
+++ /.gitignore Mon Jul 29 05:48:06 2013
@@ -3,4 +3,4 @@
*.pyc
*.class
atest/results
-atest/resources/keyfiles/id_rsa
+atest/testdata/keyfiles/id_rsa
=======================================
--- /atest/login_with_public_key.txt Fri Aug 24 04:22:16 2012
+++ /atest/login_with_public_key.txt Mon Jul 29 05:48:06 2013
@@ -5,7 +5,7 @@
Resource resources/ssh_library_resources.txt
*** Variables ***
-${PUBKEYDIR} ${CURDIR}/resources/keyfiles
+${PUBKEYDIR} ${CURDIR}/testdata/keyfiles
${PUBKEY_USERNAME} testkey
${PUBKEY_PASSWORD} ${EMPTY}
${PUBKEY_FILE} ${PUBKEYDIR}/id_rsa
=======================================
--- /atest/resources/ssh_library_resources.txt Mon Jul 29 05:34:38 2013
+++ /atest/resources/ssh_library_resources.txt Mon Jul 29 05:48:06 2013
@@ -4,14 +4,14 @@
Library OperatingSystem WITH NAME OS
*** Variables ***
-${SCRIPTS} ${CURDIR}${/}scripts${/}
-${TEXTFILES} ${CURDIR}${/}textfiles
+${SCRIPTS} ${CURDIR}${/}..${/}testdata${/}scripts
+${TEXTFILES} ${CURDIR}${/}..${/}testdata${/}textfiles
${TEST SCRIPT NAME} test.sh
-${TEST SCRIPT} ${SCRIPTS}${TEST SCRIPT NAME}
+${TEST SCRIPT} ${SCRIPTS}${/}${TEST SCRIPT NAME}
${INTERACTIVE TEST SCRIPT NAME} test_interactive.sh
-${INTERACTIVE TEST SCRIPT} ${SCRIPTS}${INTERACTIVE TEST SCRIPT NAME}
+${INTERACTIVE TEST SCRIPT} ${SCRIPTS}${/}${INTERACTIVE TEST SCRIPT NAME}
${REPEAT TEST SCRIPT NAME} test_repeat.sh
-${REPEAT TEST SCRIPT} ${SCRIPTS}${REPEAT TEST SCRIPT NAME}
+${REPEAT TEST SCRIPT} ${SCRIPTS}${/}${REPEAT TEST SCRIPT NAME}
${COUNTER NAME} counter.txt
${TEST FILE NAME} test_file.txt
${TEST FILE} ${TEXTFILES}${/}${TEST FILE NAME}
==============================================================================
Revision: 54cddf157082
Author: Anssi Syrjäsalo <[email protected]>
Date: Mon Jul 29 05:54:35 2013
Log: Subdirectories into test data
http://code.google.com/p/robotframework-sshlibrary/source/detail?r=54cddf157082
Added:
/atest/testdata/textfiles/special/aaääöö.txt
/atest/testdata/textfiles/special/foo%2Fbar.txt
Deleted:
/atest/testdata/textfiles/aaääöö.txt
/atest/testdata/textfiles/foo%2Fbar.txt
Modified:
/atest/resources/ssh_library_resources.txt
=======================================
--- /dev/null
+++ /atest/testdata/textfiles/special/aaääöö.txt Mon Jul 29 05:54:35
2013
@@ -0,0 +1,1 @@
+This is a test file used to test non-ASCII character encoding.
=======================================
--- /dev/null
+++ /atest/testdata/textfiles/special/foo%2Fbar.txt Mon Jul 29 05:54:35 2013
@@ -0,0 +1,1 @@
+This is a test file used in Get File and Put File tests.
=======================================
--- /atest/testdata/textfiles/aaääöö.txt Mon Jul 29 05:48:06 2013
+++ /dev/null
@@ -1,4 +0,0 @@
-This is a test file used to test non-ASCII character encoding
-
-ää
-öö
=======================================
--- /atest/testdata/textfiles/foo%2Fbar.txt Mon Jul 29 05:48:06 2013
+++ /dev/null
@@ -1,1 +0,0 @@
-This is a test file used in Get File and Put File tests.
=======================================
--- /atest/resources/ssh_library_resources.txt Mon Jul 29 05:48:06 2013
+++ /atest/resources/ssh_library_resources.txt Mon Jul 29 05:54:35 2013
@@ -21,9 +21,9 @@
${FILE WITH NEWLINES NAME} file_with_newlines.txt
${FILE WITH NEWLINES} ${TEXTFILES}${/}${FILE WITH NEWLINES NAME}
${FILE WITH NON-ASCII NAME} aaääöö.txt
-${FILE WITH NON-ASCII} ${TEXTFILES}${/}${FILE WITH NON-ASCII NAME}
+${FILE WITH NON-ASCII} ${TEXTFILES}${/}special${/}${FILE WITH NON-ASCII
NAME}
${FILE WITH SPECIAL CHARS NAME} foo%2Fbar.txt
-${FILE WITH SPECIAL CHARS} ${TEXTFILES}${/}${FILE WITH SPECIAL CHARS NAME}
+${FILE WITH SPECIAL CHARS} ${TEXTFILES}${/}special${/}${FILE WITH SPECIAL
CHARS NAME}
*** Keywords ***
Login And Move Test Files
==============================================================================
Revision: b9b2459012cd
Author: Anssi Syrjäsalo <[email protected]>
Date: Mon Jul 29 05:54:56 2013
Log: Added example outputs to gitignore
http://code.google.com/p/robotframework-sshlibrary/source/detail?r=b9b2459012cd
Modified:
/.gitignore
=======================================
--- /.gitignore Mon Jul 29 05:48:06 2013
+++ /.gitignore Mon Jul 29 05:54:56 2013
@@ -4,3 +4,6 @@
*.class
atest/results
atest/testdata/keyfiles/id_rsa
+examples/output.xml
+examples/log.html
+examples/report.html
==============================================================================
Revision: 9b7bbb4840e0
Author: Anssi Syrjäsalo <[email protected]>
Date: Mon Jul 29 06:11:13 2013
Log: Fixed headers and line spacing in test files
http://code.google.com/p/robotframework-sshlibrary/source/detail?r=9b7bbb4840e0
Modified:
/atest/get_dir.txt
/atest/login_with_public_key.txt
/atest/put_dir.txt
/atest/start_command.txt
=======================================
--- /atest/get_dir.txt Thu Jul 25 07:09:43 2013
+++ /atest/get_dir.txt Mon Jul 29 06:11:13 2013
@@ -17,7 +17,6 @@
Get Dir Using Different Name
Get Dir And Verify Content ${USER HOME}/test_root robot-tmpdir/foo
-
*** Keywords ***
Get Dir And Verify Content
[Arguments] ${source} ${destination}
=======================================
--- /atest/login_with_public_key.txt Mon Jul 29 05:48:06 2013
+++ /atest/login_with_public_key.txt Mon Jul 29 06:11:13 2013
@@ -31,7 +31,6 @@
Run Keyword And Expect Error Could not read key
file '${inaccessiblepubkeyfile}' Login With Public Key
${PUBKEY_USERNAME} ${INACCESSIBLE PUBKEY FILE} ${PUBKEY_PASSWORD}
[Teardown] Run Keywords Grant Read Permission Close All Connections
-
*** Keywords ***
Check Key Files
[Documentation] If key file directory `keyfiles` does not exist, mark
these tests non-critical
=======================================
--- /atest/put_dir.txt Mon Jul 29 05:34:38 2013
+++ /atest/put_dir.txt Mon Jul 29 06:11:13 2013
@@ -4,7 +4,6 @@
Suite Teardown Run Keywords Remove Test Files and Close Connections
Resource resources/ssh_library_resources.txt
-
*** Test Cases ***
Put Dir With Absolute Destination
Put Dir And Verify ${TEXTFILES} ${USER HOME}/new_dir/ ${USER
HOME}/new_dir/textfiles
=======================================
--- /atest/start_command.txt Fri Aug 24 04:22:16 2012
+++ /atest/start_command.txt Mon Jul 29 06:11:13 2013
@@ -5,7 +5,7 @@
Test Teardown Execute Command rm -f ${TEST FILE NAME}
Resource resources/ssh_library_resources.txt
-*** test cases ***
+*** Test Cases ***
Start Command And Read Process Output With Defaults
Start Command ./${TEST SCRIPT NAME}
${stdout} = Read Command Output
==============================================================================
Revision: b0372d0a3c8a
Author: Anssi Syrjäsalo <[email protected]>
Date: Mon Jul 29 06:19:14 2013
Log: Put Dir: Handling subdirs correctly on different target name
http://code.google.com/p/robotframework-sshlibrary/source/detail?r=b0372d0a3c8a
Modified:
/atest/put_dir.txt
/src/SSHLibrary/abstractclient.py
=======================================
--- /atest/put_dir.txt Mon Jul 29 06:11:13 2013
+++ /atest/put_dir.txt Mon Jul 29 06:19:14 2013
@@ -26,14 +26,16 @@
[Arguments] ${source} ${destination} ${expected}
Verify Remote Dir Does Not Exist ${expected}
Put Dir ${source} ${destination}
- Verify Remote Dir Exists ${expected}
+ Verify Remote Dir Structure Exists ${expected}
Verify Remote Dir Does Not Exist
[Arguments] ${expected}
${rc} = Execute Command test -d ${expected} return_stdout=${EMPTY}
return_rc=true
Should Be Equal As Integers ${rc} 1
-Verify Remote Dir Exists
+Verify Remote Dir Structure Exists
[Arguments] ${expected}
${rc} = Execute Command test -d ${expected} return_stdout=${EMPTY}
return_rc=true
Should Be Equal As Integers ${rc} 0
+ ${rc} = Execute Command test -d ${expected}/special
return_stdout=${EMPTY} return_rc=true
+ Should Be Equal As Integers ${rc} 0
=======================================
--- /src/SSHLibrary/abstractclient.py Mon Jul 29 05:34:38 2013
+++ /src/SSHLibrary/abstractclient.py Mon Jul 29 06:19:14 2013
@@ -386,7 +386,10 @@
remote_path = path_separator.join([destination[:-1],
path,
file])
else:
- remote_path = path_separator.join([destination, file])
+ path_without_parent = path.replace(parent, '')
+ remote_path = path_separator.join([destination,
+ path_without_parent,
+ file])
l, r = self.put_file(local_path, remote_path, mode,
newline,
path_separator)
localfiles.extend(l)
--
---
You received this message because you are subscribed to the Google Groups "robotframework-commit" group.
To unsubscribe from this group and stop receiving emails from it, send an email
to [email protected].
For more options, visit https://groups.google.com/groups/opt_out.