-
Notifications
You must be signed in to change notification settings - Fork 1.5k
Expand file tree
/
Copy pathvars.py
More file actions
61 lines (44 loc) · 1.5 KB
/
Copy pathvars.py
File metadata and controls
61 lines (44 loc) · 1.5 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
from __future__ import annotations
from pathlib import Path
from tasks.libs.types.arch import Arch, KMTArchName
KMT_SUPPORTED_ARCHS: list[KMTArchName] = ["x86_64", "arm64"]
VMCONFIG = "vmconfig.json"
class KMTPaths:
def __init__(self, stack: str | None, arch: Arch):
self.stack = stack
self.arch = arch
@property
def repo_root(self):
# this file is tasks/kernel_matrix_testing/vars.py, so two parents is the agent folder
return Path(__file__).parent.parent.parent
@property
def root(self):
return self.repo_root / "kmt-deps"
@property
def arch_dir(self):
return self.stack_dir / self.arch.kmt_arch
@property
def stack_dir(self):
if self.stack is None:
raise RuntimeError("no stack name provided, cannot use stack-specific paths")
return self.root / self.stack
@property
def dependencies(self):
return self.arch_dir / "opt/testing-tools"
@property
def sysprobe_tests(self):
return self.arch_dir / "opt/system-probe-tests"
@property
def secagent_tests(self):
return self.arch_dir / "opt/security-agent-tests"
@property
def tools(self):
return self.root / self.arch.kmt_arch / "tools"
@property
def test_results(self):
return self.stack_dir / "test-results"
def vm_test_results(self, vm_name: str):
return self.test_results / vm_name
@property
def gdb(self):
return self.root / self.arch.kmt_arch / "gdb"