hwsim: enable dbus test

Message ID 1496736809-701-1-git-send-email-lizhijian@cn.fujitsu.com
State Accepted
Headers show

Commit Message

Li Zhijian June 6, 2017, 8:13 a.m.
not all distro contains /var/run/dbus/pid, debian for example:
dbus-daemon start with nopidfile
root@debian9:/home/lizhijian/chroot_clean/tmp/build-hwsim/hostap/tests/hwsim# ps aux |grep dbus
message+   598  0.0  0.1  46068  4836 ?        Ss   15:46   0:00 /usr/bin/dbus-daemon --system --address=systemd: --nofork --nopidfile --systemd-activation
Debian-+   656  0.0  0.0  45220  3924 ?        Ss   15:46   0:00 /usr/bin/dbus-daemon --session --address=systemd: --nofork --nopidfile --systemd-activation

Signed-off-by: Li Zhijian <lizhijian@cn.fujitsu.com>
Signed-off-by: Xiaodong Jia <jiaxd-fnst@cn.fujitsu.com>
---
 tests/hwsim/start.sh | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

Comments

Jouni Malinen Sept. 10, 2017, 7:50 p.m. | #1
On Tue, Jun 06, 2017 at 04:13:29PM +0800, Li Zhijian wrote:
> not all distro contains /var/run/dbus/pid, debian for example:
> dbus-daemon start with nopidfile
> root@debian9:/home/lizhijian/chroot_clean/tmp/build-hwsim/hostap/tests/hwsim# ps aux |grep dbus
> message+   598  0.0  0.1  46068  4836 ?        Ss   15:46   0:00 /usr/bin/dbus-daemon --system --address=systemd: --nofork --nopidfile --systemd-activation
> Debian-+   656  0.0  0.0  45220  3924 ?        Ss   15:46   0:00 /usr/bin/dbus-daemon --session --address=systemd: --nofork --nopidfile --systemd-activation

Thanks, applied.

Patch

diff --git a/tests/hwsim/start.sh b/tests/hwsim/start.sh
index cee9239..dce65ba 100755
--- a/tests/hwsim/start.sh
+++ b/tests/hwsim/start.sh
@@ -107,7 +107,7 @@  sudo ifconfig hwsim0 up
 sudo $WLANTEST -i hwsim0 -n $LOGDIR/hwsim0.pcapng -c -dtN -L $LOGDIR/hwsim0 &
 for i in 0 1 2; do
     DBUSARG=""
-    if [ $i = "0" -a -r /var/run/dbus/pid -a -r /var/run/dbus/hwsim-test ]; then
+    if [ $i = "0" ] && ([ -r /var/run/dbus/pid ] || [ -r /var/run/dbus/system_bus_socket ]); then
 	if $WPAS | grep -q -- -u; then
 	    DBUSARG="-u"
 	fi