]> code.ossystems Code Review - openembedded-core.git/commitdiff
oeqa/sshcontrol: Ensure we don't trigger ssh-askpass
authorRichard Purdie <richard.purdie@linuxfoundation.org>
Thu, 23 Jul 2015 15:51:27 +0000 (16:51 +0100)
committerRichard Purdie <richard.purdie@linuxfoundation.org>
Fri, 24 Jul 2015 22:29:40 +0000 (23:29 +0100)
If DISPLAY is set, ssh-askpass can be triggered which is not what
we want in the middle of sanity tests. We can disable this by
unsetting DISPLAY.

Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
meta/lib/oeqa/utils/sshcontrol.py

index 1c81795a878b4ff8560c8954b2fa85531ffc8cea..4f8d3d2c98f22892d25264bd7f3f4c449b14e45d 100644 (file)
@@ -10,6 +10,7 @@ import subprocess
 import time
 import os
 import select
+import copy
 
 
 class SSHProcess(object):
@@ -31,6 +32,12 @@ class SSHProcess(object):
         self.starttime = None
         self.logfile = None
 
+        # Unset DISPLAY which means we won't trigger SSH_ASKPASS
+        env = copy.copy(os.environ)
+        if "DISPLAY" in env:
+            del env['DISPLAY']
+        self.options['env'] = env
+
     def log(self, msg):
         if self.logfile:
             with open(self.logfile, "a") as f: