summaryrefslogtreecommitdiff
path: root/src/test
diff options
context:
space:
mode:
authorSusant Sahani <susant@redhat.com>2014-04-03 13:35:56 +0530
committerTom Gundersen <teg@jklm.no>2014-04-03 18:09:24 +0200
commit0a827d105de9d3d502f22e77fb3ff83da479c2e7 (patch)
treecb85f7fac958dd4f3625531eedc2a739a7b8099b /src/test
parentaba496a58acf9d9c61314de71353550e579f85ee (diff)
sd-rtnl: fix broken test cases and add support for tunnel
This patch fixes the broken test-cases for sd-rtnl and add support for ipip and sit tunnel. [tomegun: minor fixups]
Diffstat (limited to 'src/test')
-rw-r--r--src/test/test-rtnl-manual.c10
1 files changed, 4 insertions, 6 deletions
diff --git a/src/test/test-rtnl-manual.c b/src/test/test-rtnl-manual.c
index e76fb81a66..c8133dbad7 100644
--- a/src/test/test-rtnl-manual.c
+++ b/src/test/test-rtnl-manual.c
@@ -84,13 +84,12 @@ static int test_tunnel_configure(sd_rtnl *rtnl) {
assert_se(sd_rtnl_message_new_link(rtnl, &m, RTM_NEWLINK, 0) >= 0);
assert_se(m);
- assert_se(sd_rtnl_message_append_string(m, IFLA_IFNAME, "eth0") >= 0);
+ assert_se(sd_rtnl_message_append_string(m, IFLA_IFNAME, "ipip-tunnel") >= 0);
assert_se(sd_rtnl_message_append_u32(m, IFLA_MTU, 1234)>= 0);
assert_se(sd_rtnl_message_open_container(m, IFLA_LINKINFO) >= 0);
- assert_se(sd_rtnl_message_append_string(m, IFLA_INFO_KIND, "ipip") >= 0);
- assert_se(sd_rtnl_message_open_container(m, IFLA_INFO_DATA) >= 0);
+ assert_se(sd_rtnl_message_open_container_union(m, IFLA_INFO_DATA, "ipip") >= 0);
inet_pton(AF_INET, "192.168.21.1", &local.s_addr);
assert_se(sd_rtnl_message_append_u32(m, IFLA_IPTUN_LOCAL, local.s_addr) >= 0);
@@ -113,13 +112,12 @@ static int test_tunnel_configure(sd_rtnl *rtnl) {
assert_se(sd_rtnl_message_new_link(rtnl, &n, RTM_NEWLINK, 0) >= 0);
assert_se(n);
- assert_se(sd_rtnl_message_append_string(n, IFLA_IFNAME, "eth1") >= 0);
+ assert_se(sd_rtnl_message_append_string(n, IFLA_IFNAME, "sit-tunnel") >= 0);
assert_se(sd_rtnl_message_append_u32(n, IFLA_MTU, 1234)>= 0);
assert_se(sd_rtnl_message_open_container(n, IFLA_LINKINFO) >= 0);
- assert_se(sd_rtnl_message_append_string(n, IFLA_INFO_KIND, "sit") >= 0);
- assert_se(sd_rtnl_message_open_container(n, IFLA_INFO_DATA) >= 0);
+ assert_se(sd_rtnl_message_open_container_union(n, IFLA_INFO_DATA, "sit") >= 0);
assert_se(sd_rtnl_message_append_u8(n, IFLA_IPTUN_PROTO, IPPROTO_IPIP) >= 0);