]> xenbits.xensource.com Git - libvirt.git/commitdiff
tests: mock virNetDevSetIPAddress
authorLaine Stump <laine@laine.org>
Tue, 26 Apr 2016 16:49:48 +0000 (12:49 -0400)
committerLaine Stump <laine@laine.org>
Sun, 26 Jun 2016 23:33:08 +0000 (19:33 -0400)
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

index c6a1f98814273dcbdbd94d73aae0e67ad565d962..b99496a6a19015e809bcbd1ecb72db877fe48d6a 100644 (file)
@@ -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)