Re: [systemd-devel] test-dhcp-client failing in mock builds

2015-02-03 Thread Zbigniew Jędrzejewski-Szmek
On Tue, Feb 03, 2015 at 06:49:21AM +0100, Zbigniew Jędrzejewski-Szmek wrote:
 On Tue, Feb 03, 2015 at 02:42:36AM +0100, Zbigniew Jędrzejewski-Szmek wrote:
  On Mon, Feb 02, 2015 at 08:30:43AM +0100, Jan Synacek wrote:
   http://lists.freedesktop.org/archives/systemd-devel/2014-December/026190.html
  
   I haven't got time to properly analyze the problem since then...
  It sounded familiar ;)
  
  
  On Mon, Feb 02, 2015 at 01:36:29PM +0200, Patrik Flykt wrote:
   Operation not permitted is what is printed for EPERM. But EPERM is not
   present in the client code itself, so I'm inclined towards a permission
   problem somewhere when running mock.
  EPERM is also returned when using /dev/null in epoll_ctl_add.
  I think I fixed it now.
  
  Which leads to a failure on arm in test-network:
  FAIL: test-network
  ==
  Assertion '!address_equal(a1, a2)' failed at 
  ../src/network/test-network.c:161, function test_address_equality(). 
  Aborting.
  
  I got out my chromebook to see what going on here.
 Ha, undefined behaviour on right shift. Gotta love C ;)
 
 So the tests pass in mock on all three primary arches.
 
 I'll let it spin on arm64 just to see what comes up.
And that passes too. 

Zbyszek

___
systemd-devel mailing list
systemd-devel@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/systemd-devel


Re: [systemd-devel] test-dhcp-client failing in mock builds

2015-02-03 Thread Tom Gundersen
On Tue, Feb 3, 2015 at 5:08 PM, Zbigniew Jędrzejewski-Szmek
zbys...@in.waw.pl wrote:
 On Tue, Feb 03, 2015 at 06:49:21AM +0100, Zbigniew Jędrzejewski-Szmek wrote:
 On Tue, Feb 03, 2015 at 02:42:36AM +0100, Zbigniew Jędrzejewski-Szmek wrote:
  On Mon, Feb 02, 2015 at 08:30:43AM +0100, Jan Synacek wrote:
   http://lists.freedesktop.org/archives/systemd-devel/2014-December/026190.html
  
   I haven't got time to properly analyze the problem since then...
  It sounded familiar ;)
 
 
  On Mon, Feb 02, 2015 at 01:36:29PM +0200, Patrik Flykt wrote:
   Operation not permitted is what is printed for EPERM. But EPERM is not
   present in the client code itself, so I'm inclined towards a permission
   problem somewhere when running mock.
  EPERM is also returned when using /dev/null in epoll_ctl_add.
  I think I fixed it now.
 
  Which leads to a failure on arm in test-network:
  FAIL: test-network
  ==
  Assertion '!address_equal(a1, a2)' failed at 
  ../src/network/test-network.c:161, function test_address_equality(). 
  Aborting.
 
  I got out my chromebook to see what going on here.
 Ha, undefined behaviour on right shift. Gotta love C ;)

 So the tests pass in mock on all three primary arches.

 I'll let it spin on arm64 just to see what comes up.
 And that passes too.


Great stuff! Thanks!

-t
___
systemd-devel mailing list
systemd-devel@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/systemd-devel


Re: [systemd-devel] test-dhcp-client failing in mock builds

2015-02-02 Thread Zbigniew Jędrzejewski-Szmek
On Mon, Feb 02, 2015 at 08:30:43AM +0100, Jan Synacek wrote:
 http://lists.freedesktop.org/archives/systemd-devel/2014-December/026190.html

 I haven't got time to properly analyze the problem since then...
It sounded familiar ;)


On Mon, Feb 02, 2015 at 01:36:29PM +0200, Patrik Flykt wrote:
 Operation not permitted is what is printed for EPERM. But EPERM is not
 present in the client code itself, so I'm inclined towards a permission
 problem somewhere when running mock.
EPERM is also returned when using /dev/null in epoll_ctl_add.
I think I fixed it now.

Which leads to a failure on arm in test-network:
FAIL: test-network
==
Assertion '!address_equal(a1, a2)' failed at ../src/network/test-network.c:161, 
function test_address_equality(). Aborting.

I got out my chromebook to see what going on here.

Zbyszek
___
systemd-devel mailing list
systemd-devel@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/systemd-devel


Re: [systemd-devel] test-dhcp-client failing in mock builds

2015-02-02 Thread Patrik Flykt

Hi,

