diff mbox series

Fix incorrect number of tests in test_callstack

Message ID 20221020171226.3450-1-mikael.beckius@windriver.com
State New
Headers show
Series Fix incorrect number of tests in test_callstack | expand

Commit Message

Beckius, Mikael Oct. 20, 2022, 5:12 p.m. UTC
regression/kernel/test_callstack                         (Wstat: 256 Tests: 12 Failed: 1)
  Failed test:  12
  Non-zero exit status: 1
  Parse errors: Bad plan.  You planned 11 tests but ran 12.

Signed-off-by: Mikael Beckius <mikael.beckius at windriver.com>
---
 tests/regression/kernel/test_callstack | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

Comments

Jérémie Galarneau Oct. 21, 2022, 6:38 p.m. UTC | #1
Hi Mikael,

I'm getting the correct number of tests here.
Can you provide the full output of the test?

Thanks,
J?r?mie

On Thu, Oct 20, 2022 at 07:12:26PM +0200, Mikael Beckius via lttng-dev wrote:
> regression/kernel/test_callstack                         (Wstat: 256 Tests: 12 Failed: 1)
>   Failed test:  12
>   Non-zero exit status: 1
>   Parse errors: Bad plan.  You planned 11 tests but ran 12.
> 
> Signed-off-by: Mikael Beckius <mikael.beckius at windriver.com>
> ---
>  tests/regression/kernel/test_callstack | 4 ++--
>  1 file changed, 2 insertions(+), 2 deletions(-)
> 
> diff --git a/tests/regression/kernel/test_callstack b/tests/regression/kernel/test_callstack
> index a4477fd7c..b5d604535 100755
> --- a/tests/regression/kernel/test_callstack
> +++ b/tests/regression/kernel/test_callstack
> @@ -9,7 +9,7 @@ TEST_DESC="Kernel tracer - Callstack context"
>  
>  CURDIR=$(dirname "$0")/
>  TESTDIR=$CURDIR/../..
> -NUM_TESTS=11
> +NUM_TESTS=12
>  TEST_APP_USERSPACE="$TESTDIR/utils/testapp/gen-syscall-events-callstack/gen-syscall-events-callstack"
>  TEST_APP_KERNELSPACE="$TESTDIR/utils/testapp/gen-syscall-events/gen-syscall-events"
>  PARSE_CALLSTACK="$TESTDIR/utils/parse-callstack.py"
> @@ -123,7 +123,7 @@ function test_kernel_callstack()
>  # Only run userspace callstack test on x86
>  uname -m | grep -E "x86" >/dev/null 2>&1
>  if test $? == 0; then
> -	NUM_TESTS=$((NUM_TESTS+11))
> +	NUM_TESTS=$((NUM_TESTS+10))
>  	RUN_USERSPACE_TEST=1
>  else
>  	RUN_USERSPACE_TEST=0
> -- 
> 2.34.1
> 
> _______________________________________________
> lttng-dev mailing list
> lttng-dev at lists.lttng.org
> https://lists.lttng.org/cgi-bin/mailman/listinfo/lttng-dev
Beckius, Mikael Oct. 24, 2022, 8:08 a.m. UTC | #2
Hello J?r?mie!

I think the key here is to run the test on arm. I don't see the issue on x86 and there the total number of tests is the same with and without the patch.

Below is the output from running on arm with and without the patch:
# grep NUM_TESTS= regression/kernel/test_callstack.old
NUM_TESTS=11
??????NUM_TESTS=$((NUM_TESTS+11))

# regression/kernel/test_callstack.old
1..11
# Kernel tracer - Callstack context
ok 1 - Start session daemon
# Kernel callstack test
ok 2 - Create session callstack in -o /tmp/tmp.SMAJwATHfC
ok 3 - Enable channel chan0 for session callstack
ok 4 - Enable kernel syscall read for session callstack on channel chan0
ok 5 - Add context command for type: callstack-kernel
ok 6 - Untrack command with opts: -s callstack --all --pid -k
ok 7 - Track command with opts: -s callstack -k --pid=2208
ok 8 - Start tracing for session
ok 9 - Stop lttng tracing for session
ok 10 - Destroy session callstack
ok 11 - Validate kernel callstack
# Killing (signal SIGTERM) lttng-sessiond and lt-lttng-sessiond pids: 2172 2173 2195
ok 12 - Wait after kill session daemon
# Looks like you planned 11 tests but ran 1 extra.

# grep NUM_TESTS= regression/kernel/test_callstack
NUM_TESTS=12
??????NUM_TESTS=$((NUM_TESTS+10))

# regression/kernel/test_callstack
1..12
# Kernel tracer - Callstack context
ok 1 - Start session daemon
# Kernel callstack test
ok 2 - Create session callstack in -o /tmp/tmp.ddcyRuGLzX
ok 3 - Enable channel chan0 for session callstack
ok 4 - Enable kernel syscall read for session callstack on channel chan0
ok 5 - Add context command for type: callstack-kernel
ok 6 - Untrack command with opts: -s callstack --all --pid -k
ok 7 - Track command with opts: -s callstack -k --pid=2292
ok 8 - Start tracing for session
ok 9 - Stop lttng tracing for session
ok 10 - Destroy session callstack
ok 11 - Validate kernel callstack
# Killing (signal SIGTERM) lttng-sessiond and lt-lttng-sessiond pids: 2256 2257 2279
ok 12 - Wait after kill session daemon

# uname -a
Linux #1 SMP PREEMPT Thu Oct 20 10:28:23 CEST 2022 armv7l armv7l armv7l GNU/Linux
diff mbox series

Patch

diff --git a/tests/regression/kernel/test_callstack b/tests/regression/kernel/test_callstack
index a4477fd7c..b5d604535 100755
--- a/tests/regression/kernel/test_callstack
+++ b/tests/regression/kernel/test_callstack
@@ -9,7 +9,7 @@  TEST_DESC="Kernel tracer - Callstack context"
 
 CURDIR=$(dirname "$0")/
 TESTDIR=$CURDIR/../..
-NUM_TESTS=11
+NUM_TESTS=12
 TEST_APP_USERSPACE="$TESTDIR/utils/testapp/gen-syscall-events-callstack/gen-syscall-events-callstack"
 TEST_APP_KERNELSPACE="$TESTDIR/utils/testapp/gen-syscall-events/gen-syscall-events"
 PARSE_CALLSTACK="$TESTDIR/utils/parse-callstack.py"
@@ -123,7 +123,7 @@  function test_kernel_callstack()
 # Only run userspace callstack test on x86
 uname -m | grep -E "x86" >/dev/null 2>&1
 if test $? == 0; then
-	NUM_TESTS=$((NUM_TESTS+11))
+	NUM_TESTS=$((NUM_TESTS+10))
 	RUN_USERSPACE_TEST=1
 else
 	RUN_USERSPACE_TEST=0