test-rtnl.c revision 12e0f830f592ec4c6bb49ac7ae1e0e84f74105e3
/*-*- 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 "util.h"
#include "macro.h"
#include "sd-rtnl.h"
#include "socket-util.h"
#include "rtnl-util.h"
#include "event-util.h"
#include "missing.h"
unsigned int mtu = 1450;
void *data;
/* we'd really like to test NEWLINK, but let's not mess with the running kernel */
}
sd_rtnl_message *m;
sd_rtnl_message *r;
unsigned int mtu = 1500;
unsigned int *mtu_reply;
void *data;
assert_se(m);
/* u8 test cases */
/* u32 test cases */
/* u8 read back */
/* u32 read back */
switch (type) {
// case IFLA_MTU:
// assert_se(*(unsigned int *) data == 65536);
// break;
// case IFLA_QDISC:
// assert_se(streq((char *) data, "noqueue"));
// break;
case IFLA_IFNAME:
break;
}
}
}
static void test_route(void) {
void *data;
int r;
if (r < 0) {
return;
}
if (r < 0) {
return;
}
if (r < 0) {
return;
}
}
static void test_multiple(void) {
}
void *data;
assert_se(m);
switch (type) {
// case IFLA_MTU:
// assert_se(*(unsigned int *) data == 65536);
// break;
// case IFLA_QDISC:
// assert_se(streq((char *) data, "noqueue"));
// break;
case IFLA_IFNAME:
break;
}
}
return 1;
}
static void test_event_loop(int ifindex) {
char *ifname;
}
(*counter) --;
return sd_rtnl_message_get_errno(m);
}
static void test_async(int ifindex) {
char *ifname;
}
int counter = 0;
counter ++;
counter ++;
while (counter > 0) {
}
}
static void test_container(void) {
void *data;
assert_se(sd_rtnl_message_close_container(m) >= 0);
assert_se(sd_rtnl_message_close_container(m) >= 0);
assert_se(sd_rtnl_message_exit_container(m) >= 0);
assert_se(sd_rtnl_message_exit_container(m) >= 0);
}
static void test_match(void) {
}
int main(void) {
sd_rtnl_message *m;
sd_rtnl_message *r;
void *data;
int if_loopback;
test_match();
test_route();
assert_se(if_loopback > 0);
assert_se(m);
return EXIT_SUCCESS;
}