atex 0.1__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/__init__.py +35 -0
- atex/cli/__init__.py +83 -0
- atex/cli/testingfarm.py +171 -0
- atex/fmf.py +168 -0
- atex/minitmt/__init__.py +109 -0
- atex/minitmt/report.py +174 -0
- atex/minitmt/scripts.py +51 -0
- atex/minitmt/testme.py +3 -0
- atex/orchestrator.py +38 -0
- atex/provision/__init__.py +113 -0
- atex/provision/libvirt/VM_PROVISION +51 -0
- atex/provision/libvirt/__init__.py +23 -0
- atex/provision/libvirt/setup-libvirt.sh +72 -0
- atex/ssh.py +320 -0
- atex/testingfarm.py +523 -0
- atex/util/__init__.py +49 -0
- atex/util/dedent.py +25 -0
- atex/util/lockable_class.py +38 -0
- atex/util/log.py +53 -0
- atex/util/subprocess.py +51 -0
- atex-0.1.dist-info/METADATA +11 -0
- atex-0.1.dist-info/RECORD +25 -0
- atex-0.1.dist-info/WHEEL +4 -0
- atex-0.1.dist-info/entry_points.txt +2 -0
- atex-0.1.dist-info/licenses/COPYING.txt +14 -0
atex/util/subprocess.py
ADDED
|
@@ -0,0 +1,51 @@
|
|
|
1
|
+
import subprocess
|
|
2
|
+
|
|
3
|
+
from .log import debug
|
|
4
|
+
|
|
5
|
+
|
|
6
|
+
def _format_subprocess_cmd(cmd):
|
|
7
|
+
return cmd
|
|
8
|
+
# if isinstance(cmd, (list, tuple)):
|
|
9
|
+
# return ' '.join(str(x) for x in cmd)
|
|
10
|
+
# else:
|
|
11
|
+
# return cmd
|
|
12
|
+
|
|
13
|
+
|
|
14
|
+
def subprocess_run(cmd, *, skip_frames=0, **kwargs):
|
|
15
|
+
"""
|
|
16
|
+
A simple wrapper for the real subprocess.run() that logs the command used.
|
|
17
|
+
"""
|
|
18
|
+
# when logging, skip current stack frame - report the place we were called
|
|
19
|
+
# from, not util.subprocess_run itself
|
|
20
|
+
debug(f'running: {_format_subprocess_cmd(cmd)}', skip_frames=skip_frames+1)
|
|
21
|
+
return subprocess.run(cmd, **kwargs)
|
|
22
|
+
|
|
23
|
+
|
|
24
|
+
def subprocess_Popen(cmd, *, skip_frames=0, **kwargs): # noqa: N802
|
|
25
|
+
"""
|
|
26
|
+
A simple wrapper for the real subprocess.Popen() that logs the command used.
|
|
27
|
+
"""
|
|
28
|
+
debug(f'running: {_format_subprocess_cmd(cmd)}', skip_frames=skip_frames+1)
|
|
29
|
+
return subprocess.Popen(cmd, **kwargs)
|
|
30
|
+
|
|
31
|
+
|
|
32
|
+
def subprocess_stream(cmd, *, check=False, skip_frames=0, **kwargs):
|
|
33
|
+
"""
|
|
34
|
+
Run 'cmd' via subprocess.Popen() and return an iterator over any lines
|
|
35
|
+
the command outputs on stdout, in text mode.
|
|
36
|
+
|
|
37
|
+
With 'check' set to True, raise a CalledProcessError if the 'cmd' failed.
|
|
38
|
+
|
|
39
|
+
To capture both stdout and stderr as yielded lines, use subprocess.STDOUT.
|
|
40
|
+
"""
|
|
41
|
+
debug(f'running: {_format_subprocess_cmd(cmd)}', skip_frames=skip_frames+1)
|
|
42
|
+
proc = subprocess.Popen(cmd, stdout=subprocess.PIPE, universal_newlines=True, **kwargs)
|
|
43
|
+
|
|
44
|
+
def generate_lines():
|
|
45
|
+
for line in proc.stdout:
|
|
46
|
+
yield line.rstrip('\n')
|
|
47
|
+
code = proc.wait()
|
|
48
|
+
if code > 0 and check:
|
|
49
|
+
raise subprocess.CalledProcessError(cmd=cmd, returncode=code)
|
|
50
|
+
|
|
51
|
+
return (proc, generate_lines())
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
Metadata-Version: 2.4
|
|
2
|
+
Name: atex
|
|
3
|
+
Version: 0.1
|
|
4
|
+
License-Expression: GPL-3.0-or-later
|
|
5
|
+
License-File: COPYING.txt
|
|
6
|
+
Classifier: Operating System :: POSIX :: Linux
|
|
7
|
+
Classifier: Programming Language :: Python :: 3
|
|
8
|
+
Classifier: Topic :: Software Development :: Testing
|
|
9
|
+
Requires-Python: >=3.9
|
|
10
|
+
Requires-Dist: fmf>=1.6
|
|
11
|
+
Requires-Dist: urllib3<3,>=2
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
atex/__init__.py,sha256=YyU5HzPiApngH_ZS7d5MhqpPvNgFXi7FpXWnkdhtQ1A,859
|
|
2
|
+
atex/fmf.py,sha256=HEpjCVyPeX7ImebL0u5d2wETYLCnLcz41FtGJXigCrU,6252
|
|
3
|
+
atex/orchestrator.py,sha256=SqP07lsjBImdGN4E5jd816nvcHQxd0b0SMnJDy7KkLA,1083
|
|
4
|
+
atex/ssh.py,sha256=HUkNAgDyR394wertZ7QxgkqMEnjSS0G1xq14CsuYUQI,10188
|
|
5
|
+
atex/testingfarm.py,sha256=t3AuOMpa_BiTOv4pzoDVGNIl1Vz0BlYBJ_AMxBzcpZE,18332
|
|
6
|
+
atex/cli/__init__.py,sha256=hahfD6XqsS4GwvJ1Ou_WpEtR4xcC5IUq-rG11xGhLDU,2406
|
|
7
|
+
atex/cli/testingfarm.py,sha256=0C5I15DBggCnp4xvxgkRigzKUSl7quSmHrO4UxzWnfg,5301
|
|
8
|
+
atex/minitmt/__init__.py,sha256=1Wbu6eI1o2JTO99SvwJXhndMZDUlZJRguq6iTmG9vwg,4043
|
|
9
|
+
atex/minitmt/report.py,sha256=AyZG5yDBhe8ajAjpwJhdms4f-CeFbXO6L9sibN65-wU,6036
|
|
10
|
+
atex/minitmt/scripts.py,sha256=41DmyAwId5OAiP9g1VjslNaJ6iz2bCXaqBrHS3uZN7g,1620
|
|
11
|
+
atex/minitmt/testme.py,sha256=aVh9Kjjenr8Q52x3nOhBFx6bGnxpM-amoVw-2JGvZVo,39
|
|
12
|
+
atex/provision/__init__.py,sha256=2haBx9lPk0FHpYxykzfSwKkFLsaAcBjRCLoJE82hpT8,4029
|
|
13
|
+
atex/provision/libvirt/VM_PROVISION,sha256=1OwGC8fEA74RaCC2yyWSnnML-QXlB_cPzhTxjsXofsQ,2469
|
|
14
|
+
atex/provision/libvirt/__init__.py,sha256=8gq97DIvrWRy6EInxaHGvlj5hefAlrP6qC-YKNdBoyM,786
|
|
15
|
+
atex/provision/libvirt/setup-libvirt.sh,sha256=CXrEFdrj8CSHXQZCd2RWuRvTmw7QYFTVhZeLuhhXooI,1855
|
|
16
|
+
atex/util/__init__.py,sha256=mejFs_IHvKqnuOA5xt60CWzX6fJ4VVx8T1kl1zuv5Vg,1550
|
|
17
|
+
atex/util/dedent.py,sha256=uJYXKsEQECbJ58eqZFI5Bzlld0lD-C15NUcqRnvrLa4,603
|
|
18
|
+
atex/util/lockable_class.py,sha256=hPuiPaUBUD-9bKLzaYYOrQ6JwLjk2zCzCkW8nm6SKpQ,1317
|
|
19
|
+
atex/util/log.py,sha256=tQp4JZY1B4bca5CciscV4Q5ZsyKS2niOQb9_Vco_QOA,1776
|
|
20
|
+
atex/util/subprocess.py,sha256=IWrwke4JylL6-jQoNMXnzKG4MVxbc9m6Q4wJVy4EBCM,1700
|
|
21
|
+
atex-0.1.dist-info/METADATA,sha256=306skMTWL8oSkcUYmKI7MuwU0aLRaAF22hQ6c2XnsHg,333
|
|
22
|
+
atex-0.1.dist-info/WHEEL,sha256=qtCwoSJWgHk21S1Kb4ihdzI2rlJ1ZKaIurTj_ngOhyQ,87
|
|
23
|
+
atex-0.1.dist-info/entry_points.txt,sha256=pLqJdcfeyQTgup2h6dWb6SvkHhtOl-W5Eg9zV8moK0o,39
|
|
24
|
+
atex-0.1.dist-info/licenses/COPYING.txt,sha256=oEuj51jdmbXcCUy7pZ-KE0BNcJTR1okudRp5zQ0yWnU,670
|
|
25
|
+
atex-0.1.dist-info/RECORD,,
|
atex-0.1.dist-info/WHEEL
ADDED
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
Copyright (C) 2025 Red Hat, Inc. <https://redhat.com/>
|
|
2
|
+
|
|
3
|
+
This program is free software: you can redistribute it and/or modify
|
|
4
|
+
it under the terms of the GNU General Public License as published by
|
|
5
|
+
the Free Software Foundation, either version 3 of the License, or
|
|
6
|
+
(at your option) any later version.
|
|
7
|
+
|
|
8
|
+
This program is distributed in the hope that it will be useful,
|
|
9
|
+
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
10
|
+
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
|
11
|
+
GNU General Public License for more details.
|
|
12
|
+
|
|
13
|
+
You should have received a copy of the GNU General Public License
|
|
14
|
+
along with this program. If not, see <https://www.gnu.org/licenses/>.
|