From 176b1869bc817d6528ab4a6a4364a8b97a76a417 Mon Sep 17 00:00:00 2001
From: Thierry Parmentelat <thierry.parmentelat@inria.fr>
Date: Wed, 17 Apr 2013 08:44:26 +0200
Subject: [PATCH] ctd

---
 system/TestPlc.py | 10 +++++-----
 system/TestSsh.py |  6 ++++--
 2 files changed, 9 insertions(+), 7 deletions(-)

diff --git a/system/TestPlc.py b/system/TestPlc.py
index 34e9959..296109d 100644
--- a/system/TestPlc.py
+++ b/system/TestPlc.py
@@ -180,16 +180,16 @@ class TestPlc:
 	pass
 
     def actual_command_in_guest (self,command):
-        return self.test_ssh.actual_command(self.host_to_guest(command))
+        return self.test_ssh.actual_command(self.host_to_guest(command),dry_run=self.options.dry_run)
     
     def start_guest (self):
-      return utils.system(self.test_ssh.actual_command(self.start_guest_in_host()))
+      return utils.system(self.test_ssh.actual_command(self.start_guest_in_host()),dry_run=self.options.dry_run)
     
     def stop_guest (self):
-      return utils.system(self.test_ssh.actual_command(self.stop_guest_in_host()))
+      return utils.system(self.test_ssh.actual_command(self.stop_guest_in_host()),dry_run=self.options.dry_run)
     
     def run_in_guest (self,command):
-        return utils.system(self.actual_command_in_guest(command))
+        return utils.system(self.actual_command_in_guest(command),dry_run=self.options.dry_run)
     
     def run_in_host (self,command):
         return self.test_ssh.run_in_buildname(command, dry_run=self.options.dry_run)
@@ -197,7 +197,7 @@ class TestPlc:
     #command gets run in the plc's vm
     def host_to_guest(self,command):
         if self.options.plcs_use_lxc:
-            return "ssh -o StrictHostKeyChecking=no %s %s"%(self.vserverip,command)
+            return "ssh -o StrictHostKeyChecking=no -o UserKnownHostsFile=/dev/null %s %s"%(self.vserverip,command)
         else:
             return "vserver %s exec %s"%(self.vservername,command)
     
diff --git a/system/TestSsh.py b/system/TestSsh.py
index b6ab948..c9d1e25 100644
--- a/system/TestSsh.py
+++ b/system/TestSsh.py
@@ -198,14 +198,15 @@ class TestSsh:
     def copy_home (self, local_file, recursive=False):
         return self.copy_abs(local_file,os.path.basename(local_file),recursive)
 
-    def fetch (self, remote_file, local_file, recursive=False):
+    def fetch (self, remote_file, local_file, recursive=False, dry_run=False):
         if self.is_local():
             command="cp "
             if recursive: command += "-r "
             command += "%s %s"%(remote_file,local_file)
         else:
             command="scp "
-            command += TestSsh.std_options
+            if not dry_run:
+                command += TestSsh.std_options
             if recursive: command += "-r "
             command += self.key_part()
             # absolute path - do not preprend buildname
@@ -213,6 +214,7 @@ class TestSsh:
                 remote_path=remote_file
             else:
                 remote_path="%s/%s"%(self.buildname,remote_file)
+                remote_path=self.fullname(remote_path)
             command += "%s:%s %s"%(self.hostname_part(),remote_path,local_file)
         return utils.system(command)
 
-- 
2.47.0