hsa: remove mbytes/gbytes parameters from echo client 87/42587/2
authorSemir Sionek <[email protected]>
Fri, 28 Mar 2025 15:05:11 +0000 (15:05 +0000)
committerFlorin Coras <[email protected]>
Mon, 31 Mar 2025 21:56:39 +0000 (21:56 +0000)
...since we're already doing unformat_memory_size on the regular bytes
parameter anyway. In conjunction with that, adjust some make
test/hs-test tests to make use of this parameter.

Type: refactor
Change-Id: Ia0c2899a31b14a8689fdc256e25c4bb418de37fc
Signed-off-by: Semir Sionek <[email protected]>
extras/hs-test/echo_test.go
extras/hs-test/vcl_test.go
src/plugins/hs_apps/echo_client.c
test/asf/test_quic.py
test/asf/test_tcp.py
test/asf/test_tls.py
test/test_udp.py

index b21c69a..8d69c00 100644 (file)
@@ -39,7 +39,7 @@ func TcpWithLossTest(s *VethsSuite) {
        clientVpp.Vppctl("nsim output-feature enable-disable host-" + s.Interfaces.Server.Name())
 
        // Do echo test from client-vpp container
-       output := clientVpp.Vppctl("test echo client uri tcp://%s/20022 verbose echo-bytes mbytes 50",
+       output := clientVpp.Vppctl("test echo client uri tcp://%s/20022 verbose echo-bytes bytes 50m",
                s.Interfaces.Server.Ip4AddressString())
        s.Log(output)
        s.AssertNotEqual(len(output), 0)
index e88b6b7..bc557a9 100644 (file)
@@ -77,7 +77,7 @@ func testXEchoVclServer(s *VethsSuite, proto string) {
        serverVethAddress := s.Interfaces.Server.Ip4AddressString()
 
        clientVpp := s.Containers.ClientVpp.VppInstance
-       o := clientVpp.Vppctl("test echo client uri %s://%s/%s fifo-size 64k verbose mbytes 2", proto, serverVethAddress, port)
+       o := clientVpp.Vppctl("test echo client uri %s://%s/%s fifo-size 64k verbose bytes 2m", proto, serverVethAddress, port)
        s.Log(o)
        s.AssertContains(o, "Test finished at")
 }
index ff5a3bd..b08edaa 100644 (file)
@@ -1073,7 +1073,7 @@ ec_command_fn (vlib_main_t *vm, unformat_input_t *input,
   uword *event_data = 0, event_type;
   clib_error_t *error = 0;
   int rv, had_config = 1;
-  u64 tmp, total_bytes;
+  u64 total_bytes;
   f64 delta;
 
   if (ecm->test_client_attached)
@@ -1099,10 +1099,6 @@ ec_command_fn (vlib_main_t *vm, unformat_input_t *input,
        ;
       else if (unformat (line_input, "quic-streams %d", &ecm->quic_streams))
        ;
-      else if (unformat (line_input, "mbytes %lld", &tmp))
-       ecm->bytes_to_send = tmp << 20;
-      else if (unformat (line_input, "gbytes %lld", &tmp))
-       ecm->bytes_to_send = tmp << 30;
       else if (unformat (line_input, "bytes %U", unformat_memory_size,
                         &ecm->bytes_to_send))
        ;
@@ -1336,7 +1332,7 @@ cleanup:
 VLIB_CLI_COMMAND (ec_command, static) = {
   .path = "test echo clients",
   .short_help =
-    "test echo clients [nclients %d][[m|g]bytes <bytes>]"
+    "test echo clients [nclients %d][bytes <bytes>[m|g]]"
     "[test-timeout <time>][syn-timeout <time>][echo-bytes][fifo-size <size>]"
     "[private-segment-count <count>][private-segment-size <bytes>[m|g]]"
     "[preallocate-fifos][preallocate-sessions][client-batch <batch-size>]"
index c4fa691..78ebe0f 100644 (file)
@@ -178,7 +178,7 @@ class QUICEchoIntTransferTestCase(QUICEchoIntTestCase):
     def test_quic_int_transfer(self):
         """QUIC internal transfer"""
         self.server()
-        self.client("mbytes", "2")
+        self.client("bytes", "2m")
 
 
 @tag_fixme_vpp_workers
@@ -188,11 +188,11 @@ class QUICEchoIntSerialTestCase(QUICEchoIntTestCase):
     def test_quic_serial_int_transfer(self):
         """QUIC serial internal transfer"""
         self.server()
-        self.client("mbytes", "2")
-        self.client("mbytes", "2")
-        self.client("mbytes", "2")
-        self.client("mbytes", "2")
-        self.client("mbytes", "2")
+        self.client("bytes", "2m")
+        self.client("bytes", "2m")
+        self.client("bytes", "2m")
+        self.client("bytes", "2m")
+        self.client("bytes", "2m")
 
 
 @tag_fixme_vpp_workers
@@ -202,7 +202,7 @@ class QUICEchoIntMStreamTestCase(QUICEchoIntTestCase):
     def test_quic_int_multistream_transfer(self):
         """QUIC internal multi-stream transfer"""
         self.server()
-        self.client("nclients", "10", "mbytes", "1")
+        self.client("nclients", "10", "bytes", "1m")
 
 
 class QUICEchoExtTestCase(QUICTestCase):
index 23772d3..e9c9e1e 100644 (file)
@@ -89,7 +89,7 @@ class TestTCP(VppAsfTestCase):
             self.assertNotIn("failed", error)
 
         error = self.vapi.cli(
-            "test echo client mbytes 10 appns 1 "
+            "test echo client bytes 10m appns 1 "
             + "fifo-size 4k test-bytes "
             + "syn-timeout 2 uri "
             + uri
index 2ce8714..6676132 100644 (file)
@@ -142,7 +142,7 @@ class TestTLS(VppAsfTestCase):
             self.assertNotIn("failed", error)
 
         error = self.vapi.cli(
-            "test echo client mbytes 10 appns 1 "
+            "test echo client bytes 10m appns 1 "
             "fifo-size 4k test-bytes "
             "tls-engine 1 "
             "syn-timeout 2 uri " + uri
index 6315f0e..c7620fb 100644 (file)
@@ -764,7 +764,7 @@ class TestUDP(VppTestCase):
             self.assertNotIn("failed", error)
 
         error = self.vapi.cli(
-            "test echo client mbytes 10 appns 1 "
+            "test echo client bytes 10m appns 1 "
             + "fifo-size 4k "
             + "syn-timeout 2 uri "
             + uri