test-user-mode: classify and skip all failing gem5 tests

Create userlan/posix/kill.c to better test signals.
This commit is contained in:
Ciro Santilli 六四事件 法轮功
2019-05-28 00:00:00 +00:00
parent cc1d8d08d0
commit 04c54a6369
3 changed files with 30 additions and 1 deletions

View File

@@ -15383,6 +15383,7 @@ The following examples end up testing that our setup is working:
* link:userland/c/exit0.c[]
* link:userland/c/exit1.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.

View File

@@ -47,6 +47,7 @@ class PathProperties:
'extra_objs_disable_baremetal_bootloader': False,
# We should get rid of this if we ever properly implement dependency graphs.
'extra_objs_lkmc_common': False,
'gem5_unimplemented_instruction': False,
'interactive': False,
# The script takes a perceptible amount of time to run. Possibly an infinite loop.
'more_than_1s': False,
@@ -149,6 +150,7 @@ class PathProperties:
self['signal_generated_by_os']
)
) and
not self['disrupts_system'] and
not self['interactive'] and
not self['more_than_1s'] and
not self['no_executable'] and
@@ -159,6 +161,9 @@ class PathProperties:
not (
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_semihosting'] or
self['requires_syscall_getcpu']
@@ -347,7 +352,10 @@ path_properties_tuples = (
'signal_generated_by_os': True,
'signal_received': signal.Signals.SIGILL,
},
'vcvta.S': {'arm_aarch32': True},
'vcvta.S': {
'arm_aarch32': True,
'gem5_unimplemented_instruction': True,
},
}
),
'aarch64': (
@@ -452,6 +460,10 @@ path_properties_tuples = (
{},
{
'count.c': {'more_than_1s': True},
'kill.c': {
'baremetal': True,
'signal_received': signal.Signals.SIGHUP,
},
'sleep_forever.c': {'more_than_1s': True},
'virt_to_phys_test.c': {'more_than_1s': True},
}

16
userland/posix/kill.c Normal file
View 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);
}