tcp: fix byte tracker samples flush
[vpp.git] / src / plugins / unittest / tcp_test.c
index 6f765e7..7aa2456 100644 (file)
@@ -762,7 +762,7 @@ tcp_test_session (vlib_main_t * vm, unformat_input_t * input)
       tc0->rcv_opts.mss = 1450;
       tcp_connection_init_vars (tc0);
 
-      TCP_EVT_DBG (TCP_EVT_OPEN, tc0);
+      TCP_EVT (TCP_EVT_OPEN, tc0);
 
       if (session_stream_accept (&tc0->connection, 0 /* listener index */ ,
                                 0 /* thread index */ , 0 /* notify */ ))
@@ -1093,6 +1093,19 @@ tcp_test_delivery (vlib_main_t * vm, unformat_input_t * input)
   TCP_TEST (rs->flags & TCP_BTS_IS_APP_LIMITED, "is app limited");
   TCP_TEST (tc->app_limited == 0, "app limited should be cleared");
 
+  /*
+   * 9) test flush
+   */
+
+  tcp_bt_track_tx (tc);
+  tc->snd_nxt += burst;
+
+  session_main.wrk[thread_index].last_vlib_time = 12;
+  tcp_bt_track_tx (tc);
+  tc->snd_nxt += burst;
+
+  tcp_bt_flush_samples (tc);
+
   /*
    * Cleanup
    */