Ejemplo n.º 1
0
 def testExplicitSshWorker(self):
     # init worker
     worker = WorkerSsh(HOSTNAME, command="/bin/echo alright", handler=None)
     self._task.schedule(worker)
     # run task
     self._task.resume()
     # test output
     self.assertEqual(worker.node_buffer(HOSTNAME), b"alright")
Ejemplo n.º 2
0
 def testExplicitSshWorker(self):
     # init worker
     worker = WorkerSsh(HOSTNAME, command="/bin/echo alright", handler=None)
     self._task.schedule(worker)
     # run task
     self._task.resume()
     # test output
     self.assertEqual(worker.node_buffer(HOSTNAME), "alright")
Ejemplo n.º 3
0
 def testExplicitSshWorker(self):
     """test simple localhost command with explicit ssh worker"""
     # init worker
     worker = WorkerSsh("localhost", command="/bin/echo alright", handler=None, timeout=5)
     self.assert_(worker != None)
     self._task.schedule(worker)
     # run task
     self._task.resume()
     # test output
     self.assertEqual(worker.node_buffer("localhost"), "alright")
Ejemplo n.º 4
0
 def testExplicitSshWorker(self):
     """test simple localhost command with explicit ssh worker"""
     # init worker
     worker = WorkerSsh("localhost", command="/bin/echo alright", handler=None, timeout=5)
     self.assert_(worker != None)
     self._task.schedule(worker)
     # run task
     self._task.resume()
     # test output
     self.assertEqual(worker.node_buffer("localhost"), "alright")
Ejemplo n.º 5
0
 def testExplicitSshWorkerWithOptions(self):
     self._task.set_info("ssh_path", "/usr/bin/ssh -C")
     self._task.set_info("ssh_options", "-oLogLevel=QUIET")
     worker = WorkerSsh(HOSTNAME, command="/bin/echo alright", handler=None)
     self._task.schedule(worker)
     # run task
     self._task.resume()
     # test output
     self.assertEqual(worker.node_buffer(HOSTNAME), b"alright")
     # clear options after test
     task_cleanup()
     self.assertEqual(task_self().info("ssh_path"), None)
Ejemplo n.º 6
0
 def testExplicitSshWorkerWithOptions(self):
     self._task.set_info("ssh_path", "/usr/bin/ssh -C")
     self._task.set_info("ssh_options", "-oLogLevel=QUIET")
     worker = WorkerSsh(HOSTNAME, command="/bin/echo alright", handler=None)
     self._task.schedule(worker)
     # run task
     self._task.resume()
     # test output
     self.assertEqual(worker.node_buffer(HOSTNAME), "alright")
     # clear options after test
     task_cleanup()
     self.assertEqual(task_self().info("ssh_path"), None)