Beispiel #1
0
 def test_execute_single_quotes(self):
     cmd = execute_over_ssh('\'ls\'', 'machine:222')
     self.assertEqual([
         'ssh', 'machine', '-p', '222', '-C',
         "/usr/bin/env bash -c ' '\"'\"'ls'\"'\"' '"
     ], cmd)
Beispiel #2
0
 def test_execute_with_port(self):
     cmd = execute_over_ssh('ls', 'machine:222')
     self.assertEqual([
         'ssh', 'machine', '-p', '222', '-C', "/usr/bin/env bash -c ' ls '"
     ], cmd)
Beispiel #3
0
 def test_execute_double_quotes(self):
     cmd = execute_over_ssh('"ls"', 'machine:222')
     self.assertEqual([
         'ssh', 'machine', '-p', '222', '-C',
         "/usr/bin/env bash -c ' \"ls\" '"
     ], cmd)
Beispiel #4
0
 def test_invalid_port(self):
     with self.assertRaises(InvalidConfig):
         execute_over_ssh('ls', 'machine:spam')