userland: classify linux

This commit is contained in:
Ciro Santilli 六四事件 法轮功
2019-05-05 00:00:00 +00:00
parent 14270ad7b3
commit e26a60f376
2 changed files with 26 additions and 7 deletions

View File

@@ -20,19 +20,23 @@ class PathProperties:
# We were lazy to properly classify why we are skipping these tests. # We were lazy to properly classify why we are skipping these tests.
# TODO get it done. # TODO get it done.
'skip_run_unclassified', 'skip_run_unclassified',
# The script takes a perceptible amount of time to run. Possibly an infinite loop.
'more_than_1s', 'more_than_1s',
# The path does not generate an executable in itself, e.g. # The path does not generate an executable in itself, e.g.
# it only generates intermediate object files. # it only generates intermediate object files.
'no_executable', 'no_executable',
# The script requires a non-trivial argument to be passed to run properly.
'requires_argument',
# the test receives a signal. We skip those tests for now, # the test receives a signal. We skip those tests for now,
# on userland because we are lazy to figure out the exact semantics # on userland because we are lazy to figure out the exact semantics
# of how Python + QEMU + gem5 determine the exit status of signals. # of how Python + QEMU + gem5 determine the exit status of signals.
'receives_signal', 'receives_signal',
# Requires certain of our custom kernel modules to be inserted to run.
'requires_kernel_modules', 'requires_kernel_modules',
# The example requires sudo, which usually implies that it can do something # The example requires sudo, which usually implies that it can do something
# deeply to the system it runs on, which would preventing further interactive # deeply to the system it runs on, which would preventing further interactive
# or test usage of the system, for example poweroff or messing up the GUI. # or test usage of the system, for example poweroff or messing up the GUI.
'sudo', 'requires_sudo',
'uses_dynamic_library', 'uses_dynamic_library',
} }
@@ -78,9 +82,10 @@ class PathProperties:
not self['interactive'] and \ not self['interactive'] and \
not self['more_than_1s'] and \ not self['more_than_1s'] and \
not self['receives_signal'] and \ not self['receives_signal'] and \
not self['requires_argument'] and \
not self['requires_kernel_modules'] and \ not self['requires_kernel_modules'] and \
not self['requires_sudo'] and \
not self['skip_run_unclassified'] and \ not self['skip_run_unclassified'] and \
not self['sudo'] and \
not (self['uses_dynamic_library'] and env['emulator'] == 'gem5') not (self['uses_dynamic_library'] and env['emulator'] == 'gem5')
def update(self, other): def update(self, other):
@@ -170,9 +175,10 @@ path_properties_tuples = (
'more_than_1s': False, 'more_than_1s': False,
'no_executable': False, 'no_executable': False,
'receives_signal': False, 'receives_signal': False,
'requires_argument': False,
'requires_kernel_modules': False, 'requires_kernel_modules': False,
'requires_sudo': False,
'skip_run_unclassified': False, 'skip_run_unclassified': False,
'sudo': False,
'uses_dynamic_library': False, 'uses_dynamic_library': False,
}, },
{ {
@@ -274,12 +280,25 @@ path_properties_tuples = (
'libs': ( 'libs': (
{'uses_dynamic_library': True}, {'uses_dynamic_library': True},
{ {
'libdrm': {'sudo': True}, 'libdrm': {'requires_sudo': True},
} }
), ),
'linux': ( 'linux': (
{**gnu_extension_properties, **{'skip_run_unclassified': True}}, gnu_extension_properties,
) {
'ctrl_alt_del.c': {'requires_sudo': True},
'init_env_poweroff.c': {'requires_sudo': True},
'myinsmod.c': {'requires_sudo': True},
'myrmmod.c': {'requires_sudo': True},
'pagemap_dump.c': {'requires_argument': True},
'poweroff.c': {'requires_sudo': True},
'proc_events.c': {'requires_sudo': True},
'proc_events.c': {'requires_sudo': True},
'sched_getaffinity_threads.c': {'more_than_1s': True},
'time_boot.c': {'requires_sudo': True},
'virt_to_phys_user.c': {'requires_argument': True},
}
),
'posix': ( 'posix': (
{}, {},
{ {

View File

@@ -26,7 +26,7 @@ int main(__attribute__((unused)) int argc, char **argv) {
/* Misc syscalls. */ /* Misc syscalls. */
printf("time(NULL) = %ju\n", (uintmax_t)time(NULL)); printf("time(NULL) = %ju\n", (uintmax_t)time(NULL));
printf("pid = %ju\n", (uintmax_t)getpid()); printf("pid = %ju\n", (uintmax_t)getpid());
/* malloc */ /* malloc */
ip = malloc(sizeof(*ip)); ip = malloc(sizeof(*ip));