Skip to content

Commit 510c369

Browse files
committed
judge: add startup message for landlock
1 parent f345496 commit 510c369

File tree

3 files changed

+12
-1
lines changed

3 files changed

+12
-1
lines changed

dmoj/citest.py

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,12 +6,18 @@
66

77
from dmoj import judgeenv
88
from dmoj.contrib import load_contrib_modules
9+
from dmoj.cptbox import has_landlock
910
from dmoj.executors import executors
1011
from dmoj.testsuite import Tester
1112
from dmoj.utils.ansi import print_ansi
1213

1314

1415
def ci_test(executors_to_test, overrides, allow_fail=frozenset()):
16+
if has_landlock():
17+
print('Running CI with landlock and seccomp...')
18+
else:
19+
print('Running CI with just seccomp...')
20+
1521
result = {}
1622
failed = False
1723
failed_executors = []

dmoj/cptbox/__init__.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@
66
PTBOX_ABI_X32,
77
PTBOX_ABI_X64,
88
PTBOX_ABI_X86,
9+
has_landlock,
910
)
1011
from dmoj.cptbox.handlers import ALLOW, DISALLOW
1112
from dmoj.cptbox.isolate import FilesystemSyscallKind, IsolateTracer

dmoj/judge.py

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,7 @@
1414

1515
from dmoj import packet
1616
from dmoj.control import JudgeControlRequestHandler
17+
from dmoj.cptbox import has_landlock
1718
from dmoj.error import CompileError
1819
from dmoj.judgeenv import clear_problem_dirs_cache, env, get_supported_problems_and_mtimes, startup_warnings
1920
from dmoj.monitor import Monitor
@@ -592,7 +593,10 @@ def main(): # pragma: no cover
592593
executors.load_executors()
593594
contrib.load_contrib_modules()
594595

595-
print('Running live judge...')
596+
if has_landlock():
597+
print('Running live judge with landlock and seccomp...')
598+
else:
599+
print('Running live judge with just seccomp...')
596600

597601
for warning in judgeenv.startup_warnings:
598602
print_ansi('#ansi[Warning: %s](yellow)' % warning)

0 commit comments

Comments
 (0)