mirror of
https://github.com/cirosantilli/linux-kernel-module-cheat.git
synced 2026-01-23 02:05:57 +01:00
test-user-mode: classify and skip all failing gem5 tests
Create userlan/posix/kill.c to better test signals.
This commit is contained in:
@@ -15383,6 +15383,7 @@ The following examples end up testing that our setup is working:
|
|||||||
* link:userland/c/exit0.c[]
|
* link:userland/c/exit0.c[]
|
||||||
* link:userland/c/exit1.c[]
|
* link:userland/c/exit1.c[]
|
||||||
* link:userland/c/exit2.c[]
|
* link:userland/c/exit2.c[]
|
||||||
|
* link:userland/posix/kill.c[]
|
||||||
|
|
||||||
Beware that on Linux kernel simulations, you cannot even echo that string from userland, since userland stdout shows up on the serial.
|
Beware that on Linux kernel simulations, you cannot even echo that string from userland, since userland stdout shows up on the serial.
|
||||||
|
|
||||||
|
|||||||
@@ -47,6 +47,7 @@ class PathProperties:
|
|||||||
'extra_objs_disable_baremetal_bootloader': False,
|
'extra_objs_disable_baremetal_bootloader': False,
|
||||||
# We should get rid of this if we ever properly implement dependency graphs.
|
# We should get rid of this if we ever properly implement dependency graphs.
|
||||||
'extra_objs_lkmc_common': False,
|
'extra_objs_lkmc_common': False,
|
||||||
|
'gem5_unimplemented_instruction': False,
|
||||||
'interactive': False,
|
'interactive': False,
|
||||||
# The script takes a perceptible amount of time to run. Possibly an infinite loop.
|
# The script takes a perceptible amount of time to run. Possibly an infinite loop.
|
||||||
'more_than_1s': False,
|
'more_than_1s': False,
|
||||||
@@ -149,6 +150,7 @@ class PathProperties:
|
|||||||
self['signal_generated_by_os']
|
self['signal_generated_by_os']
|
||||||
)
|
)
|
||||||
) and
|
) and
|
||||||
|
not self['disrupts_system'] and
|
||||||
not self['interactive'] and
|
not self['interactive'] and
|
||||||
not self['more_than_1s'] and
|
not self['more_than_1s'] and
|
||||||
not self['no_executable'] and
|
not self['no_executable'] and
|
||||||
@@ -159,6 +161,9 @@ class PathProperties:
|
|||||||
not (
|
not (
|
||||||
env['emulator'] == 'gem5' and
|
env['emulator'] == 'gem5' and
|
||||||
(
|
(
|
||||||
|
self['gem5_unimplemented_instruction'] or
|
||||||
|
# gem5 does not report signals properly.
|
||||||
|
self['signal_received'] is not None or
|
||||||
self['requires_dynamic_library'] or
|
self['requires_dynamic_library'] or
|
||||||
self['requires_semihosting'] or
|
self['requires_semihosting'] or
|
||||||
self['requires_syscall_getcpu']
|
self['requires_syscall_getcpu']
|
||||||
@@ -347,7 +352,10 @@ path_properties_tuples = (
|
|||||||
'signal_generated_by_os': True,
|
'signal_generated_by_os': True,
|
||||||
'signal_received': signal.Signals.SIGILL,
|
'signal_received': signal.Signals.SIGILL,
|
||||||
},
|
},
|
||||||
'vcvta.S': {'arm_aarch32': True},
|
'vcvta.S': {
|
||||||
|
'arm_aarch32': True,
|
||||||
|
'gem5_unimplemented_instruction': True,
|
||||||
|
},
|
||||||
}
|
}
|
||||||
),
|
),
|
||||||
'aarch64': (
|
'aarch64': (
|
||||||
@@ -452,6 +460,10 @@ path_properties_tuples = (
|
|||||||
{},
|
{},
|
||||||
{
|
{
|
||||||
'count.c': {'more_than_1s': True},
|
'count.c': {'more_than_1s': True},
|
||||||
|
'kill.c': {
|
||||||
|
'baremetal': True,
|
||||||
|
'signal_received': signal.Signals.SIGHUP,
|
||||||
|
},
|
||||||
'sleep_forever.c': {'more_than_1s': True},
|
'sleep_forever.c': {'more_than_1s': True},
|
||||||
'virt_to_phys_test.c': {'more_than_1s': True},
|
'virt_to_phys_test.c': {'more_than_1s': True},
|
||||||
}
|
}
|
||||||
|
|||||||
16
userland/posix/kill.c
Normal file
16
userland/posix/kill.c
Normal file
@@ -0,0 +1,16 @@
|
|||||||
|
/* A process that commits suicide by signal. */
|
||||||
|
|
||||||
|
#define _XOPEN_SOURCE 700
|
||||||
|
#include <signal.h>
|
||||||
|
#include <stdlib.h>
|
||||||
|
#include <unistd.h>
|
||||||
|
|
||||||
|
int main(int argc, char **argv) {
|
||||||
|
int sig;
|
||||||
|
if (argc <= 1) {
|
||||||
|
sig = 1;
|
||||||
|
} else {
|
||||||
|
sig = strtoull(argv[1], NULL, 0);
|
||||||
|
}
|
||||||
|
kill(getpid(), sig);
|
||||||
|
}
|
||||||
Reference in New Issue
Block a user