default tcp host

Havoc Pennington hp at
Thu Jun 14 08:18:21 PDT 2007


Daniel P. Berrange wrote:
> We could explicitly call gethostname() to retrieve the local hosts'
> primary name & put that into the address in the INADDR_ANY scenario
> which is basically what X does for DISPLAY env IIRC.

That sounds fine to me. If you want to make this change and anything 
else outstanding, I'll try to have a look at the patch later.

You're right that there are no real tests for TCP, and there also aren't 
really tests for the ANONYMOUS support I added (well, the dbus-auth.c 
part has unit tests, but there are no tests that use the whole 
connection->transport->auth conglomerate).

To test the basics we could probably do a test daemon that listens on 
localhost and connects to itself, similar in spirit to all the gunge in 
bus/dispatch.c, or perhaps we could even just extend dispatch.c to use a 
localhost tcp in addition to the "debug pipe" thing. Another approach is 
a "client-driven" test as in test-name etc. in the test/ dir, where we 
start up a test daemon and have a client do various things to it.

It's also possible to do the "mock" thing where you factor out an 
interface depended on by the thing you want to test, and write a stub 
implementation of the interface for test purposes.

In the end though there just isn't a lot of test coverage right now for 
the stuff that strongly depends on the environment we run in (password 
db, DNS, etc.)


More information about the dbus mailing list