示例#1
0
 def ssh_shell(*args):
     self.ssh_run_command_count += 1
     if self.ssh_run_command_count == 1:
         # md5sum check
         raise SshcpError("an ssh error")
     else:
         # later tries
         return pickle.dumps([])
示例#2
0
 def ssh_shell(*args):
     self.ssh_run_command_count += 1
     if self.ssh_run_command_count < 2:
         raise SshcpError(
             "connect to host host.remote.com port 2202: Connection timed out"
         )
     else:
         return pickle.dumps([])
示例#3
0
 def ssh_run_command(*args):
     self.ssh_run_command_count += 1
     if self.ssh_run_command_count < 2:
         raise SshcpError(
             "ssh_exchange_identification: read: Connection reset by peer"
         )
     else:
         return pickle.dumps([])
示例#4
0
 def ssh_shell(*args):
     self.ssh_run_command_count += 1
     if self.ssh_run_command_count < 2:
         raise SshcpError(
             "[23033] INTERNAL ERROR: cannot create temporary directory!"
         )
     else:
         return pickle.dumps([])
示例#5
0
 def ssh_shell(*args):
     self.ssh_run_command_count += 1
     if self.ssh_run_command_count == 1:
         # md5sum check
         return b''
     elif self.ssh_run_command_count == 2:
         # first try
         raise SshcpError("SystemScannerError: something failed")
     else:
         # later tries
         return pickle.dumps([])
示例#6
0
 def ssh_shell(*args):
     self.ssh_run_command_count += 1
     if self.ssh_run_command_count == 1:
         # md5sum check
         return b''
     elif self.ssh_run_command_count == 2:
         # first try
         raise SshcpError("bash: /remote/path/to/scan: Text file busy")
     else:
         # later tries
         return pickle.dumps([])
示例#7
0
 def ssh_shell(*args):
     self.ssh_run_command_count += 1
     if self.ssh_run_command_count == 1:
         # md5sum check
         return b''
     elif self.ssh_run_command_count == 2:
         # first try
         raise SshcpError(
             "connect to host host.remote.com port 2202: Connection timed out"
         )
     else:
         # later tries
         return pickle.dumps([])
示例#8
0
 def ssh_shell(*args):
     self.ssh_run_command_count += 1
     if self.ssh_run_command_count == 1:
         # md5sum check
         return b''
     elif self.ssh_run_command_count == 2:
         # first try
         raise SshcpError(
             "[23033] INTERNAL ERROR: cannot create temporary directory!"
         )
     else:
         # later tries
         return pickle.dumps([])
示例#9
0
 def ssh_shell(*args):
     self.ssh_run_command_count += 1
     if self.ssh_run_command_count == 1:
         # md5sum check
         return b''
     elif self.ssh_run_command_count == 2:
         # first try
         return pickle.dumps([])
     elif self.ssh_run_command_count == 3:
         # second try
         raise SshcpError("an ssh error")
     else:
         # later tries
         return pickle.dumps([])
示例#10
0
 def ssh_copy(*args, **kwargs):
     raise SshcpError("an scp error")
示例#11
0
 def ssh_shell(*args):
     raise SshcpError("bash: /remote/path/to/scan: Text file busy")
示例#12
0
 def ssh_shell(*args):
     self.ssh_run_command_count += 1
     if self.ssh_run_command_count < 2:
         raise SshcpError("bash: /remote/path/to/scan: Text file busy")
     else:
         return pickle.dumps([])
示例#13
0
 def ssh_shell(*args):
     self.ssh_run_command_count += 1
     if self.ssh_run_command_count < 2:
         raise SshcpError("an ssh error")
     else:
         return pickle.dumps([])