diff mbox series

[1/2] tests: Skip busctl tests when not available

Message ID 20200625202202.93564-1-briannorris@chromium.org
State Accepted
Headers show
Series [1/2] tests: Skip busctl tests when not available | expand

Commit Message

Brian Norris June 25, 2020, 8:22 p.m. UTC
Signed-off-by: Brian Norris <briannorris@chromium.org>
---
 tests/hwsim/test_dbus.py | 3 +++
 1 file changed, 3 insertions(+)

Comments

Jouni Malinen Oct. 10, 2020, 6:49 p.m. UTC | #1
Thanks, both patches applied.
diff mbox series

Patch

diff --git a/tests/hwsim/test_dbus.py b/tests/hwsim/test_dbus.py
index e9d6b9e39c25..60de49d1da19 100644
--- a/tests/hwsim/test_dbus.py
+++ b/tests/hwsim/test_dbus.py
@@ -9,6 +9,7 @@  import logging
 logger = logging.getLogger()
 import subprocess
 import time
+import shutil
 import struct
 import sys
 
@@ -5355,6 +5356,8 @@  def test_dbus_introspect(dev, apdev):
             raise Exception("Unexpected Introspect response")
 
 def run_busctl(service, obj):
+    if not shutil.which("busctl"):
+        raise HwsimSkip("No busctl available")
     logger.info("busctl introspect %s %s" % (service, obj))
     cmd = subprocess.Popen(['busctl', 'introspect', service, obj],
                            stdout=subprocess.PIPE,