1#
2# Copyright (C) 2016 The Android Open Source Project
3#
4# Licensed under the Apache License, Version 2.0 (the "License");
5# you may not use this file except in compliance with the License.
6# You may obtain a copy of the License at
7#
8#      http://www.apache.org/licenses/LICENSE-2.0
9#
10# Unless required by applicable law or agreed to in writing, software
11# distributed under the License is distributed on an "AS IS" BASIS,
12# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13# See the License for the specific language governing permissions and
14# limitations under the License.
15#
16
17from vts.testcases.kernel.linux_kselftest import test_case
18
19class ConfigKeys(object):
20    TEST_TYPE = "test_type"
21
22class ExitCode(object):
23    """Exit codes for test binaries and test scripts."""
24    KSFT_PASS = 0
25    KSFT_FAIL = 1
26    KSFT_XPASS = 2
27    KSFT_XFAIL = 3
28    KSFT_SKIP = 4
29
30# Directory on the target where the tests are copied.
31KSFT_DIR = "/data/local/tmp/linux-kselftest"
32
33# Presubmit, stable, and staging lists are always mutually exclusive.
34KSFT_CASES_PRESUBMIT = map(lambda x: test_case.LinuxKselftestTestcase(*(x)), [
35])
36
37KSFT_CASES_STABLE = map(lambda x: test_case.LinuxKselftestTestcase(*(x)), [
38    ("breakpoints", "breakpoint_test_arm64", ["arm"], [64]),
39    ("capabilities", "test_execve", ["arm", "x86"], [32, 64]),
40    ("futex/functional", "run.sh", ["arm", "x86"], [32, 64]),
41    ("kcmp", "kcmp_test", ["arm", "x86"], [32, 64]),
42    ("net", "psock_tpacket", ["arm", "x86"], [64]),
43    ("net", "reuseaddr_conflict", ["arm", "x86"], [32, 64]),
44    ("net", "socket", ["arm", "x86"], [32, 64]),
45    ("ptrace", "peeksiginfo", ["arm", "x86"], [64]),
46    ("rtc", "rtctest", ["arm", "x86"], [32, 64]),
47    ("seccomp", "seccomp_bpf", ["arm", "x86"], [32, 64]),
48    ("size", "get_size", ["arm", "x86"], [32, 64]),
49    ("splice", "default_file_splice_read.sh", ["arm", "x86"], [32, 64]),
50    ("timers", "inconsistency-check", ["arm", "x86"], [32, 64]),
51    ("timers", "nanosleep", ["arm", "x86"], [32, 64]),
52    ("timers", "nsleep-lat", ["arm", "x86"], [32, 64]),
53    ("timers", "posix_timers", ["arm", "x86"], [32, 64]),
54    ("timers", "raw_skew", ["arm", "x86"], [32, 64]),
55    ("timers", "set-tai", ["arm", "x86"], [32, 64]),
56    ("timers", "set-timer-lat", ["arm", "x86"], [32, 64]),
57    ("timers", "threadtest", ["arm", "x86"], [32, 64]),
58    ("timers", "valid-adjtimex", ["arm", "x86"], [32, 64]),
59    ("vDSO", "kselftest_vdso_test", ["arm", "x86"], [64]),
60    ("x86", "single_step_syscall", ["x86"], [32, 64]),
61    ("x86", "sysret_ss_attrs", ["x86"], [32]),
62    ("x86", "syscall_nt", ["x86"], [32, 64]),
63    ("x86", "ptrace_syscall", ["x86"], [32, 64]),
64    ("x86", "test_mremap_vdso", ["x86"], [32, 64]),
65    ("x86", "check_initial_reg_state", ["x86"], [32, 64]),
66    ("x86", "ldt_gdt", ["x86"], [32, 64]),
67    ("x86", "syscall_arg_fault", ["x86"], [32]),
68    ("x86", "test_syscall_vdso", ["x86"], [32]),
69    ("x86", "unwind_vdso", ["x86"], [32]),
70    ("x86", "test_FCMOV", ["x86"], [32]),
71    ("x86", "test_FCOMI", ["x86"], [32]),
72    ("x86", "test_FISTTP", ["x86"], [32]),
73    ("x86", "vdso_restorer", ["x86"], [32]),
74])
75
76KSFT_CASES_STAGING = map(lambda x: test_case.LinuxKselftestTestcase(*(x)), [
77# b/79702574
78#    ("efivarfs", "efivarfs.sh", ["arm", "x86"], [32, 64]),
79# TODO(trong): enable pstore test.
80#    ("pstore/pstore_tests", ["arm", "x86"], [32, 64]),
81# b/69687141
82#    ("exec", "execveat.sh", ["arm", "x86"], [32, 64]),
83# b/69667484
84#    ("vm", "run_vmtests", ["arm", "x86"], [32, 64]),
85])
86