Skip to contentSkip to conversation

oeqa/sshcontrol: Ensure we don't trigger ssh-askpass

PATCH New Richard Purdie 1 participant 1 message Jul 23, 2015

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 oeqa/sshcontrol: Ensure we don't trigger ssh-askpass

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.

meta/lib/oeqa/utils/sshcontrol.py +7 -0
index 1c81795..4f8d3d2 100644
@@ -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: