atex 2.0.dev2__py3-none-any.whl → 2.0.dev3__py3-none-any.whl
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- atex/connection/ssh/ssh.py +9 -2
- atex/executor/beakerlib/beakerlib.py +4 -2
- atex/executor/fmf/testcontrol.py +4 -1
- atex/orchestrator/adhoc/mixins.py +12 -8
- atex/provisioner/testingfarm/api.py +17 -8
- atex/util/__init__.py +11 -43
- atex/util/null_logger.py +0 -3
- atex/util/subprocess.py +5 -1
- {atex-2.0.dev2.dist-info → atex-2.0.dev3.dist-info}/METADATA +1 -1
- {atex-2.0.dev2.dist-info → atex-2.0.dev3.dist-info}/RECORD +13 -13
- {atex-2.0.dev2.dist-info → atex-2.0.dev3.dist-info}/WHEEL +1 -1
- {atex-2.0.dev2.dist-info → atex-2.0.dev3.dist-info}/entry_points.txt +0 -0
- {atex-2.0.dev2.dist-info → atex-2.0.dev3.dist-info}/licenses/COPYING.txt +0 -0
atex/connection/ssh/ssh.py
CHANGED
|
@@ -200,6 +200,13 @@ class ManagedSSHConnection(Connection):
|
|
|
200
200
|
self._tmpdir = None
|
|
201
201
|
self._master_proc = None
|
|
202
202
|
|
|
203
|
+
def _log_unique_options(self):
|
|
204
|
+
return " ".join(
|
|
205
|
+
f"{key}={shlex.quote(str(value))}"
|
|
206
|
+
for key, value in self.options.items()
|
|
207
|
+
if key not in DEFAULT_OPTIONS or value != DEFAULT_OPTIONS[key]
|
|
208
|
+
)
|
|
209
|
+
|
|
203
210
|
def assert_master(self):
|
|
204
211
|
proc = self._master_proc
|
|
205
212
|
if not proc:
|
|
@@ -219,7 +226,7 @@ class ManagedSSHConnection(Connection):
|
|
|
219
226
|
proc = self._master_proc
|
|
220
227
|
if not proc:
|
|
221
228
|
return
|
|
222
|
-
self.logger.info(f"disconnecting: {self.
|
|
229
|
+
self.logger.info(f"disconnecting: {self._log_unique_options()}")
|
|
223
230
|
proc.kill()
|
|
224
231
|
# don't zombie forever, return EPIPE on any attempts to write to us
|
|
225
232
|
proc.stdout.close()
|
|
@@ -242,7 +249,7 @@ class ManagedSSHConnection(Connection):
|
|
|
242
249
|
sock = self._tmpdir / "control.sock"
|
|
243
250
|
|
|
244
251
|
if not self._master_proc:
|
|
245
|
-
self.logger.info(f"connecting: {self.
|
|
252
|
+
self.logger.info(f"connecting: {self._log_unique_options()}")
|
|
246
253
|
options = self.options.copy()
|
|
247
254
|
options["SessionType"] = "none"
|
|
248
255
|
options["ControlMaster"] = "yes"
|
|
@@ -44,6 +44,8 @@ class BeakerlibExecutor(FMFExecutor):
|
|
|
44
44
|
# if the passed file looks like a rlPhase* journal, skip it too
|
|
45
45
|
[[ $test_name == @(Setup|Test|Cleanup) ]] && log=
|
|
46
46
|
[[ $log == */tmp.* ]] && ! grep -qv '^$\|^::' "$log" && log=
|
|
47
|
+
# replace ASCII controls, double quotes, backslashes; preserve spaces
|
|
48
|
+
test_name=${test_name//[[:cntrl:]\"\\]/_}
|
|
47
49
|
# if log file was specified, create a files[] entry for it
|
|
48
50
|
if [[ -f $log ]]; then
|
|
49
51
|
size=$(stat -L -c '%s' "$log")
|
|
@@ -157,7 +159,7 @@ class BeakerlibExecutor(FMFExecutor):
|
|
|
157
159
|
check=True,
|
|
158
160
|
)
|
|
159
161
|
|
|
160
|
-
def run_test(self,
|
|
162
|
+
def run_test(self, test_name, artifacts, *, env=None):
|
|
161
163
|
# create BEAKERLIB_DIR, symlink metadata.yaml to it
|
|
162
164
|
quoted_dir = shlex.quote(str(self.work_dir / "beakerlib"))
|
|
163
165
|
# prepare metadata.yaml for rlImport --all
|
|
@@ -186,7 +188,7 @@ class BeakerlibExecutor(FMFExecutor):
|
|
|
186
188
|
}
|
|
187
189
|
env = beakerlib_env if env is None else env | beakerlib_env
|
|
188
190
|
|
|
189
|
-
return super().run_test(
|
|
191
|
+
return super().run_test(test_name, artifacts, env=env)
|
|
190
192
|
|
|
191
193
|
def eval_exit_code(self, test_name, reporter, exit_code): # noqa: ARG002, PLR6301
|
|
192
194
|
if reporter.nameless_result_seen:
|
atex/executor/fmf/testcontrol.py
CHANGED
|
@@ -188,7 +188,10 @@ class TestControl:
|
|
|
188
188
|
if written == 0:
|
|
189
189
|
raise BadControlError("EOF when reading data")
|
|
190
190
|
file_length -= written
|
|
191
|
-
yield
|
|
191
|
+
# yield only if there is still data left to be read next,
|
|
192
|
+
# fall through to .report() if we already read everything
|
|
193
|
+
if file_length > 0:
|
|
194
|
+
yield
|
|
192
195
|
|
|
193
196
|
self.logger.debug("file recv ended")
|
|
194
197
|
|
|
@@ -69,16 +69,20 @@ def FMFPriorityMixin(fmf_tests): # noqa: N802
|
|
|
69
69
|
def priority(name):
|
|
70
70
|
return fmf_tests.data[name].get("extra-priority", 0)
|
|
71
71
|
|
|
72
|
-
# this will be >0 if there are higher-than-0 priority tests,
|
|
73
|
-
# and <0 if there are no 0-priority tests left
|
|
74
|
-
# - in either case, we want the highest priority
|
|
75
72
|
best = max(to_run, key=priority)
|
|
76
|
-
|
|
77
|
-
return best
|
|
73
|
+
highest_prio = priority(best)
|
|
78
74
|
|
|
79
|
-
#
|
|
80
|
-
|
|
81
|
-
|
|
75
|
+
# tests with a positive prio run first; pick highest-prio one
|
|
76
|
+
if highest_prio > 0:
|
|
77
|
+
return best
|
|
78
|
+
# only zero or lower prio left, delegate any zero-prio in orig order
|
|
79
|
+
# - these must not contain non-zero-prio tests, those run after
|
|
80
|
+
elif highest_prio == 0:
|
|
81
|
+
zero_prio = [name for name in to_run if priority(name) == 0]
|
|
82
|
+
return super().next_test(zero_prio, previous)
|
|
83
|
+
# only negative priorities remain; pick highest-prio one
|
|
84
|
+
else:
|
|
85
|
+
return best
|
|
82
86
|
|
|
83
87
|
return FMFPriorityMixin
|
|
84
88
|
|
|
@@ -673,23 +673,32 @@ class Reserve:
|
|
|
673
673
|
# (it will be failing to login for a while, until the reserve test
|
|
674
674
|
# installs our ssh pubkey into authorized_keys)
|
|
675
675
|
ssh_cmd = (
|
|
676
|
-
"ssh", "-q", "-i", ssh_key.absolute(),
|
|
676
|
+
"ssh", "-q", "-i", ssh_key.absolute(),
|
|
677
677
|
"-oStrictHostKeyChecking=no", "-oUserKnownHostsFile=/dev/null",
|
|
678
|
-
"-oBatchMode=yes",
|
|
678
|
+
"-oBatchMode=yes",
|
|
679
|
+
f"{ssh_user}@{ssh_host}",
|
|
679
680
|
)
|
|
680
681
|
while True:
|
|
681
682
|
time.sleep(1)
|
|
682
683
|
self.request.assert_alive()
|
|
683
684
|
|
|
684
|
-
|
|
685
|
-
|
|
686
|
-
|
|
687
|
-
|
|
688
|
-
|
|
689
|
-
|
|
685
|
+
self.logger.info(f"request {self.request.id} trying ssh {ssh_user}@{ssh_host}")
|
|
686
|
+
try:
|
|
687
|
+
proc = subprocess.run(
|
|
688
|
+
(*ssh_cmd, "exit 123"),
|
|
689
|
+
stdout=subprocess.DEVNULL, stderr=subprocess.DEVNULL,
|
|
690
|
+
# don't get stuck in KEX after TCP is already established
|
|
691
|
+
timeout=300,
|
|
692
|
+
)
|
|
693
|
+
except subprocess.TimeoutExpired:
|
|
694
|
+
pass
|
|
695
|
+
else:
|
|
696
|
+
if proc.returncode == 123:
|
|
697
|
+
break
|
|
690
698
|
|
|
691
699
|
# run OS cleaning script (if requested)
|
|
692
700
|
if self._os_cleaning:
|
|
701
|
+
self.logger.info(f"request {self.request.id} doing os_cleaning")
|
|
693
702
|
util.subprocess_log(
|
|
694
703
|
(*ssh_cmd, "bash"),
|
|
695
704
|
logger=self.logger,
|
atex/util/__init__.py
CHANGED
|
@@ -1,43 +1,11 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
import
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
# this is the equivalent of 'from .submod import *' for all submodules
|
|
13
|
-
# (function to avoid polluting global namespace with extra variables)
|
|
14
|
-
def _import_submodules():
|
|
15
|
-
def import_obj(key, attr):
|
|
16
|
-
# do not override already processed objects (avoid duplicates)
|
|
17
|
-
assert key not in __all__, f"tried to override already-imported '{key}'"
|
|
18
|
-
globals()[key] = attr
|
|
19
|
-
__all__.append(key)
|
|
20
|
-
|
|
21
|
-
for info in pkgutil.iter_modules(__spec__.submodule_search_locations):
|
|
22
|
-
mod = importlib.import_module(f".{info.name}", __name__)
|
|
23
|
-
|
|
24
|
-
# if the module defines __all__, just use it
|
|
25
|
-
if hasattr(mod, "__all__"):
|
|
26
|
-
for key in mod.__all__:
|
|
27
|
-
import_obj(key, getattr(mod, key))
|
|
28
|
-
|
|
29
|
-
else:
|
|
30
|
-
for key in dir(mod):
|
|
31
|
-
# https://docs.python.org/3/reference/executionmodel.html#binding-of-names
|
|
32
|
-
if key.startswith("_"):
|
|
33
|
-
continue
|
|
34
|
-
# import any classes or functions which are directly defined
|
|
35
|
-
# by the module, avoiding any foreign imports
|
|
36
|
-
attr = getattr(mod, key)
|
|
37
|
-
if inspect.isroutine(attr) or inspect.isclass(attr):
|
|
38
|
-
if attr.__module__ == mod.__name__:
|
|
39
|
-
import_obj(key, attr)
|
|
40
|
-
# anything else is unsafe to import automatically
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
_import_submodules()
|
|
1
|
+
# ruff: noqa: F401
|
|
2
|
+
|
|
3
|
+
from .dedent import dedent
|
|
4
|
+
from .loggers import get_loggers
|
|
5
|
+
from .named_mapping import NamedMapping
|
|
6
|
+
from .nonblock_line_reader import BufferFullError, NonblockLineReader
|
|
7
|
+
from .null_logger import NULL_LOGGER
|
|
8
|
+
from .path import normalize_path
|
|
9
|
+
from .ssh import blocking_wait_for_sshd, default_ssh_key, ssh_keygen, wait_for_sshd
|
|
10
|
+
from .subprocess import subprocess_log, subprocess_stream
|
|
11
|
+
from .threads import ThreadJoin, ThreadJoinQueue, ThreadResult
|
atex/util/null_logger.py
CHANGED
atex/util/subprocess.py
CHANGED
|
@@ -44,7 +44,11 @@ def subprocess_stream(cmd, *, stream="stdout", check=False, input=None, **kwargs
|
|
|
44
44
|
proc.stdin.write(input)
|
|
45
45
|
except BrokenPipeError:
|
|
46
46
|
pass
|
|
47
|
-
|
|
47
|
+
# TextIOWrapper.close() may still try to write buffered data
|
|
48
|
+
try:
|
|
49
|
+
proc.stdin.close()
|
|
50
|
+
except BrokenPipeError:
|
|
51
|
+
pass
|
|
48
52
|
line_stream = getattr(proc, stream)
|
|
49
53
|
for line in line_stream:
|
|
50
54
|
yield line.rstrip("\n")
|
|
@@ -28,10 +28,10 @@ atex/connection/local/local.py,sha256=xDBGZKCGGeCR9DAKoys28CUzI4nf8xsS95Y5Va9fcZ
|
|
|
28
28
|
atex/connection/podman/__init__.py,sha256=5tjtDSwr7zOfUbi40eXqF6lGgWNwpPDiPmm86em0CEo,145
|
|
29
29
|
atex/connection/podman/podman.py,sha256=Jnct49Rwe3Go8aJihGLD65-3ToNxEP6IUcjB88ufM5I,5847
|
|
30
30
|
atex/connection/ssh/__init__.py,sha256=MXxn4FV4mf1bZzmJMCZr_StSpFUQlj-rbmQHlir8Dfs,148
|
|
31
|
-
atex/connection/ssh/ssh.py,sha256=
|
|
31
|
+
atex/connection/ssh/ssh.py,sha256=lhxU8v5vyPftrz3y_ZLRzFe68Z3jbBxmPgTtkJix4zs,12118
|
|
32
32
|
atex/executor/__init__.py,sha256=vZxJMYi-2y3pC76fdfszPFe0l4me2VDJn5rsLQhrZA8,1942
|
|
33
33
|
atex/executor/beakerlib/__init__.py,sha256=yBd9Z3Jm_8-7knicaJZNAntm2PkA6Za9pu_-RNyidKo,90
|
|
34
|
-
atex/executor/beakerlib/beakerlib.py,sha256=
|
|
34
|
+
atex/executor/beakerlib/beakerlib.py,sha256=btSbTT-cb-MnbimYPpYXEW62j8iOCZXwwYdDKa40MXM,7956
|
|
35
35
|
atex/executor/command/__init__.py,sha256=72pJqfQAXYfNnE5ucWyxxoJ8IJseAZGo9z3nOu125aM,84
|
|
36
36
|
atex/executor/command/command.py,sha256=QauXYFdlp1afcsxHOS-jMMBmCz4sWsXVtOAmm9K3Je8,2604
|
|
37
37
|
atex/executor/fmf/__init__.py,sha256=FnwU6acQMSDRMmuraAsQZ8fxBhdYVzgA91_oCfEzOR4,324
|
|
@@ -42,11 +42,11 @@ atex/executor/fmf/metadata.py,sha256=TVSIQavXIYtBdLvQI88rimzIGSH0BDDqUpZupgqjNSM
|
|
|
42
42
|
atex/executor/fmf/reporter.py,sha256=nDFsC7WjwdT-qtPq0jv6LV42BSY4IKUCOikmZ7yfF5g,9879
|
|
43
43
|
atex/executor/fmf/scripts.py,sha256=bsQWCrbfyJsrfvkTYzqaTNl3NuYzJU1DeypkXL0UtJw,5944
|
|
44
44
|
atex/executor/fmf/test-wrapper,sha256=-uzCH7d21OFzE_vyJR97WjAhCOm7e3mSMZCwKS1uCY4,4680
|
|
45
|
-
atex/executor/fmf/testcontrol.py,sha256=
|
|
45
|
+
atex/executor/fmf/testcontrol.py,sha256=kdHHvH-LNHAzzBULq-cB5IqV6cDETavtXYbA6WQJMo4,8325
|
|
46
46
|
atex/orchestrator/__init__.py,sha256=ARsLD0ysDEU8f3c4mGSE-8XQXQe9LR-Iw8UBQXRvdY8,1731
|
|
47
47
|
atex/orchestrator/adhoc/__init__.py,sha256=_FvySW7Mk3B_VfxhNRN9S-KkZ1Q8asnV9tDQqcee8ko,304
|
|
48
48
|
atex/orchestrator/adhoc/adhoc.py,sha256=HbIoDiYlnn-lk17IwGokC7dJqlTbL2Bz1wd2Q_MzkKs,18273
|
|
49
|
-
atex/orchestrator/adhoc/mixins.py,sha256=
|
|
49
|
+
atex/orchestrator/adhoc/mixins.py,sha256=9QRL1FrbH4Aurt0m1pBOEDq3ygAK4-VdQoq1k4nvO34,3820
|
|
50
50
|
atex/orchestrator/simple/__init__.py,sha256=uCF9ePCq4NtnbJpTtzcGZE1U5OuUfROFy0JurnvN5Jw,80
|
|
51
51
|
atex/orchestrator/simple/simple.py,sha256=b-z8Qa_Ee7iaEPYho-9ZBRnzKYq14tTLTkXX8zsiufI,2900
|
|
52
52
|
atex/provisioner/__init__.py,sha256=GadMQjLb7QXou_OzmMwD6G64eSaAuZYZBicZKBuupvg,2169
|
|
@@ -65,21 +65,21 @@ atex/provisioner/tempvirt/__init__.py,sha256=4waqlJwJhEeGG2fNujLJbiJXD1tRnU3Ak1k
|
|
|
65
65
|
atex/provisioner/tempvirt/tempvirt.py,sha256=KUG5uAEttcFOeVZkyAsfdkFRQfI8BOJIY08x5S5Hw8E,13394
|
|
66
66
|
atex/provisioner/tempvirt/utils.py,sha256=q0uUwRLrgxMviA_wgQZ_yu0U3rZdkOKlagcaaRgjZas,6104
|
|
67
67
|
atex/provisioner/testingfarm/__init__.py,sha256=SKBe7LhGJsjWygtKHct97ppLE8Ae-bIOpNxsr8ywlQg,169
|
|
68
|
-
atex/provisioner/testingfarm/api.py,sha256=
|
|
68
|
+
atex/provisioner/testingfarm/api.py,sha256=nWpyiT7myV7wf02PLzIULJMgLuo1ABM-h6CqEZI0GoI,26956
|
|
69
69
|
atex/provisioner/testingfarm/cleaning.sh,sha256=JkZE9iQeD3PuGei-d78lO0Au78OsU3i80ojvfRwWmwA,7825
|
|
70
70
|
atex/provisioner/testingfarm/testingfarm.py,sha256=109K130kTwjf32mg2ItGB64Y2xlFG6k3lRbYKV6VX80,9688
|
|
71
|
-
atex/util/__init__.py,sha256=
|
|
71
|
+
atex/util/__init__.py,sha256=j7VotvUlCA6oelFYNNWSdSQyr9gc1x231V4vHUf1L6U,465
|
|
72
72
|
atex/util/dedent.py,sha256=q6iSCt0382DeBS5fr96p_RTdK_-hGY6_Rk2MHYUr5zs,607
|
|
73
73
|
atex/util/loggers.py,sha256=QGejMvbVZ7RJdx9kaKBdKuo3oJBQTkKAV-1QiycCCQM,926
|
|
74
74
|
atex/util/named_mapping.py,sha256=7X1tbLWWX5YDldG-L29fXpRuADJx46F_a2e3f9uJiyU,4760
|
|
75
75
|
atex/util/nonblock_line_reader.py,sha256=iRbiVR7rcab0Iw48joB0sKp5n6G0ZmL1HZZ7d3X_SPc,2554
|
|
76
|
-
atex/util/null_logger.py,sha256=
|
|
76
|
+
atex/util/null_logger.py,sha256=iVzIrP5uz3Ec54I6a-enaakZe0HArylP9A1HDkZNJps,379
|
|
77
77
|
atex/util/path.py,sha256=60gVI-9VenMLPneavdQVm3FvfBVzG8EbxFjProbPiSM,528
|
|
78
78
|
atex/util/ssh.py,sha256=kWrJ1W8dpMEJbz4deQr7RHI28fpeHy0qj898fZSE8nc,4380
|
|
79
|
-
atex/util/subprocess.py,sha256=
|
|
79
|
+
atex/util/subprocess.py,sha256=78MXHu_4ukr-2XAkcjSw0hoDG9g-BANz-v5v6cNPjB8,2498
|
|
80
80
|
atex/util/threads.py,sha256=00TwG3Ed1JfbYcwkTtfoUIFaOw_05_79SZBrfhz4T2I,5809
|
|
81
|
-
atex-2.0.
|
|
82
|
-
atex-2.0.
|
|
83
|
-
atex-2.0.
|
|
84
|
-
atex-2.0.
|
|
85
|
-
atex-2.0.
|
|
81
|
+
atex-2.0.dev3.dist-info/METADATA,sha256=JLCjiHersdARYPLsjcZeun8-34A9F7OS5tcH2QYsCJw,5707
|
|
82
|
+
atex-2.0.dev3.dist-info/WHEEL,sha256=2iZrJkDIkeDh0k9SikKMqFuRP-ua6mb4Ir1AsER4BEw,87
|
|
83
|
+
atex-2.0.dev3.dist-info/entry_points.txt,sha256=pLqJdcfeyQTgup2h6dWb6SvkHhtOl-W5Eg9zV8moK0o,39
|
|
84
|
+
atex-2.0.dev3.dist-info/licenses/COPYING.txt,sha256=oEuj51jdmbXcCUy7pZ-KE0BNcJTR1okudRp5zQ0yWnU,670
|
|
85
|
+
atex-2.0.dev3.dist-info/RECORD,,
|
|
File without changes
|
|
File without changes
|