/***
This file is part of systemd.
Copyright (C) 2013 Intel Corporation. All rights reserved.
Copyright (C) 2014 Tom Gundersen
under the terms of the GNU Lesser General Public License as published by
the Free Software Foundation; either version 2.1 of the License, or
(at your option) any later version.
systemd is distributed in the hope that it will be useful, but
WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
Lesser General Public License for more details.
You should have received a copy of the GNU Lesser General Public License
along with systemd; If not, see <http://www.gnu.org/licenses/>.
***/
#include <errno.h>
#include "sd-dhcp-server.h"
#include "sd-event.h"
#include "dhcp-server-internal.h"
}
};
};
int r;
/* attach to loopback interface */
r = sd_dhcp_server_start(server);
if (r == -EPERM)
return EXIT_TEST_SKIP;
assert_se(r >= 0);
return 0;
}
static void test_message_handler(void) {
struct {
struct {
struct {
struct {
struct {
};
};
/* TODO, shouldn't this fail? */
}
}
static void test_client_id_hash(void) {
DHCPClientId a = {
.length = 4,
}, b = {
.length = 4,
};
'0', '1', '2', '3', '4', '5', '6', '7',
'8', '9', 'A', 'B', 'C', 'D', 'E', 'F',
};
assert_se(client_id_compare_func(&a, &b) == 0);
a.length = 3;
assert_se(client_id_compare_func(&a, &b) != 0);
a.length = 4;
assert_se(client_id_compare_func(&a, &b) == 0);
b.length = 3;
assert_se(client_id_compare_func(&a, &b) != 0);
b.length = 4;
assert_se(client_id_compare_func(&a, &b) == 0);
assert_se(client_id_compare_func(&a, &b) != 0);
}
int r;
log_open();
assert_se(sd_event_new(&e) >= 0);
r = test_basic(e);
if (r != 0)
return r;
return 0;
}