syscall tracing: update tests
authorMathieu Desnoyers <mathieu.desnoyers@efficios.com>
Wed, 5 Nov 2014 21:54:48 +0000 (16:54 -0500)
committerJérémie Galarneau <jeremie.galarneau@efficios.com>
Wed, 5 Nov 2014 21:54:48 +0000 (16:54 -0500)
Update syscall tracing tests following the semantic changes of enablers
in lttng-modules and disable behavior of lttng-sessiond.

Signed-off-by: Mathieu Desnoyers <mathieu.desnoyers@efficios.com>
Signed-off-by: Jérémie Galarneau <jeremie.galarneau@efficios.com>
tests/regression/kernel/test_syscall

index 16df6a895f930f30764ee8f20d5c7ac8f9c152a1..a7800d2a1fede246cadeaaba7e70f423cd15392c 100755 (executable)
@@ -20,7 +20,7 @@ TEST_DESC="Kernel tracer - System calls"
 
 CURDIR=$(dirname $0)/
 TESTDIR=$CURDIR/../..
-NUM_TESTS=155
+NUM_TESTS=157
 
 # test command issues at least open and close system calls
 TESTCMD="cat /proc/cpuinfo > /dev/null"
@@ -214,15 +214,16 @@ function test_syscall_all_disable_one()
 
        # enable all syscalls
        lttng_enable_kernel_syscall_ok $SESSION_NAME
-       # disable open system call
-       lttng_disable_kernel_syscall_ok $SESSION_NAME "open"
+       # try to disable open system call: fails because enabler semantic of
+       # "all syscalls" is not "the open" system call.
+       lttng_disable_kernel_syscall_fail $SESSION_NAME "open"
 
        start_lttng_tracing
        eval ${TESTCMD}
        stop_lttng_tracing
 
-       # ensure "open" syscall is not there.
-       validate_trace_only_exp "-v -e syscall_entry_open: -e compat_syscall_entry_open: -e syscall_exit_open: -e compat_syscall_exit_open:" $TRACE_PATH
+       # ensure "open" syscall is there.
+       validate_trace_exp "-e syscall_entry_open: -e compat_syscall_entry_open: -e syscall_exit_open: -e compat_syscall_exit_open:" $TRACE_PATH
 
        # ensure "close" syscall is there.
        validate_trace_exp "-e syscall_entry_close: -e compat_syscall_entry_close:" $TRACE_PATH
@@ -244,17 +245,22 @@ function test_syscall_all_disable_two()
 
        # enable all syscalls
        lttng_enable_kernel_syscall_ok $SESSION_NAME
-       # disable open system call
-       lttng_disable_kernel_syscall_ok $SESSION_NAME "open"
-       lttng_disable_kernel_syscall_ok $SESSION_NAME "close"
+       # try to disable open and close system calls: fails because enabler
+       # semantic of "all syscalls" is not "the open" system call.
+       lttng_disable_kernel_syscall_fail $SESSION_NAME "open"
+       lttng_disable_kernel_syscall_fail $SESSION_NAME "close"
 
        start_lttng_tracing
        # generates open, close, execve (at least)
        eval ${TESTCMD}
        stop_lttng_tracing
 
-       # ensure "open" and "close" syscalls are not there.
-       validate_trace_only_exp "-v -e syscall_entry_open: -e compat_syscall_entry_open: -e syscall_exit_open: -e compat_syscall_exit_open: -e syscall_entry_close: -e compat_syscall_entry_close: -e syscall_exit_close: -e compat_syscall_exit_close:" $TRACE_PATH
+       # ensure "open" syscall is there.
+       validate_trace_exp "-e syscall_entry_open: -e compat_syscall_entry_open: -e syscall_exit_open: -e compat_syscall_exit_open:" $TRACE_PATH
+
+       # ensure "close" syscall is there.
+       validate_trace_exp "-e syscall_entry_close: -e compat_syscall_entry_close:" $TRACE_PATH
+       validate_trace_exp "-e syscall_exit_close: -e compat_syscall_exit_close:" $TRACE_PATH
 
        # ensure "execve" syscall is there.
        validate_trace_exp "-e syscall_entry_execve: -e compat_syscall_entry_execve:" $TRACE_PATH
@@ -456,8 +462,8 @@ function test_syscall_disable_twice()
        lttng_enable_kernel_syscall_ok $SESSION_NAME "open"
        # First disable will succeed
        lttng_disable_kernel_syscall_ok $SESSION_NAME "open"
-       # Second disable will fail
-       lttng_disable_kernel_syscall_fail $SESSION_NAME "open"
+       # Second disable succeeds too, due to enabler semantic.
+       lttng_disable_kernel_syscall_ok $SESSION_NAME "open"
 
        destroy_lttng_session $SESSION_NAME
 
@@ -476,8 +482,8 @@ function test_syscall_disable_all_twice()
        lttng_enable_kernel_syscall_ok $SESSION_NAME
        # First disable will succeed
        lttng_disable_kernel_syscall_ok $SESSION_NAME
-       # Second disable will fail
-       lttng_disable_kernel_syscall_fail $SESSION_NAME
+       # Second disable succeeds too, due to enabler semantic.
+       lttng_disable_kernel_syscall_ok $SESSION_NAME
 
        destroy_lttng_session $SESSION_NAME
 
@@ -494,7 +500,9 @@ function test_syscall_enable_unknown()
 
        create_lttng_session $SESSION_NAME $TRACE_PATH
 
-       lttng_enable_kernel_syscall_fail $SESSION_NAME "thissyscallcannotexist"
+       # Enabling a syscall that does not exist succeeds, due to enabler
+       # semantic.
+       lttng_enable_kernel_syscall_ok $SESSION_NAME "thissyscallcannotexist"
 
        destroy_lttng_session $SESSION_NAME
 
@@ -511,8 +519,8 @@ function test_syscall_enable_all_enable_one()
        create_lttng_session $SESSION_NAME $TRACE_PATH
 
        lttng_enable_kernel_syscall_ok $SESSION_NAME
-       # Enabling an event already enabled fails.
-       lttng_enable_kernel_syscall_fail $SESSION_NAME "open"
+       # Enabling an event already enabled succeeds, due to enabler semantic.
+       lttng_enable_kernel_syscall_ok $SESSION_NAME "open"
 
        destroy_lttng_session $SESSION_NAME
 
@@ -549,7 +557,9 @@ function test_syscall_enable_channel_disable_all()
        create_lttng_session $SESSION_NAME $TRACE_PATH
 
        lttng_enable_kernel_channel_ok $SESSION_NAME $CHANNEL_NAME
-       lttng_disable_kernel_syscall_fail $SESSION_NAME "-a" $CHANNEL_NAME
+       # sessiond semantic for "disable all" is to try to match all enalers
+       # it knowns about. Disable all succeeds if it finds no match.
+       lttng_disable_kernel_syscall_ok $SESSION_NAME "-a" $CHANNEL_NAME
 
        destroy_lttng_session $SESSION_NAME
 
This page took 0.027824 seconds and 4 git commands to generate.