summaryrefslogtreecommitdiff
path: root/tests
diff options
context:
space:
mode:
authorGuido Günther <agx@sigxcpu.org>2016-06-29 22:15:55 +0200
committerGuido Günther <agx@sigxcpu.org>2016-06-29 22:15:55 +0200
commitd868829014edd94a3d0cdd1c1fb195570324281f (patch)
tree06bed4934e8efa09c0a25eb601633983d36892ac /tests
parent4df550174668611d8cb3fcb571656aefb23caba9 (diff)
New upstream version 2.0.0~rc2
Diffstat (limited to 'tests')
-rw-r--r--tests/qemuxml2argvmock.c11
-rw-r--r--tests/virnetdevtest.c14
-rw-r--r--tests/xml2sexprdata/xml2sexpr-net-routed.xml1
3 files changed, 17 insertions, 9 deletions
diff --git a/tests/qemuxml2argvmock.c b/tests/qemuxml2argvmock.c
index c6a1f9881..e0ec2db4d 100644
--- a/tests/qemuxml2argvmock.c
+++ b/tests/qemuxml2argvmock.c
@@ -1,5 +1,5 @@
/*
- * Copyright (C) 2014 Red Hat, Inc.
+ * Copyright (C) 2014-2016 Red Hat, Inc.
*
* This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Lesser General Public
@@ -26,6 +26,7 @@
#include "vircrypto.h"
#include "virmock.h"
#include "virnetdev.h"
+#include "virnetdevip.h"
#include "virnetdevtap.h"
#include "virnuma.h"
#include "virrandom.h"
@@ -127,6 +128,14 @@ virNetDevSetMAC(const char *ifname ATTRIBUTE_UNUSED,
return 0;
}
+int virNetDevIPAddrAdd(const char *ifname ATTRIBUTE_UNUSED,
+ virSocketAddr *addr ATTRIBUTE_UNUSED,
+ virSocketAddr *peer ATTRIBUTE_UNUSED,
+ unsigned int prefix ATTRIBUTE_UNUSED)
+{
+ return 0;
+}
+
int
virNetDevSetOnline(const char *ifname ATTRIBUTE_UNUSED,
bool online ATTRIBUTE_UNUSED)
diff --git a/tests/virnetdevtest.c b/tests/virnetdevtest.c
index 3987a8ac2..7c8a03f9b 100644
--- a/tests/virnetdevtest.c
+++ b/tests/virnetdevtest.c
@@ -30,7 +30,7 @@
struct testVirNetDevGetLinkInfoData {
const char *ifname; /* ifname to get info on */
- virInterfaceState state; /* expected state */
+ virNetDevIfState state; /* expected state */
unsigned int speed; /* expected speed */
};
@@ -39,7 +39,7 @@ testVirNetDevGetLinkInfo(const void *opaque)
{
int ret = -1;
const struct testVirNetDevGetLinkInfoData *data = opaque;
- virInterfaceLink lnk;
+ virNetDevIfLink lnk;
if (virNetDevGetLinkInfo(data->ifname, &lnk) < 0)
goto cleanup;
@@ -47,8 +47,8 @@ testVirNetDevGetLinkInfo(const void *opaque)
if (lnk.state != data->state) {
fprintf(stderr,
"Fetched link state (%s) doesn't match the expected one (%s)",
- virInterfaceStateTypeToString(lnk.state),
- virInterfaceStateTypeToString(data->state));
+ virNetDevIfStateTypeToString(lnk.state),
+ virNetDevIfStateTypeToString(data->state));
goto cleanup;
}
@@ -77,9 +77,9 @@ mymain(void)
ret = -1; \
} while (0)
- DO_TEST_LINK("eth0", VIR_INTERFACE_STATE_UP, 1000);
- DO_TEST_LINK("lo", VIR_INTERFACE_STATE_UNKNOWN, 0);
- DO_TEST_LINK("eth0-broken", VIR_INTERFACE_STATE_DOWN, 0);
+ DO_TEST_LINK("eth0", VIR_NETDEV_IF_STATE_UP, 1000);
+ DO_TEST_LINK("lo", VIR_NETDEV_IF_STATE_UNKNOWN, 0);
+ DO_TEST_LINK("eth0-broken", VIR_NETDEV_IF_STATE_DOWN, 0);
return ret == 0 ? EXIT_SUCCESS : EXIT_FAILURE;
}
diff --git a/tests/xml2sexprdata/xml2sexpr-net-routed.xml b/tests/xml2sexprdata/xml2sexpr-net-routed.xml
index f34dbaa5a..2adc3a794 100644
--- a/tests/xml2sexprdata/xml2sexpr-net-routed.xml
+++ b/tests/xml2sexprdata/xml2sexpr-net-routed.xml
@@ -20,7 +20,6 @@
<interface type="ethernet">
<mac address="00:11:22:33:44:55"/>
<ip address="172.14.5.6"/>
- <source dev="eth3"/>
<script path="vif-routed"/>
<target dev="vif4.0"/>
</interface>