areguera / rpms / cockpit

Forked from rpms/cockpit 5 years ago
Clone

Blame SOURCES/0001-test-Fix-test-dbus-to-work-without-a-system-bus-7952.patch

466fe4
From 5887cf5b5d0cded422b883052d4a8c3cf5d5f5fa Mon Sep 17 00:00:00 2001
466fe4
From: Martin Pitt <martinpitt@users.noreply.github.com>
466fe4
Date: Tue, 24 Oct 2017 21:13:07 +0200
466fe4
Subject: [PATCH 1/6] test: Fix test-dbus to work without a system bus (#7952)
466fe4
466fe4
The last test in `TESTS=dist/base1/test-dbus` hangs eternally if there
466fe4
is no system D-Bus running:
466fe4
466fe4
```
466fe4
PASS: dist/base1/test-dbus.html 187 - receive writable fd: fd received and not writable
466fe4
cockpit-bridge-Message: 1:58: Could not connect: No such file or directory
466fe4
cockpit-bridge-Message: 1:60: (null)
466fe4
cockpit-bridge-Message: 1:59: Could not connect: No such file or directory
466fe4
cockpit-bridge-Message: 1:61: Could not connect: No such file or directory
466fe4
Could not connect: No such file or directory
466fe4
(null)
466fe4
Could not connect: No such file or directory
466fe4
Could not connect: No such file or directory
466fe4
```
466fe4
466fe4
This happens when running tests in mock or in a docker container.
466fe4
466fe4
Use the session bus to avoid this and make fewer assumptions about the
466fe4
host system.
466fe4
466fe4
Closes #7952
466fe4
---
466fe4
 src/base1/test-dbus.js | 8 ++++----
466fe4
 1 file changed, 4 insertions(+), 4 deletions(-)
466fe4
466fe4
diff --git a/src/base1/test-dbus.js b/src/base1/test-dbus.js
466fe4
index a3f42e3..cf04ed5 100644
466fe4
--- a/src/base1/test-dbus.js
466fe4
+++ b/src/base1/test-dbus.js
466fe4
@@ -705,10 +705,10 @@ QUnit.asyncTest("internal dbus bus none with address", function() {
466fe4
 QUnit.asyncTest("separate dbus connections for channel groups", function() {
466fe4
     assert.expect(4);
466fe4
 
466fe4
-    var channel1 = cockpit.channel({ payload: 'dbus-json3', group: 'foo' });
466fe4
-    var channel2 = cockpit.channel({ payload: 'dbus-json3', group: 'bar' });
466fe4
-    var channel3 = cockpit.channel({ payload: 'dbus-json3', group: 'foo' });
466fe4
-    var channel4 = cockpit.channel({ payload: 'dbus-json3', group: 'baz' });
466fe4
+    var channel1 = cockpit.channel({ payload: 'dbus-json3', group: 'foo', bus: 'session' });
466fe4
+    var channel2 = cockpit.channel({ payload: 'dbus-json3', group: 'bar', bus: 'session' });
466fe4
+    var channel3 = cockpit.channel({ payload: 'dbus-json3', group: 'foo', bus: 'session' });
466fe4
+    var channel4 = cockpit.channel({ payload: 'dbus-json3', group: 'baz', bus: 'session' });
466fe4
 
466fe4
     cockpit.all([
466fe4
         channel1.wait(), channel2.wait(), channel3.wait(), channel4.wait()
466fe4
-- 
466fe4
2.14.3
466fe4