On Sat, 2015-01-31 at 15:48 +0100, Zbigniew Jędrzejewski-Szmek wrote:
 DHCP CLIENT (0xa71f5099): STARTED on ifindex 42
 DHCP CLIENT (0xa71f5099): DISCOVER
 DHCP CLIENT (0xa71f5099): OFFER
 DHCP CLIENT (0xa71f5099): REQUEST (requesting)
 DHCP CLIENT (0xa71f5099): ACK
 DHCP CLIENT (0xa71f5099): lease expires in 9min 58.349975s
 DHCP CLIENT (0xa71f5099): T2 expires in 8min 43.759020s
 DHCP CLIENT (0xa71f5099): T1 expires in 4min 59.245773s

Up until here everything is fine, and the proper messages are sent back
and forth between the client code and the test program which pretends to
be the server in this scenario.

 DHCP CLIENT (0xa71f5099): STOPPED: Operation not permitted

This printout comes from client_stop(sd_dhcp_client *client, int error)
when given a negative error value.

Operation not permitted is what is printed for EPERM. But EPERM is not
present in the client code itself, so I'm inclined towards a permission
problem somewhere when running mock.

In function client_handle_message(), the function call to
client_set_lease_timeouts() is the one printing the T2 and T1 expiration
values. After this function, the first possible call to client_stop()
containing a negative value which that does not log additional strings
beforehand happens in client_initialize_io_events(). This if the io
handler cannot be (re?)set for some reason. It seems there already
exists an io handler at this point, but why it should fail only for mock
is something I don't understand. The test program just worksforme too.

It can't really be the following client_notify(client, notify_event)
call either, as notify_event = 0 or r, where r must have been = 0 to
begin with. If it was client_handle_ack() that returned  0 a little bit
earlier, no T2 and T1 timers would have been set.

With the above I was assuming that the latest version was used and not
an older release.


Cheers,

Patrik

___
systemd-devel mailing list
systemd-devel@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/systemd-devel


Re: [systemd-devel] test-dhcp-client failing in mock builds

2015-02-02 Thread Zbigniew Jędrzejewski-Szmek
On Tue, Feb 03, 2015 at 02:42:36AM +0100, Zbigniew Jędrzejewski-Szmek wrote:
 On Mon, Feb 02, 2015 at 08:30:43AM +0100, Jan Synacek wrote:
  http://lists.freedesktop.org/archives/systemd-devel/2014-December/026190.html
 
  I haven't got time to properly analyze the problem since then...
 It sounded familiar ;)
 
 
 On Mon, Feb 02, 2015 at 01:36:29PM +0200, Patrik Flykt wrote:
  Operation not permitted is what is printed for EPERM. But EPERM is not
  present in the client code itself, so I'm inclined towards a permission
  problem somewhere when running mock.
 EPERM is also returned when using /dev/null in epoll_ctl_add.
 I think I fixed it now.
 
 Which leads to a failure on arm in test-network:
 FAIL: test-network
 ==
 Assertion '!address_equal(a1, a2)' failed at 
 ../src/network/test-network.c:161, function test_address_equality(). Aborting.
 
 I got out my chromebook to see what going on here.
Ha, undefined behaviour on right shift. Gotta love C ;)

So the tests pass in mock on all three primary arches.

I'll let it spin on arm64 just to see what comes up.

Zbyszek
___
systemd-devel mailing list
systemd-devel@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/systemd-devel


Re: [systemd-devel] test-dhcp-client failing in mock builds

2015-02-01 Thread Jan Synacek
Zbigniew Jędrzejewski-Szmek zbys...@in.waw.pl writes:

 Hi,

 I was trying to enable tests in the %check part of systemd rpm.
 Something strange happens which causes test-dhcp-client when building
 in mock:

 FAIL: test-dhcp-client
 ==

http://lists.freedesktop.org/archives/systemd-devel/2014-December/026190.html

I haven't got time to properly analyze the problem since then...

-- 
Jan Synacek
Software Engineer, Red Hat


signature.asc
Description: PGP signature
___
systemd-devel mailing list
systemd-devel@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/systemd-devel


[systemd-devel] test-dhcp-client failing in mock builds

2015-01-31 Thread Zbigniew Jędrzejewski-Szmek
Hi,

I was trying to enable tests in the %check part of systemd rpm.
Something strange happens which causes test-dhcp-client when building
in mock:

FAIL: test-dhcp-client
==

