[ovs-dev] [PATCH v3 1/2] pmd.at: Get next line number of log.

Kevin Traynor ktraynor at redhat.com
Thu Jun 24 13:20:40 UTC 2021


Some tests get the current log line number so they can check that
there is a new occurance of a log entry after a command.

'tail' uses the line number as the starting line number. However,
this will include the last line of the log before the command.

To prevent any races on logs and possibly checking an existing log
entry prior to a command here or in reuse of this method, get the
next line number of the log and use that as the starting line for tail.

Suggested-by: Ilya Maximets <i.maximets at ovn.org>
Signed-off-by: Kevin Traynor <ktraynor at redhat.com>
---
v3: newly added from Ilya comment on alb.at
---
 tests/pmd.at | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/tests/pmd.at b/tests/pmd.at
index cc5371d5a..e0d54c1dd 100644
--- a/tests/pmd.at
+++ b/tests/pmd.at
@@ -146,5 +146,5 @@ pmd thread numa_id <cleared> core_id <cleared>:
 
 AT_CHECK([ovs-vsctl set Open_vSwitch . other_config:pmd-rxq-assign=cycles])
-TMP=$(cat ovs-vswitchd.log | wc -l | tr -d [[:blank:]])
+TMP=$(($(cat ovs-vswitchd.log | wc -l | tr -d [[:blank:]])+1))
 AT_CHECK([ovs-vsctl set Open_vSwitch . other_config:pmd-cpu-mask=0x3])
 CHECK_PMD_THREADS_CREATED([2], [], [+$TMP])
@@ -161,5 +161,5 @@ port: p0 queue-id: 1 3 5 7
 ])
 
-TMP=$(cat ovs-vswitchd.log | wc -l | tr -d [[:blank:]])
+TMP=$(($(cat ovs-vswitchd.log | wc -l | tr -d [[:blank:]])+1))
 AT_CHECK([ovs-vsctl set Open_vSwitch . other_config:pmd-cpu-mask=0x1])
 CHECK_PMD_THREADS_CREATED([1], [], [+$TMP])
-- 
2.31.1



More information about the dev mailing list