test-network.c revision 5347925a59530bd4e6616eb8c8d43a02c3e14c46
/*-*- Mode: C; c-basic-offset: 8; indent-tabs-mode: nil -*-*/
/***
This file is part of systemd.
Copyright 2013 Tom Gundersen <teg@jklm.no>
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 "networkd.h"
#include "network-internal.h"
#include "dhcp-lease-internal.h"
static void test_deserialize_in_addr(void) {
struct in_addr a, b, c;
struct in6_addr d, e, f;
const char *addresses_string = "192.168.0.1 0:0:0:0:0:FFFF:204.152.189.116 192.168.0.2 ::1 192.168.0.3 1:0:0:0:0:0:0:8";
}
static void test_deserialize_dhcp_routes(void) {
{
}
{
/* no errors */
const char *routes_string = "192.168.0.0/16,192.168.0.1 10.1.2.0/24,10.1.2.1 0.0.0.0/0,10.0.1.1";
}
{
/* error in second word */
const char *routes_string = "192.168.0.0/16,192.168.0.1 10.1.2.0#24,10.1.2.1 0.0.0.0/0,10.0.1.1";
}
{
/* error in every word */
const char *routes_string = "192.168.0.0/55,192.168.0.1 10.1.2.0#24,10.1.2.1 0.0.0.0/0,10.0.1.X";
}
}
int r;
/* TODO: should_reload, is false if the config dirs do not exist, so
* so we can't do this test here, move it to a test for paths_check_timestamps
* directly
*
* assert_se(network_should_reload(manager) == true);
*/
r = manager_load_config(manager);
if (r == -EPERM)
return r;
assert_se(r >= 0);
return 0;
}
const struct ether_addr mac = {};
/* let's assume that the test machine does not have a .network file
that applies to the loopback device... */
}
static void test_address_equality(void) {
}
int main(void) {
struct udev_device *loopback;
int r;
r = test_load_config(manager);
if (r == -EPERM)
return EXIT_TEST_SKIP;
}