[oe-commits] Richard Purdie : oeqa/sshcontrol: Ensure we don't trigger ssh-askpass

git at git.openembedded.org git at git.openembedded.org
Fri Jul 24 22:30:13 UTC 2015


Module: openembedded-core.git
Branch: master
Commit: 085681a1418a29a8331cdde0f477f4e223de84be
URL:    http://git.openembedded.org/?p=openembedded-core.git&a=commit;h=085681a1418a29a8331cdde0f477f4e223de84be

Author: Richard Purdie <richard.purdie at linuxfoundation.org>
Date:   Thu Jul 23 16:51:27 2015 +0100

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.

Signed-off-by: Richard Purdie <richard.purdie at linuxfoundation.org>

---

 meta/lib/oeqa/utils/sshcontrol.py | 7 +++++++
 1 file changed, 7 insertions(+)

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



More information about the Openembedded-commits mailing list