summaryrefslogtreecommitdiff
path: root/src/libsystemd-network/test-dhcp-server.c
diff options
context:
space:
mode:
authorTom Gundersen <teg@jklm.no>2014-05-24 19:27:20 +0200
committerTom Gundersen <teg@jklm.no>2014-06-13 16:53:13 +0200
commitff734080aa02cd70b13bc0fdeec4a5886166163a (patch)
tree5a9bbea68d09df0ce04719d27ca4dc37b376d3be /src/libsystemd-network/test-dhcp-server.c
parentb44cd8821087f2afebf85fec5b588f5720a9415c (diff)
sd-dhcp-server: add basic functionality for starting/stopping server
Bind to UDP socket and listen for messages, discarding anything we receive.
Diffstat (limited to 'src/libsystemd-network/test-dhcp-server.c')
-rw-r--r--src/libsystemd-network/test-dhcp-server.c6
1 files changed, 6 insertions, 0 deletions
diff --git a/src/libsystemd-network/test-dhcp-server.c b/src/libsystemd-network/test-dhcp-server.c
index bd0913d51c..80d2184b70 100644
--- a/src/libsystemd-network/test-dhcp-server.c
+++ b/src/libsystemd-network/test-dhcp-server.c
@@ -45,6 +45,12 @@ static void test_basic(sd_event *event) {
assert_se(sd_dhcp_server_ref(server) == server);
assert_se(!sd_dhcp_server_unref(server));
+
+ assert_se(sd_dhcp_server_start(server) >= 0);
+ assert_se(sd_dhcp_server_start(server) == -EBUSY);
+ assert_se(sd_dhcp_server_stop(server) >= 0);
+ assert_se(sd_dhcp_server_stop(server) >= 0);
+ assert_se(sd_dhcp_server_start(server) >= 0);
}
int main(int argc, char *argv[]) {