summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorThomas Haller <thaller@redhat.com>2016-03-01 13:45:51 +0100
committerThomas Haller <thaller@redhat.com>2016-03-01 13:50:16 +0100
commit98d14b0c1563551f0ab51344560cfb3a31aa7cea (patch)
treeeaddc68ba4bea8e1ddce1067cbe773be82d58b08
parente0abe36ae76f01ca4f80fbe69158f26ba3b560bf (diff)
downloadNetworkManager-98d14b0c1563551f0ab51344560cfb3a31aa7cea.tar.gz
systemd/tests: add test_lldp_create() test
This test makes sense because "test-systemd" is not linked against any other systemd library. So this test verifies that our libsystemd clone is self contained.
-rw-r--r--src/tests/test-systemd.c18
1 files changed, 18 insertions, 0 deletions
diff --git a/src/tests/test-systemd.c b/src/tests/test-systemd.c
index 84ad95ba86..557a631a40 100644
--- a/src/tests/test-systemd.c
+++ b/src/tests/test-systemd.c
@@ -20,6 +20,7 @@
#include "nm-default.h"
#include "sd-dhcp-client.h"
+#include "sd-lldp.h"
#include "nm-test-utils.h"
@@ -40,6 +41,22 @@ test_dhcp_create (void)
/*****************************************************************************/
+static void
+test_lldp_create (void)
+{
+ sd_lldp *lldp = NULL;
+ int ifindex = 1;
+ int r;
+
+ r = sd_lldp_new (ifindex, "lo", (struct ether_addr *) ((guint8[]) { 0x01, 0x02, 0x03, 0x04, 0x05, 0x06 }), &lldp);
+ g_assert (r == 0);
+ g_assert (lldp);
+
+ sd_lldp_unref (lldp);
+}
+
+/*****************************************************************************/
+
NMTST_DEFINE ();
int
@@ -48,6 +65,7 @@ main (int argc, char **argv)
nmtst_init_assert_logging (&argc, &argv, "INFO", "ALL");
g_test_add_func ("/systemd/dhcp/create", test_dhcp_create);
+ g_test_add_func ("/systemd/lldp/create", test_lldp_create);
return g_test_run ();
}