feat(hoststack): Run stat_post_trial if wait fails 22/42122/1
authorVratko Polak <[email protected]>
Thu, 9 Jan 2025 16:52:45 +0000 (17:52 +0100)
committerVratko Polak <[email protected]>
Thu, 9 Jan 2025 16:52:45 +0000 (17:52 +0100)
Stat outputs are useful when investigating why client is slow.
This fixes only AB tests. Iperf3 would need more complicated code.

Change-Id: I4e523519b0b6f39c310de96aace7eb03a40a3b74
Signed-off-by: Vratko Polak <[email protected]>
resources/libraries/robot/hoststack/hoststack.robot

index ece1d8a..3be1be5 100644 (file)
@@ -1,4 +1,4 @@
-# Copyright (c) 2024 Cisco and/or its affiliates.
+# Copyright (c) 2025 Cisco and/or its affiliates.
 # Licensed under the Apache License, Version 2.0 (the "License");
 # you may not use this file except in compliance with the License.
 # You may obtain a copy of the License at:
 | | FOR | ${action} | IN | @{stat_pre_trial}
 | | | Run Keyword | Additional Statistics Action For ${action}
 | | END
-| | ${output}= | Run ab | ${tg} | ${dut_ip_addrs_str} | ${ad_ip_addrs_str}
+| | ${status} | ${message}= | Run Keyword And Ignore Error | Run ab
+| | ... | ${tg} | ${dut_ip_addrs_str} | ${ad_ip_addrs_str}
 | | ... | ${tls_tcp} | ${ciphers} | ${files} | ${mode} | ${r_total} | ${c_total}
 | | ... | ${listen_port}
 | | FOR | ${action} | IN | @{stat_post_trial}
 | | | Run Keyword | Additional Statistics Action For ${action}
 | | END
-| | Set test message | ${output}
+| | Set test message | ${message}
+| | Run Keyword If | "${status}" != "PASS" | Fail | AB failed: ${message}
 
 | Configure VPP startup configuration for NGINX
 | | [Documentation]