summaryrefslogtreecommitdiff
path: root/test
diff options
context:
space:
mode:
authorMartin Pitt <martinpitt@gnome.org>2012-10-15 11:31:24 +0200
committerMartin Pitt <martinpitt@gnome.org>2012-10-15 13:16:49 +0200
commitee7f7ebab9b1698d92fe27a85e4b85ef4a49250a (patch)
tree8552b62a2aded11dc08e847cfefe428f3026353a /test
parent582c311ed0ff0306e5be854e9d4f5a0761342d61 (diff)
downloadgvfs-ee7f7ebab9b1698d92fe27a85e4b85ef4a49250a.tar.gz
gvfs-test: Stop using /var/log/sshd.log
Just read sshd's output directly from the process' stderr pipe. With that we can stop relying on that part of gvfs-testbed and get the tests closer to being able to run without gvfs-testbed. https://bugzilla.gnome.org/show_bug.cgi?id=686006
Diffstat (limited to 'test')
-rwxr-xr-xtest/gvfs-test14
1 files changed, 11 insertions, 3 deletions
diff --git a/test/gvfs-test b/test/gvfs-test
index a5b3db4e..991d1ab4 100755
--- a/test/gvfs-test
+++ b/test/gvfs-test
@@ -276,9 +276,9 @@ Subsystem sftp %(sftp_server)s
'sftp_server': sftp_server
})
- self.sshd_log = open('/var/log/sshd.log', 'ab')
self.sshd = subprocess.Popen([os.environ['SSHD'], '-Dde', '-f', self.sshd_config],
- stderr=self.sshd_log)
+ universal_newlines=True,
+ stderr=subprocess.PIPE)
def tearDown(self):
if os.path.exists('.ssh/authorized_keys'):
@@ -287,9 +287,17 @@ Subsystem sftp %(sftp_server)s
if self.sshd.returncode is None:
self.sshd.terminate()
self.sshd.wait()
- self.sshd_log.close()
super().tearDown()
+ def run(self, result=None):
+ '''Show sshd log output on failed tests'''
+
+ if result:
+ orig_err_fail = result.errors + result.failures
+ super().run(result)
+ if result and result.errors + result.failures > orig_err_fail:
+ print('\n----- sshd log -----\n%s\n------\n' % self.sshd.stderr.read())
+
def test_rsa(self):
'''sftp://localhost with RSA authentication'''