diff mbox

[V3,06/10] tests/e1000e-test.c : change e1000e test case send data format

Message ID 1493372840-24551-7-git-send-email-zhangchen.fnst@cn.fujitsu.com (mailing list archive)
State New, archived
Headers show

Commit Message

Zhang Chen April 28, 2017, 9:47 a.m. UTC
Because we change net_fill_rstate() date format from
struct {int size; const uint8_t buf[];} to {int size; int vnet_hdr_len; const uint8_t buf[];}.
So, we add fake vnet_hdr_len in e1000e test case.

Signed-off-by: Zhang Chen <zhangchen.fnst@cn.fujitsu.com>
---
 tests/e1000e-test.c | 10 ++++++++--
 1 file changed, 8 insertions(+), 2 deletions(-)
diff mbox

Patch

diff --git a/tests/e1000e-test.c b/tests/e1000e-test.c
index c612dc6..fb3bd77 100644
--- a/tests/e1000e-test.c
+++ b/tests/e1000e-test.c
@@ -329,11 +329,15 @@  static void e1000e_receive_verify(e1000e_device *d)
 
     char test[] = "TEST";
     int len = htonl(sizeof(test));
+    int vnet_hdr_len = 0;
     struct iovec iov[] = {
         {
             .iov_base = &len,
             .iov_len = sizeof(len),
         },{
+            .iov_base = &vnet_hdr_len,
+            .iov_len = sizeof(vnet_hdr_len),
+        },{
             .iov_base = test,
             .iov_len = sizeof(test),
         },
@@ -344,8 +348,10 @@  static void e1000e_receive_verify(e1000e_device *d)
     int ret;
 
     /* Send a dummy packet to device's socket*/
-    ret = iov_send(test_sockets[0], iov, 2, 0, sizeof(len) + sizeof(test));
-    g_assert_cmpint(ret, == , sizeof(test) + sizeof(len));
+    ret = iov_send(test_sockets[0], iov, 3, 0, sizeof(len)
+                   + sizeof(vnet_hdr_len) + sizeof(test));
+    g_assert_cmpint(ret, == , sizeof(test) + sizeof(len)
+                    + sizeof(vnet_hdr_len));
 
     /* Prepare test data buffer */
     uint64_t data = guest_alloc(test_alloc, data_len);