Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Kea
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
451
Issues
451
List
Boards
Labels
Service Desk
Milestones
Merge Requests
74
Merge Requests
74
Operations
Operations
Incidents
Packages & Registries
Packages & Registries
Container Registry
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
ISC Open Source Projects
Kea
Commits
43a491c5
Commit
43a491c5
authored
Aug 10, 2018
by
Tomek Mrugalski
🛰
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
[gitlab9] Skeleton unit-tests for kea-netconf implemented.
parent
3aae164d
Changes
3
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
39 additions
and
11 deletions
+39
-11
src/bin/netconf/tests/Makefile.am
src/bin/netconf/tests/Makefile.am
+4
-2
src/bin/netconf/tests/netconf_env_unittest.cc
src/bin/netconf/tests/netconf_env_unittest.cc
+32
-0
src/bin/netconf/tests/run_unittests.cc
src/bin/netconf/tests/run_unittests.cc
+3
-9
No files found.
src/bin/netconf/tests/Makefile.am
View file @
43a491c5
...
...
@@ -30,7 +30,8 @@ if HAVE_GTEST
TESTS
+=
netconf_unittests
netconf_unittests_SOURCES
=
netconf_unittest.cc
netconf_unittests_SOURCES
=
run_unittests.cc
netconf_unittests_SOURCES
+=
netconf_env_unittest.cc
netconf_unittests_CPPFLAGS
=
$(AM_CPPFLAGS)
$(GTEST_INCLUDES)
netconf_unittests_LDFLAGS
=
$(AM_LDFLAGS)
$(CRYPTO_LDFLAGS)
...
...
@@ -52,12 +53,13 @@ netconf_unittests_LDADD = $(top_builddir)/src/bin/netconf/libnetconf.la
#netconf_unittests_LDADD += $(top_builddir)/src/lib/dns/libkea-dns++.la
#netconf_unittests_LDADD += $(top_builddir)/src/lib/cryptolink/libkea-cryptolink.la
#netconf_unittests_LDADD += $(top_builddir)/src/lib/hooks/libkea-hooks.la
netconf_unittests_LDADD
+=
$(top_builddir)
/src/lib/util/unittests/libutil_unittests.la
netconf_unittests_LDADD
+=
$(top_builddir)
/src/lib/log/libkea-log.la
netconf_unittests_LDADD
+=
$(top_builddir)
/src/lib/util/threads/libkea-threads.la
netconf_unittests_LDADD
+=
$(top_builddir)
/src/lib/util/libkea-util.la
netconf_unittests_LDADD
+=
$(top_builddir)
/src/lib/exceptions/libkea-exceptions.la
netconf_unittests_LDADD
+=
$(LOG4CPLUS_LIBS)
$(CRYPTO_LIBS)
netconf_unittests_LDADD
+=
$(BOOST_LIBS)
$(GTEST_LDADD)
netconf_unittests_LDADD
+=
$(BOOST_LIBS)
$(GTEST_LDADD)
$(SYSREPO_LIBS)
endif
noinst_EXTRA_DIST
=
configs-list.txt
...
...
src/bin/netconf/tests/netconf_env_unittest.cc
0 → 100644
View file @
43a491c5
// Copyright (C) 2018 Internet Systems Consortium, Inc. ("ISC")
//
// This Source Code Form is subject to the terms of the Mozilla Public
// License, v. 2.0. If a copy of the MPL was not distributed with this
// file, You can obtain one at http://mozilla.org/MPL/2.0/.
/// @brief Basic environment tests for netconf
#include <sysrepo-cpp/Session.h>
#include <gtest/gtest.h>
class
NetconfTest
:
public
::
testing
::
Test
{
public:
NetconfTest
()
{}
};
// This test checks if a session to sysrepo can be established.
// It uses sysrepo code directly, so it's a sanity check for the
// environment. Doesn't test any Kea code.
TEST_F
(
NetconfTest
,
environmentSanity
)
{
S_Connection
conn
;
ASSERT_NO_THROW
(
conn
.
reset
(
new
Connection
(
"kea-netconf"
)));
S_Session
sess
;
ASSERT_NO_THROW
(
sess
.
reset
(
new
Session
(
conn
)));
}
src/bin/netconf/tests/run_unittests.cc
View file @
43a491c5
...
...
@@ -6,21 +6,15 @@
#include <config.h>
#include <log/logger_support.h>
#include <dhcp4/dhcp4_log.h>
#include <gtest/gtest.h>
#include <util/unittests/run_all.h>
#include <log/logger_support.h>
int
main
(
int
argc
,
char
*
argv
[])
{
::
testing
::
InitGoogleTest
(
&
argc
,
argv
);
// See the documentation of the KEA_* environment variables in
// src/lib/log/README for info on how to tweak logging
isc
::
log
::
initLogger
();
setenv
(
"KEA_PIDFILE_DIR"
,
TEST_DATA_BUILDDIR
,
1
);
int
result
=
RUN_ALL_TESTS
();
return
(
result
);
return
(
isc
::
util
::
unittests
::
run_all
());
}
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment