guelfey / go.dbus

Native Go bindings for D-Bus
BSD 2-Clause "Simplified" License
124 stars 42 forks source link

When call NetworkManager there has an failed with "unexpected EOF" #42

Closed snyh closed 10 years ago

snyh commented 10 years ago

test with this

package dbus

import "testing"

func TestNM(t *testing.T) {
        s, _ := SystemBus()
        var paths []ObjectPath
        s.Object("org.freedesktop.NetworkManager", "/org/freedesktop/NetworkManager/Settings").Call("org.freedesktop.NetworkManager.Settings.ListConnections", 0).Store(&paths)

        for _, p := range paths {
                o := s.Object("org.freedesktop.NetworkManager", p)
                c := o.Call("org.freedesktop.NetworkManager.Settings.Connection.GetSettings", 0)
                if c.Err != nil {
                        t.Error(c.Err)
                }
        }
}

I can sure whether everyone will failed , but dbus-send or d-feet call this method will be ok. (and I have 12 connections, two of them is ok, and others is failed)

If you can't find an failed, you can try create more new connections with nm-connection-editor.

--- FAIL: TestNM (0.00 seconds) nm_test.go:14: dbus: wire format error: unexpected EOF