git://git.onelab.eu
/
tests.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
new test steps - exercise sfi update to remove/insert a user in a slice
[tests.git]
/
system
/
TestSsh.py
diff --git
a/system/TestSsh.py
b/system/TestSsh.py
index
c9d1e25
..
7448ee7
100644
(file)
--- a/
system/TestSsh.py
+++ b/
system/TestSsh.py
@@
-29,9
+29,9
@@
class TestSsh:
result=''
for char in command:
if char in "\\\"'<>&|;()$*~":
result=''
for char in command:
if char in "\\\"'<>&|;()$*~":
- result +='\\'+char
+ result +=
'\\'+char
else:
else:
- result +=char
+ result +=
char
return result
# check main IP address against the provided hostname
return result
# check main IP address against the provided hostname
@@
-77,7
+77,7
@@
class TestSsh:
return "%s@%s"%(self.username,self.hostname)
# command gets run on the right box
return "%s@%s"%(self.username,self.hostname)
# command gets run on the right box
- def actual_command (self, command, keep_stdin=False, dry_run=False):
+ def actual_command (self, command, keep_stdin=False, dry_run=False
,backslash=True
):
if self.is_local():
return command
ssh_command = "ssh "
if self.is_local():
return command
ssh_command = "ssh "
@@
-87,7
+87,11
@@
class TestSsh:
ssh_command += TestSsh.std_options
if self.unknown_host: ssh_command += TestSsh.unknown_option
ssh_command += self.key_part()
ssh_command += TestSsh.std_options
if self.unknown_host: ssh_command += TestSsh.unknown_option
ssh_command += self.key_part()
- ssh_command += "%s %s" %(self.hostname_part(),TestSsh.backslash_shell_specials(command))
+ ssh_command += self.hostname_part() + " "
+ if backslash:
+ ssh_command += TestSsh.backslash_shell_specials(command)
+ else:
+ ssh_command += command
return ssh_command
# same in argv form
return ssh_command
# same in argv form
@@
-180,7
+184,8
@@
class TestSsh:
self.fullname(self.buildname),os.path.basename(local_file) or ".")
if dry_run:
utils.header ("DRY RUN TestSsh.copy %s"%scp_command)
self.fullname(self.buildname),os.path.basename(local_file) or ".")
if dry_run:
utils.header ("DRY RUN TestSsh.copy %s"%scp_command)
- return True
+ # need to be consistent with the non-dry-run mode
+ return 0
return utils.system(scp_command)
def copy_abs (self,local_file,remote_file,recursive=False):
return utils.system(scp_command)
def copy_abs (self,local_file,remote_file,recursive=False):