Assertion 'client' failed at ../src/libsystemd-network/sd-dhcp-client.c:141, 
function sd_dhcp_client_set_request_option(). Ignoring.
Assertion 'client' failed at ../src/libsystemd-network/sd-dhcp-client.c:172, 
function sd_dhcp_client_set_request_address(). Ignoring.
Assertion 'client' failed at ../src/libsystemd-network/sd-dhcp-client.c:185, 
function sd_dhcp_client_set_index(). Ignoring.
Assertion 'interface_index  0' failed at 
../src/libsystemd-network/sd-dhcp-client.c:188, function 
sd_dhcp_client_set_index(). Ignoring.
Assertion 'interface_index  0' failed at 
../src/libsystemd-network/sd-dhcp-client.c:188, function 
sd_dhcp_client_set_index(). Ignoring.
Assertion 'interface_index  0' failed at 
../src/libsystemd-network/sd-dhcp-client.c:188, function 
sd_dhcp_client_set_index(). Ignoring.
DHCP CLIENT (0x0): FREE
DHCP CLIENT (0x99188836): STARTED on ifindex 42
DHCP CLIENT (0x99188836): DISCOVER
DHCP CLIENT (0x99188836): STOPPED
DHCP CLIENT (0x0): FREE
DHCP CLIENT (0xa71f5099): STARTED on ifindex 42
DHCP CLIENT (0xa71f5099): DISCOVER
DHCP CLIENT (0xa71f5099): OFFER
DHCP CLIENT (0xa71f5099): REQUEST (requesting)
DHCP CLIENT (0xa71f5099): ACK
DHCP CLIENT (0xa71f5099): lease expires in 9min 58.349975s
DHCP CLIENT (0xa71f5099): T2 expires in 8min 43.759020s
DHCP CLIENT (0xa71f5099): T1 expires in 4min 59.245773s
DHCP CLIENT (0xa71f5099): STOPPED: Operation not permitted
Assertion 'event == DHCP_EVENT_IP_ACQUIRE' failed at 
../src/libsystemd-network/test-dhcp-client.c:374, function 
test_addr_acq_acquired(). Aborting.
* test_request_basic
* test_checksum
* test_discover_message
  recv DHCP Discover 0x99188836
* test_addr_acq
  recv DHCP Discover 0xa71f5099
  sent DHCP Offer
  recv DHCP Request  0xa71f5099
  send DHCP Ack

As you can see, stopping fails with EPERM. But when I run it by hand
in the same build root, it works fine. Could this be some kind of race?
I don't know this part of the code at all, so I'm at loss here.

For comparison, the same binary executed by hand:

# ./test-dhcp-client 
* test_request_basic
Assertion 'client' failed at ../src/libsystemd-network/sd-dhcp-client.c:141, 
function sd_dhcp_client_set_request_option(). Ignoring.
Assertion 'client' failed at ../src/libsystemd-network/sd-dhcp-client.c:172, 
function sd_dhcp_client_set_request_address(). Ignoring.
Assertion 'client' failed at ../src/libsystemd-network/sd-dhcp-client.c:185, 
function sd_dhcp_client_set_index(). Ignoring.
Assertion 'interface_index  0' failed at 
../src/libsystemd-network/sd-dhcp-client.c:188, function 
sd_dhcp_client_set_index(). Ignoring.
Assertion 'interface_index  0' failed at 
../src/libsystemd-network/sd-dhcp-client.c:188, function 
sd_dhcp_client_set_index(). Ignoring.
Assertion 'interface_index  0' failed at 
../src/libsystemd-network/sd-dhcp-client.c:188, function 
sd_dhcp_client_set_index(). Ignoring.
DHCP CLIENT (0x0): FREE
* test_checksum
* test_discover_message
DHCP CLIENT (0x49229752): STARTED on ifindex 42
  recv DHCP Discover 0x49229752
DHCP CLIENT (0x49229752): DISCOVER
DHCP CLIENT (0x49229752): STOPPED
DHCP CLIENT (0x0): FREE
* test_addr_acq
DHCP CLIENT (0x244b510a): STARTED on ifindex 42
  recv DHCP Discover 0x244b510a
  sent DHCP Offer
DHCP CLIENT (0x244b510a): DISCOVER
DHCP CLIENT (0x244b510a): OFFER
  recv DHCP Request  0x244b510a
  send DHCP Ack
DHCP CLIENT (0x244b510a): REQUEST (requesting)
DHCP CLIENT (0x244b510a): ACK
DHCP CLIENT (0x244b510a): lease expires in 9min 57.257940s
DHCP CLIENT (0x244b510a): T2 expires in 8min 42.525380s
DHCP CLIENT (0x244b510a): T1 expires in 5min 231.299ms
  DHCP address acquired
DHCP CLIENT (0x244b510a): STOPPED
DHCP CLIENT (0x0): FREE

Zbyszek
___
systemd-devel mailing list
systemd-devel@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/systemd-devel