summaryrefslogtreecommitdiff
path: root/src/libsystemd-network/test-ipv4ll.c
diff options
context:
space:
mode:
authorTom Gundersen <teg@jklm.no>2015-08-21 12:50:31 +0200
committerTom Gundersen <teg@jklm.no>2015-09-18 15:14:43 +0200
commite3dca0089b7b50e2ec21409d1292727921d06102 (patch)
tree7b437df24b2d8b3c5f4fcf215729efdd15eb656e /src/libsystemd-network/test-ipv4ll.c
parent6af9144f5ff65cb9f6ae9999e7e0a9edc4841b2b (diff)
sd-ipv4acd: introduce new library split out from sd-ipv4ll
This splits the Address Conflict Detection out of the Link Local library so that we can reuse it for DHCP and static addresses in the future. Implements RFC5227.
Diffstat (limited to 'src/libsystemd-network/test-ipv4ll.c')
-rw-r--r--src/libsystemd-network/test-ipv4ll.c11
1 files changed, 8 insertions, 3 deletions
diff --git a/src/libsystemd-network/test-ipv4ll.c b/src/libsystemd-network/test-ipv4ll.c
index 55ec2f3972..f0e26bda07 100644
--- a/src/libsystemd-network/test-ipv4ll.c
+++ b/src/libsystemd-network/test-ipv4ll.c
@@ -118,9 +118,8 @@ static void test_public_api_setters(sd_event *e) {
assert_se(sd_ipv4ll_set_callback(NULL, NULL, NULL) == -EINVAL);
assert_se(sd_ipv4ll_set_callback(ll, NULL, NULL) == 0);
- assert_se(sd_ipv4ll_set_address_seed(NULL, NULL) == -EINVAL);
- assert_se(sd_ipv4ll_set_address_seed(ll, NULL) == -EINVAL);
- assert_se(sd_ipv4ll_set_address_seed(ll, seed) == 0);
+ assert_se(sd_ipv4ll_set_address_seed(NULL, *(unsigned *) seed) == -EINVAL);
+ assert_se(sd_ipv4ll_set_address_seed(ll, *(unsigned *) seed) == 0);
assert_se(sd_ipv4ll_set_mac(NULL, NULL) == -EINVAL);
assert_se(sd_ipv4ll_set_mac(ll, NULL) == -EINVAL);
@@ -168,6 +167,8 @@ static void test_basic_request(sd_event *e) {
sd_event_run(e, (uint64_t) -1);
assert_se(sd_ipv4ll_start(ll) == -EBUSY);
+ assert_se(sd_ipv4ll_is_running(ll));
+
/* PROBE */
sd_event_run(e, (uint64_t) -1);
assert_se(read(test_fd[1], &arp, sizeof(struct ether_arp)) == sizeof(struct ether_arp));
@@ -196,6 +197,10 @@ static void test_basic_request(sd_event *e) {
int main(int argc, char *argv[]) {
_cleanup_event_unref_ sd_event *e = NULL;
+ log_set_max_level(LOG_DEBUG);
+ log_parse_environment();
+ log_open();
+
assert_se(sd_event_new(&e) >= 0);
test_public_api_setters(e);