]> git.proxmox.com Git - mirror_ovs.git/commitdiff
tests: Port test-sflow and test-netflow to Windows.
authorGurucharan Shetty <gshetty@nicira.com>
Fri, 23 May 2014 20:40:07 +0000 (13:40 -0700)
committerGurucharan Shetty <gshetty@nicira.com>
Mon, 30 Jun 2014 19:22:13 +0000 (12:22 -0700)
After the change, both of them compile. test-netflow related
unit tests pass.

test-sflow related tests do not pass because
of LOOPBACK_INTERFACE constraints for 'agent'.
(It should be revisited later.)

Signed-off-by: Gurucharan Shetty <gshetty@nicira.com>
Acked-by: Ben Pfaff <blp@nicira.com>
tests/test-netflow.c
tests/test-sflow.c

index 1243f835842913be51b47dca6eac02f4e979d79e..76f9baedb9fd9b44be7d29784b01ab8791956578 100644 (file)
@@ -181,6 +181,7 @@ test_netflow_main(int argc, char *argv[])
 
     proctitle_init(argc, argv);
     set_program_name(argv[0]);
+    service_start(&argc, &argv);
     parse_options(argc, argv);
 
     if (argc - optind != 1) {
@@ -214,7 +215,7 @@ test_netflow_main(int argc, char *argv[])
 
         ofpbuf_clear(&buf);
         do {
-            retval = read(sock, ofpbuf_data(&buf), buf.allocated);
+            retval = recv(sock, ofpbuf_data(&buf), buf.allocated, 0);
         } while (retval < 0 && errno == EINTR);
         if (retval > 0) {
             ofpbuf_put_uninit(&buf, retval);
index fa8b5c5004d57057651e157435a346c96d74deee..b91fd4118c491dcfc78989c75605645bd14b9ced 100644 (file)
@@ -499,6 +499,7 @@ test_sflow_main(int argc, char *argv[])
 
     proctitle_init(argc, argv);
     set_program_name(argv[0]);
+    service_start(&argc, &argv);
     parse_options(argc, argv);
 
     if (argc - optind != 1) {
@@ -531,7 +532,7 @@ test_sflow_main(int argc, char *argv[])
 
         ofpbuf_clear(&buf);
         do {
-            retval = read(sock, ofpbuf_data(&buf), buf.allocated);
+            retval = recv(sock, ofpbuf_data(&buf), buf.allocated, 0);
         } while (retval < 0 && errno == EINTR);
         if (retval > 0) {
             ofpbuf_put_uninit(&buf, retval);