[PATCH 05/28] tests: mock virNetDevSetIPAddress

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Now that we can include <interface type='ethernet'> in tests, we could
almost test XML that has an <ip> element in an interface. Except that
the test fails when it tries to actually set the IP address for the
interface's tap device. This patch mocks virNetDevSetIPAddress() to
just return success.
---
 tests/qemuxml2argvmock.c | 10 +++++++++-
 1 file changed, 9 insertions(+), 1 deletion(-)

diff --git a/tests/qemuxml2argvmock.c b/tests/qemuxml2argvmock.c
index c6a1f98..b99496a 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
@@ -127,6 +127,14 @@ virNetDevSetMAC(const char *ifname ATTRIBUTE_UNUSED,
     return 0;
 }
 
+int virNetDevSetIPAddress(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)
-- 
2.5.5

--
libvir-list mailing list
libvir-list@xxxxxxxxxx
https://www.redhat.com/mailman/listinfo/libvir-list



[Index of Archives]     [Virt Tools]     [Libvirt Users]     [Lib OS Info]     [Fedora Users]     [Fedora Desktop]     [Fedora SELinux]     [Big List of Linux Books]     [Yosemite News]     [KDE Users]     [Fedora Tools]