• Wen Yang's avatar
    selftests: introduce additional eventfd test coverage · 87beb669
    Wen Yang authored
    Add several new test cases which assert corner cases on the eventfd
    mechanism, for example, the supplied buffer is less than 8 bytes,
    attempting to write a value that is too large, etc.
    
    	./eventfd_test
    	# Starting 9 tests from 1 test cases.
    	#  RUN           global.eventfd_check_flag_rdwr ...
    	#            OK  global.eventfd_check_flag_rdwr
    	ok 1 global.eventfd_check_flag_rdwr
    	#  RUN           global.eventfd_check_flag_cloexec ...
    	#            OK  global.eventfd_check_flag_cloexec
    	ok 2 global.eventfd_check_flag_cloexec
    	#  RUN           global.eventfd_check_flag_nonblock ...
    	#            OK  global.eventfd_check_flag_nonblock
    	ok 3 global.eventfd_check_flag_nonblock
    	#  RUN           global.eventfd_chek_flag_cloexec_and_nonblock ...
    	#            OK  global.eventfd_chek_flag_cloexec_and_nonblock
    	ok 4 global.eventfd_chek_flag_cloexec_and_nonblock
    	#  RUN           global.eventfd_check_flag_semaphore ...
    	#            OK  global.eventfd_check_flag_semaphore
    	ok 5 global.eventfd_check_flag_semaphore
    	#  RUN           global.eventfd_check_write ...
    	#            OK  global.eventfd_check_write
    	ok 6 global.eventfd_check_write
    	#  RUN           global.eventfd_check_read ...
    	#            OK  global.eventfd_check_read
    	ok 7 global.eventfd_check_read
    	#  RUN           global.eventfd_check_read_with_nonsemaphore ...
    	#            OK  global.eventfd_check_read_with_nonsemaphore
    	ok 8 global.eventfd_check_read_with_nonsemaphore
    	#  RUN           global.eventfd_check_read_with_semaphore ...
    	#            OK  global.eventfd_check_read_with_semaphore
    	ok 9 global.eventfd_check_read_with_semaphore
    	# PASSED: 9 / 9 tests passed.
    	# Totals: pass:9 fail:0 xfail:0 xpass:0 skip:0 error:0
    
    Link: https://lkml.kernel.org/r/20240527000200.5615-1-wen.yang@linux.dev
    
    Signed-off-by: default avatarWen Yang <wen.yang@linux.dev>
    Cc: Shuah Khan <shuah@kernel.org>
    Cc: Christian Brauner <brauner@kernel.org>
    Cc: Andrei Vagin <avagin@google.com>
    Cc: Mathieu Desnoyers <mathieu.desnoyers@efficios.com>
    Cc: Steven Rostedt <rostedt@goodmis.org>
    Cc: Dave Young <dyoung@redhat.com>
    Cc: Tim Bird <tim.bird@sony.com>
    Signed-off-by: default avatarAndrew Morton <akpm@linux-foundation.org>
    87beb669
eventfd_test.c 6.15 KB