Build of 1.4 fails "make test"

Asked by J Gooch on 2014-07-25

Hi,

I've been knife-and-forking my way through a build of Mosquitto 1.4, so I can get websockets support and I've hit a problem that I don't really know how to address.

I've got as far as "make" completing successfully but I'm getting the following error on "make test":-

jeremy@jeremy-laptop ~/src/mosquitto $ make test
set -e; for d in lib client src; do make -C ${d}; done
make[1]: Entering directory `/home/jeremy/src/mosquitto/lib'
make -C cpp
make[2]: Entering directory `/home/jeremy/src/mosquitto/lib/cpp'
make[2]: Nothing to be done for `all'.
make[2]: Leaving directory `/home/jeremy/src/mosquitto/lib/cpp'
make[1]: Leaving directory `/home/jeremy/src/mosquitto/lib'
make[1]: Entering directory `/home/jeremy/src/mosquitto/client'
make[1]: Nothing to be done for `all'.
make[1]: Leaving directory `/home/jeremy/src/mosquitto/client'
make[1]: Entering directory `/home/jeremy/src/mosquitto/src'
make[1]: Nothing to be done for `all'.
make[1]: Leaving directory `/home/jeremy/src/mosquitto/src'
make -C test test
make[1]: Entering directory `/home/jeremy/src/mosquitto/test'
make -C broker test
make[2]: Entering directory `/home/jeremy/src/mosquitto/test/broker'
make -C c
make[3]: Entering directory `/home/jeremy/src/mosquitto/test/broker/c'
cc -I../../../lib -I../../../src -Wall -Werror -fPIC -shared auth_plugin.c -o auth_plugin.so
cc -I../../../lib -I../../../src -Wall -Werror 08-tls-psk-pub.c -o 08-tls-psk-pub.test ../../../lib/libmosquitto.so.1
cc -I../../../lib -I../../../src -Wall -Werror 08-tls-psk-bridge.c -o 08-tls-psk-bridge.test ../../../lib/libmosquitto.so.1
make[3]: Leaving directory `/home/jeremy/src/mosquitto/test/broker/c'
./01-connect-success.py
Traceback (most recent call last):
  File "./01-connect-success.py", line 25, in <module>
    broker = mosq_test.start_broker(filename=os.path.basename(__file__), cmd=cmd)
  File "/home/jeremy/src/mosquitto/test/mosq_test.py", line 30, in start_broker
    raise IOError
IOError
make[2]: *** [01] Error 1
make[2]: Leaving directory `/home/jeremy/src/mosquitto/test/broker'
make[1]: *** [test] Error 2
make[1]: Leaving directory `/home/jeremy/src/mosquitto/test'
make: *** [test] Error 2

What's the best strategy to work out what I'm missing?

Thanks,

Jeremy.

Question information

Language:
English Edit question
Status:
Solved
For:
mosquitto Edit question
Assignee:
No assignee Edit question
Solved by:
Roger Light
Solved:
2014-08-01
Last query:
2014-08-01
Last reply:
2014-07-28
Best Roger Light (roger.light) said : #1

Hi,

It is failing on the very first, very simple, test so it seems likely
that it is something to do with the test failing, not the test itself
failing if you see what I mean.

The "start_broker" function mentioned starts the broker, then attempts
to open a socket connection to the broker to ensure that it is ready
for the next part of the test. It will try to make this connection 20
times, with a delay of 0.1 seconds between each attempt. If your
machine takes more than 2 seconds to start the broker for some reason,
this would explain it - although it's pretty unlikely.

The first thing that you can do is to try run the broker yourself.
Doing the below will reproduce what the first test does

cd test/broker
../../src/mosquitto -p 1888

If that seems to work, try subscribing to be sure:

mosquitto_sub -t '$SYS/#' -v -p 1888

You should get a load of information about the broker state.

When starting the broker for the tests, the connections are actually
made to "localhost", does your test machine support IPv4 and does it
correctly resolve localhost?

J Gooch (goochjs) said : #2

Thanks for the reply.

I ran the command to start the test broker and it instantly told me that it couldn't find the libwebsockets shared library. It transpired that my websockets build had put the library into /usr/local/lib64, which wasn't part of my library path. A quick update to /etc/ld.so.conf.d and a quick "sudo ldconfig" and the test broker came straight up.

J Gooch (goochjs) said : #3

Thanks Roger Light, that solved my question.

Roger Light (roger.light) said : #4

Great, I'm glad it's working now.

On Fri, Aug 1, 2014 at 8:56 AM, J Gooch
<email address hidden> wrote:
> Question #252173 on mosquitto changed:
> https://answers.launchpad.net/mosquitto/+question/252173
>
> Status: Answered => Solved
>
> J Gooch confirmed that the question is solved:
> Thanks for the reply.
>
> I ran the command to start the test broker and it instantly told me that
> it couldn't find the libwebsockets shared library. It transpired that
> my websockets build had put the library into /usr/local/lib64, which
> wasn't part of my library path. A quick update to /etc/ld.so.conf.d and
> a quick "sudo ldconfig" and the test broker came straight up.
>
> --
> You received this question notification because you are a member of
> Mosquitto PPA, which is an answer contact for mosquitto.

J Gooch (goochjs) said : #5

For posterity, I've recorded my build instructions here -> http://www.goochgooch.co.uk/2014/08/01/building-mosquitto-1-4/