statbtrfs 0.36__tar.gz → 0.38__tar.gz
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.
- {statbtrfs-0.36/statbtrfs.egg-info → statbtrfs-0.38}/PKG-INFO +20 -3
- {statbtrfs-0.36 → statbtrfs-0.38}/README.txt +18 -1
- {statbtrfs-0.36 → statbtrfs-0.38}/setup.py +1 -1
- {statbtrfs-0.36 → statbtrfs-0.38/statbtrfs.egg-info}/PKG-INFO +20 -3
- {statbtrfs-0.36 → statbtrfs-0.38}/statbtrfs.egg-info/SOURCES.txt +1 -0
- {statbtrfs-0.36 → statbtrfs-0.38}/statbtrfs.egg-info/requires.txt +1 -1
- {statbtrfs-0.36 → statbtrfs-0.38}/statbtrfs.py +223 -171
- statbtrfs-0.38/tests/test_broken_pipe.py +51 -0
- {statbtrfs-0.36 → statbtrfs-0.38}/tests/test_cli.py +48 -0
- {statbtrfs-0.36 → statbtrfs-0.38}/tests/test_filesystems.py +2 -3
- {statbtrfs-0.36 → statbtrfs-0.38}/tests/test_filter_recent.py +2 -2
- statbtrfs-0.38/tests/test_import_seams.py +17 -0
- statbtrfs-0.38/tests/test_live.py +16 -0
- {statbtrfs-0.36 → statbtrfs-0.38}/tests/test_mounts.py +3 -11
- {statbtrfs-0.36 → statbtrfs-0.38}/tests/test_parse_show.py +2 -5
- {statbtrfs-0.36 → statbtrfs-0.38}/tests/test_scrub_orchestration.py +13 -0
- statbtrfs-0.36/tests/test_import_seams.py +0 -56
- statbtrfs-0.36/tests/test_live.py +0 -39
- {statbtrfs-0.36 → statbtrfs-0.38}/LICENSE +0 -0
- {statbtrfs-0.36 → statbtrfs-0.38}/setup.cfg +0 -0
- {statbtrfs-0.36 → statbtrfs-0.38}/statbtrfs.egg-info/dependency_links.txt +0 -0
- {statbtrfs-0.36 → statbtrfs-0.38}/statbtrfs.egg-info/entry_points.txt +0 -0
- {statbtrfs-0.36 → statbtrfs-0.38}/statbtrfs.egg-info/top_level.txt +0 -0
- {statbtrfs-0.36 → statbtrfs-0.38}/tests/test_color.py +0 -0
- {statbtrfs-0.36 → statbtrfs-0.38}/tests/test_options.py +0 -0
- {statbtrfs-0.36 → statbtrfs-0.38}/tests/test_output.py +0 -0
- {statbtrfs-0.36 → statbtrfs-0.38}/tests/test_parse_scrub.py +0 -0
- {statbtrfs-0.36 → statbtrfs-0.38}/tests/test_parse_stats.py +0 -0
- {statbtrfs-0.36 → statbtrfs-0.38}/tests/test_privileges.py +0 -0
- {statbtrfs-0.36 → statbtrfs-0.38}/tests/test_watch.py +0 -0
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.4
|
|
2
2
|
Name: statbtrfs
|
|
3
|
-
Version: 0.
|
|
3
|
+
Version: 0.38
|
|
4
4
|
Summary: Query Btrfs filesystem status
|
|
5
5
|
Home-page: https://github.com/yufei-pan/statbtrfs
|
|
6
6
|
Author: Yufei Pan
|
|
@@ -12,7 +12,7 @@ Classifier: Operating System :: POSIX :: Linux
|
|
|
12
12
|
Requires-Python: >=3.6
|
|
13
13
|
Description-Content-Type: text/plain
|
|
14
14
|
License-File: LICENSE
|
|
15
|
-
Requires-Dist: multiCMD>=1.
|
|
15
|
+
Requires-Dist: multiCMD>=1.56
|
|
16
16
|
Provides-Extra: completion
|
|
17
17
|
Requires-Dist: argcomplete; extra == "completion"
|
|
18
18
|
Dynamic: author
|
|
@@ -56,7 +56,24 @@ options:
|
|
|
56
56
|
-V, --version show program's version number and exit
|
|
57
57
|
|
|
58
58
|
Exit status: 0 healthy; 1 problems found (device errors, scrub errors or missing devices); 2 the
|
|
59
|
-
check failed (no matching mounts, an unreadable filesystem, no root); 130 interrupted
|
|
59
|
+
check failed (no matching mounts, an unreadable filesystem, no root); 130 interrupted; 141 the
|
|
60
|
+
reader of stdout went away (| head).
|
|
61
|
+
|
|
62
|
+
Known limitation: when each btrfs command has to run through sudo, a missing btrfs shows as "Could not fetch
|
|
63
|
+
complete info … Skipping…" rather than "btrfs not found on PATH" (see docs/limitations.md).
|
|
64
|
+
|
|
65
|
+
Upgrading to 0.38 from 0.37:
|
|
66
|
+
- multiCMD 1.56 or newer is required (the embedded copy is 1.56).
|
|
67
|
+
- An unreadable filesystem now prints only the note under the table, "Could not fetch complete info for
|
|
68
|
+
<mounts>. Skipping...". The three lines before it ("Could not parse btrfs show info.", "Output from btrfs
|
|
69
|
+
filesystem show was:" and the raw output) are gone.
|
|
70
|
+
- statbtrfs | head, or any reader that exits early, now ends quietly with exit 141 (128 + SIGPIPE)
|
|
71
|
+
instead of a BrokenPipeError traceback and exit 1.
|
|
72
|
+
- Ctrl-C outside -s and -w (say while btrfs hangs on a dying device) exits 130 quietly instead of a
|
|
73
|
+
traceback.
|
|
74
|
+
- -s and -w clear the screen with ESC[H ESC[J, so a long run no longer pushes tables into the scrollback of
|
|
75
|
+
terminals that treat ESC[2J that way.
|
|
76
|
+
- Library callers: find_btrfs_mounts() takes no argument and execute_command(s) lose wait=.
|
|
60
77
|
|
|
61
78
|
Install:
|
|
62
79
|
sudo pip install statbtrfs
|
|
@@ -26,7 +26,24 @@ options:
|
|
|
26
26
|
-V, --version show program's version number and exit
|
|
27
27
|
|
|
28
28
|
Exit status: 0 healthy; 1 problems found (device errors, scrub errors or missing devices); 2 the
|
|
29
|
-
check failed (no matching mounts, an unreadable filesystem, no root); 130 interrupted
|
|
29
|
+
check failed (no matching mounts, an unreadable filesystem, no root); 130 interrupted; 141 the
|
|
30
|
+
reader of stdout went away (| head).
|
|
31
|
+
|
|
32
|
+
Known limitation: when each btrfs command has to run through sudo, a missing btrfs shows as "Could not fetch
|
|
33
|
+
complete info … Skipping…" rather than "btrfs not found on PATH" (see docs/limitations.md).
|
|
34
|
+
|
|
35
|
+
Upgrading to 0.38 from 0.37:
|
|
36
|
+
- multiCMD 1.56 or newer is required (the embedded copy is 1.56).
|
|
37
|
+
- An unreadable filesystem now prints only the note under the table, "Could not fetch complete info for
|
|
38
|
+
<mounts>. Skipping...". The three lines before it ("Could not parse btrfs show info.", "Output from btrfs
|
|
39
|
+
filesystem show was:" and the raw output) are gone.
|
|
40
|
+
- statbtrfs | head, or any reader that exits early, now ends quietly with exit 141 (128 + SIGPIPE)
|
|
41
|
+
instead of a BrokenPipeError traceback and exit 1.
|
|
42
|
+
- Ctrl-C outside -s and -w (say while btrfs hangs on a dying device) exits 130 quietly instead of a
|
|
43
|
+
traceback.
|
|
44
|
+
- -s and -w clear the screen with ESC[H ESC[J, so a long run no longer pushes tables into the scrollback of
|
|
45
|
+
terminals that treat ESC[2J that way.
|
|
46
|
+
- Library callers: find_btrfs_mounts() takes no argument and execute_command(s) lose wait=.
|
|
30
47
|
|
|
31
48
|
Install:
|
|
32
49
|
sudo pip install statbtrfs
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.4
|
|
2
2
|
Name: statbtrfs
|
|
3
|
-
Version: 0.
|
|
3
|
+
Version: 0.38
|
|
4
4
|
Summary: Query Btrfs filesystem status
|
|
5
5
|
Home-page: https://github.com/yufei-pan/statbtrfs
|
|
6
6
|
Author: Yufei Pan
|
|
@@ -12,7 +12,7 @@ Classifier: Operating System :: POSIX :: Linux
|
|
|
12
12
|
Requires-Python: >=3.6
|
|
13
13
|
Description-Content-Type: text/plain
|
|
14
14
|
License-File: LICENSE
|
|
15
|
-
Requires-Dist: multiCMD>=1.
|
|
15
|
+
Requires-Dist: multiCMD>=1.56
|
|
16
16
|
Provides-Extra: completion
|
|
17
17
|
Requires-Dist: argcomplete; extra == "completion"
|
|
18
18
|
Dynamic: author
|
|
@@ -56,7 +56,24 @@ options:
|
|
|
56
56
|
-V, --version show program's version number and exit
|
|
57
57
|
|
|
58
58
|
Exit status: 0 healthy; 1 problems found (device errors, scrub errors or missing devices); 2 the
|
|
59
|
-
check failed (no matching mounts, an unreadable filesystem, no root); 130 interrupted
|
|
59
|
+
check failed (no matching mounts, an unreadable filesystem, no root); 130 interrupted; 141 the
|
|
60
|
+
reader of stdout went away (| head).
|
|
61
|
+
|
|
62
|
+
Known limitation: when each btrfs command has to run through sudo, a missing btrfs shows as "Could not fetch
|
|
63
|
+
complete info … Skipping…" rather than "btrfs not found on PATH" (see docs/limitations.md).
|
|
64
|
+
|
|
65
|
+
Upgrading to 0.38 from 0.37:
|
|
66
|
+
- multiCMD 1.56 or newer is required (the embedded copy is 1.56).
|
|
67
|
+
- An unreadable filesystem now prints only the note under the table, "Could not fetch complete info for
|
|
68
|
+
<mounts>. Skipping...". The three lines before it ("Could not parse btrfs show info.", "Output from btrfs
|
|
69
|
+
filesystem show was:" and the raw output) are gone.
|
|
70
|
+
- statbtrfs | head, or any reader that exits early, now ends quietly with exit 141 (128 + SIGPIPE)
|
|
71
|
+
instead of a BrokenPipeError traceback and exit 1.
|
|
72
|
+
- Ctrl-C outside -s and -w (say while btrfs hangs on a dying device) exits 130 quietly instead of a
|
|
73
|
+
traceback.
|
|
74
|
+
- -s and -w clear the screen with ESC[H ESC[J, so a long run no longer pushes tables into the scrollback of
|
|
75
|
+
terminals that treat ESC[2J that way.
|
|
76
|
+
- Library callers: find_btrfs_mounts() takes no argument and execute_command(s) lose wait=.
|
|
60
77
|
|
|
61
78
|
Install:
|
|
62
79
|
sudo pip install statbtrfs
|
|
@@ -14,158 +14,196 @@ from collections import namedtuple
|
|
|
14
14
|
from datetime import datetime
|
|
15
15
|
try:
|
|
16
16
|
import multiCMD # type: ignore
|
|
17
|
-
if tuple(int(x) for x in multiCMD.version.split('.')) < (1,
|
|
17
|
+
if tuple(int(x) for x in multiCMD.version.split('.')) < (1, 56):
|
|
18
18
|
raise ImportError('multiCMD too old')
|
|
19
19
|
except (ImportError, AttributeError, ValueError):
|
|
20
20
|
import sys,types,base64,lzma # noqa: E401
|
|
21
21
|
multiCMD = types.ModuleType("multiCMD")
|
|
22
22
|
sys.modules["multiCMD"] = multiCMD
|
|
23
23
|
_SRC_B85=r'''
|
|
24
|
-
rAT%)=o\O*k16n/!WXAE'
|
|
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
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
[
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
`
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
]
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
+
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
)
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
Z
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
Z
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
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l':ja"UQ;:T6]hV8p7UJQNaV*6GKC=j.l,V6G2@HTEf5]a:UYt3b9AT4eWF;6rN'nQ$pDmjl%4SY#Jcl?QfF^qE`=`8MZ:OCL
|
|
200
|
+
-@kT5/W&@MQE/]_u#i,JY2O9c]7-\*"$GHi'pr#*/^HE1.RQq*'67oPU%u1fW.f77iCmJ,r^+1mj\"/6#m8SUKuq\"9/_5^DOgtW^1,!kl+[o3aK*lg,
|
|
201
|
+
;/)1:BR#5+d?he^9q'"ko/gM]iUamj7eAoc[k.8;'HKrqpFb+QlJ9f/8\VV"AnmRdcSO$pVI@/ZX>2C90ZjX=cDVRTU$<IhGYq:KP<!'V#N*nqU5Y5s<
|
|
202
|
+
CLljLKdn/G[02Y;;Zfb)uFOuhq=\qc$sEDpFlB-pB>e!O$27\5n9&2K)J(]Q2$L'Xa9E%ul"VMoUO?M8UcUtV*ZciI41J!C/5=+\@i&MipidHI&R`WN4
|
|
203
|
+
6,EDg)R;^Qe&2cNV!!2,2!U8&8s)4"iZ,C;P!WW3#!!HG.'''
|
|
166
204
|
exec(lzma.decompress(base64.a85decode(_SRC_B85)).decode("utf-8"), multiCMD.__dict__)
|
|
167
205
|
|
|
168
|
-
version='0.
|
|
206
|
+
version='0.38'
|
|
169
207
|
__version__ = version
|
|
170
208
|
|
|
171
209
|
# -s runs for hours, often into a log: don't let output sit in a buffer.
|
|
@@ -174,7 +212,8 @@ print = functools.partial(print, flush=True)
|
|
|
174
212
|
EXIT_OK = 0 # healthy
|
|
175
213
|
EXIT_PROBLEMS = 1 # device errors, scrub errors or missing devices found
|
|
176
214
|
EXIT_FAILURE = 2 # could not check: no mounts, unreadable filesystem, no root
|
|
177
|
-
EXIT_INTERRUPTED = 130 # Ctrl-C
|
|
215
|
+
EXIT_INTERRUPTED = 130 # Ctrl-C
|
|
216
|
+
EXIT_PIPE_CLOSED = 141 # the reader went away (`statbtrfs | head`): 128 + SIGPIPE, as a shell reports it, and as statblk does
|
|
178
217
|
|
|
179
218
|
# Colors (set_color(False) blanks them)
|
|
180
219
|
_ANSI_COLORS = ("\033[91m", "\033[92m", "\033[93m", "\033[0m")
|
|
@@ -192,7 +231,7 @@ def set_color(enabled):
|
|
|
192
231
|
global RED, GREEN, YELLOW, RESET
|
|
193
232
|
RED, GREEN, YELLOW, RESET = _ANSI_COLORS if enabled else ("",) * 4
|
|
194
233
|
|
|
195
|
-
CLEAR_SCREEN = "\033[H\033[
|
|
234
|
+
CLEAR_SCREEN = "\033[H\033[J"
|
|
196
235
|
EVENT_LINES = 10
|
|
197
236
|
|
|
198
237
|
class Screen:
|
|
@@ -251,15 +290,20 @@ def acquire_root(argv):
|
|
|
251
290
|
os.execv(sudo, [sudo, '--'] + command)
|
|
252
291
|
USE_SUDO = True
|
|
253
292
|
|
|
254
|
-
def execute_command(command
|
|
293
|
+
def execute_command(command):
|
|
255
294
|
if USE_SUDO:
|
|
256
295
|
command = ['sudo'] + command
|
|
257
|
-
return multiCMD.run_command(command,quiet=True
|
|
296
|
+
return multiCMD.run_command(command,quiet=True)
|
|
258
297
|
|
|
259
|
-
def execute_commands(commands
|
|
298
|
+
def execute_commands(commands):
|
|
260
299
|
if USE_SUDO:
|
|
261
300
|
commands = [['sudo']+command for command in commands]
|
|
262
|
-
return multiCMD.run_commands(commands,quiet=True,
|
|
301
|
+
return multiCMD.run_commands(commands,quiet=True,max_threads=MAX_PARALLEL_COMMANDS)
|
|
302
|
+
|
|
303
|
+
def btrfs_not_found():
|
|
304
|
+
"""Whether btrfs is missing from PATH (multiCMD's quiet=True hides its own "Command path not found"
|
|
305
|
+
line). Behind the per-command sudo fallback, sudo's own PATH decides: not checked."""
|
|
306
|
+
return not USE_SUDO and shutil.which('btrfs') is None
|
|
263
307
|
|
|
264
308
|
PROC_MOUNTS = '/proc/self/mounts'
|
|
265
309
|
_MOUNT_ESCAPE_RX = re.compile(r'\\([0-7]{3})')
|
|
@@ -281,16 +325,9 @@ def parse_proc_mounts(lines):
|
|
|
281
325
|
mounts.append(_MOUNT_ESCAPE_RX.sub(lambda m: chr(int(m.group(1), 8)), fields[1]))
|
|
282
326
|
return mounts
|
|
283
327
|
|
|
284
|
-
def find_btrfs_mounts(
|
|
285
|
-
"""Sorted btrfs mountpoints
|
|
286
|
-
|
|
287
|
-
btrfs_mounts = set()
|
|
288
|
-
if filters:
|
|
289
|
-
for pattern in filters:
|
|
290
|
-
btrfs_mounts.update(fnmatch.filter(mount_list, f'*{pattern}*'))
|
|
291
|
-
else:
|
|
292
|
-
btrfs_mounts.update(mount_list)
|
|
293
|
-
return sorted(btrfs_mounts)
|
|
328
|
+
def find_btrfs_mounts():
|
|
329
|
+
"""Sorted btrfs mountpoints."""
|
|
330
|
+
return sorted(set(parse_proc_mounts(read_proc_mounts())))
|
|
294
331
|
|
|
295
332
|
def discover_filesystems(mounts):
|
|
296
333
|
"""Group mountpoints into filesystems by UUID: [{'uuid': str | None, 'mounts': [...]}].
|
|
@@ -298,8 +335,6 @@ def discover_filesystems(mounts):
|
|
|
298
335
|
Subvolume mounts of one filesystem share its UUID, and status and scrub are per filesystem.
|
|
299
336
|
A mount whose UUID can't be read stays on its own (uuid None)."""
|
|
300
337
|
mounts = list(mounts)
|
|
301
|
-
if not mounts:
|
|
302
|
-
return []
|
|
303
338
|
shows = execute_commands([["btrfs", "filesystem", "show", mount] for mount in mounts])
|
|
304
339
|
filesystems = []
|
|
305
340
|
by_uuid = {}
|
|
@@ -330,7 +365,7 @@ _SHOW_TOTAL_RX = re.compile(r'^\s*Total devices\s+(\d+)\s+FS bytes used\s+(\S+)'
|
|
|
330
365
|
_SHOW_DEVID_RX = re.compile(r'^\s*devid\s+\d+\s+size\s+\S+\s+used\s+\S+\s+path\s+(.+?)\s*$')
|
|
331
366
|
|
|
332
367
|
def parse_show_uuid(info):
|
|
333
|
-
for line in info
|
|
368
|
+
for line in info:
|
|
334
369
|
if line.startswith("Label:"):
|
|
335
370
|
match = _SHOW_UUID_RX.search(line)
|
|
336
371
|
if match:
|
|
@@ -362,9 +397,6 @@ def parse_show_info(info):
|
|
|
362
397
|
some_missing = True
|
|
363
398
|
missing = max(marked_missing, (total_devices or 0) - len(device_paths), int(some_missing))
|
|
364
399
|
device_path = ", ".join(device_paths) if device_paths else None
|
|
365
|
-
if fs_used is None or device_path is None or uuid is None:
|
|
366
|
-
print(f"{RED}Could not parse btrfs show info.{RESET}")
|
|
367
|
-
print(f"Output from btrfs filesystem show was:\n{info}")
|
|
368
400
|
return uuid, fs_used, device_path, missing
|
|
369
401
|
|
|
370
402
|
def format_device_path(device_path, missing):
|
|
@@ -467,9 +499,9 @@ def filter_recently_scrubbed(filesystems, exclude_recent_days):
|
|
|
467
499
|
kept = []
|
|
468
500
|
skipped = []
|
|
469
501
|
|
|
470
|
-
outputs = execute_commands([["btrfs", "scrub", "status", fs['mounts'][0]] for fs in filesystems])
|
|
502
|
+
outputs = execute_commands([["btrfs", "scrub", "status", fs['mounts'][0]] for fs in filesystems])
|
|
471
503
|
for fs, scrub_output in zip(filesystems, outputs):
|
|
472
|
-
scrub_data = parse_scrub_status(scrub_output
|
|
504
|
+
scrub_data = parse_scrub_status(scrub_output)
|
|
473
505
|
scrub_status = scrub_data.get("scrub_status", "").strip().lower()
|
|
474
506
|
scrub_time_epoch = parse_scrub_time_to_epoch(scrub_data["scrub_time"])
|
|
475
507
|
|
|
@@ -494,7 +526,7 @@ def poll_filesystems(filesystems):
|
|
|
494
526
|
["btrfs", "device", "stats", mount],
|
|
495
527
|
["btrfs", "scrub", "status", mount],
|
|
496
528
|
]
|
|
497
|
-
outputs =
|
|
529
|
+
outputs = execute_commands(commands)
|
|
498
530
|
return [(fs, *outputs[3 * i:3 * i + 3]) for i, fs in enumerate(filesystems)]
|
|
499
531
|
|
|
500
532
|
TABLE_HEADER = ["Mount", "Path", "FS Used", "w_err", "r_err", "f_err", "bit_rot", "gen_err",
|
|
@@ -696,7 +728,8 @@ def build_parser():
|
|
|
696
728
|
parser = argparse.ArgumentParser(
|
|
697
729
|
description="Check Btrfs filesystem status.",
|
|
698
730
|
epilog="Exit status: 0 healthy; 1 problems found (device errors, scrub errors or missing devices); "
|
|
699
|
-
"2 the check failed (no matching mounts, an unreadable filesystem, no root); 130 interrupted
|
|
731
|
+
"2 the check failed (no matching mounts, an unreadable filesystem, no root); 130 interrupted; "
|
|
732
|
+
"141 the reader of stdout went away (| head).")
|
|
700
733
|
mode = parser.add_mutually_exclusive_group()
|
|
701
734
|
mode.add_argument("-s", "--scrub", help="Issue scrub to all pools", action="store_true")
|
|
702
735
|
mode.add_argument("-w", "--watch", action="store_true",
|
|
@@ -723,6 +756,21 @@ def build_parser():
|
|
|
723
756
|
return parser
|
|
724
757
|
|
|
725
758
|
def main():
|
|
759
|
+
try:
|
|
760
|
+
return run()
|
|
761
|
+
except KeyboardInterrupt: # outside -s / -w, whose own handlers catch first
|
|
762
|
+
return EXIT_INTERRUPTED
|
|
763
|
+
except BrokenPipeError:
|
|
764
|
+
# The reader went away (e.g. `statbtrfs | head`). Point stdout at devnull so the
|
|
765
|
+
# interpreter's exit-time flush doesn't raise a second BrokenPipeError.
|
|
766
|
+
try:
|
|
767
|
+
devnull = os.open(os.devnull, os.O_WRONLY)
|
|
768
|
+
os.dup2(devnull, sys.stdout.fileno())
|
|
769
|
+
except (OSError, ValueError):
|
|
770
|
+
pass
|
|
771
|
+
return EXIT_PIPE_CLOSED
|
|
772
|
+
|
|
773
|
+
def run():
|
|
726
774
|
parser = build_parser()
|
|
727
775
|
try:
|
|
728
776
|
import argcomplete
|
|
@@ -736,7 +784,11 @@ def main():
|
|
|
736
784
|
acquire_root([f"--color={'always' if use_color else 'never'}"] + sys.argv[1:])
|
|
737
785
|
screen = Screen(redraw=(args.scrub or args.watch) and sys.stdout.isatty())
|
|
738
786
|
|
|
739
|
-
|
|
787
|
+
discovered = discover_filesystems(find_btrfs_mounts())
|
|
788
|
+
if discovered and all(fs['uuid'] is None for fs in discovered) and btrfs_not_found():
|
|
789
|
+
print(f"{RED}btrfs not found on PATH: install btrfs-progs, or add its directory to PATH.{RESET}")
|
|
790
|
+
return EXIT_FAILURE
|
|
791
|
+
filesystems = select_filesystems(discovered, args.pattern)
|
|
740
792
|
if not filesystems:
|
|
741
793
|
print(f"{RED}No Btrfs mounts found.{RESET}")
|
|
742
794
|
return EXIT_FAILURE
|
|
@@ -0,0 +1,51 @@
|
|
|
1
|
+
"""`statbtrfs | head`: a reader that exits early ends the run quietly."""
|
|
2
|
+
import os
|
|
3
|
+
import subprocess
|
|
4
|
+
import sys
|
|
5
|
+
from pathlib import Path
|
|
6
|
+
|
|
7
|
+
import statbtrfs
|
|
8
|
+
|
|
9
|
+
ROOT = Path(statbtrfs.__file__).resolve().parent
|
|
10
|
+
|
|
11
|
+
CHILD = """
|
|
12
|
+
import sys
|
|
13
|
+
sys.path.insert(0, {root!r})
|
|
14
|
+
import statbtrfs
|
|
15
|
+
statbtrfs.read_proc_mounts = lambda: ["/dev/sdx /mnt/a btrfs rw 0 0"]
|
|
16
|
+
statbtrfs.execute_commands = {execute}
|
|
17
|
+
statbtrfs._is_root = lambda: True
|
|
18
|
+
statbtrfs.btrfs_not_found = lambda: False
|
|
19
|
+
sys.argv = ["statbtrfs", "--color=never"]
|
|
20
|
+
sys.exit(statbtrfs.main())
|
|
21
|
+
"""
|
|
22
|
+
|
|
23
|
+
|
|
24
|
+
def _run_with_gone_reader(execute):
|
|
25
|
+
read_end, write_end = os.pipe()
|
|
26
|
+
os.close(read_end) # a reader that has already gone, as with `| head -0`
|
|
27
|
+
child = subprocess.Popen([sys.executable, "-c", CHILD.format(root=str(ROOT), execute=execute)],
|
|
28
|
+
stdout=write_end, stderr=subprocess.PIPE)
|
|
29
|
+
os.close(write_end)
|
|
30
|
+
_, err = child.communicate()
|
|
31
|
+
return child.returncode, err
|
|
32
|
+
|
|
33
|
+
|
|
34
|
+
def test_closed_pipe_exits_quietly_with_141():
|
|
35
|
+
code, err = _run_with_gone_reader("lambda commands: [[] for _ in commands]")
|
|
36
|
+
assert err == b"" # no traceback, and no second error from the exit-time flush
|
|
37
|
+
assert code == statbtrfs.EXIT_PIPE_CLOSED == 141
|
|
38
|
+
|
|
39
|
+
|
|
40
|
+
def test_ctrl_c_with_a_gone_reader_exits_130_quietly():
|
|
41
|
+
# `statbtrfs | grep sda`, discovery hangs, Ctrl-C kills grep too: the 130 path must not print.
|
|
42
|
+
code, err = _run_with_gone_reader("lambda commands: (_ for _ in ()).throw(KeyboardInterrupt())")
|
|
43
|
+
assert err == b""
|
|
44
|
+
assert code == statbtrfs.EXIT_INTERRUPTED == 130
|
|
45
|
+
|
|
46
|
+
|
|
47
|
+
def test_broken_pipe_from_any_print_is_caught(monkeypatch, capsys):
|
|
48
|
+
def run():
|
|
49
|
+
raise BrokenPipeError
|
|
50
|
+
monkeypatch.setattr(statbtrfs, "run", run)
|
|
51
|
+
assert statbtrfs.main() == statbtrfs.EXIT_PIPE_CLOSED
|
|
@@ -199,3 +199,51 @@ def test_main_exclude_recent_prints_skip(monkeypatch, capsys):
|
|
|
199
199
|
assert "Skipping mounts scrubbed within the last 7d" in out
|
|
200
200
|
assert "/mnt/a" in out
|
|
201
201
|
assert "nothing to do" in out
|
|
202
|
+
|
|
203
|
+
|
|
204
|
+
_real_btrfs_not_found = getattr(statbtrfs, "btrfs_not_found", None) # conftest replaces it for the other tests
|
|
205
|
+
|
|
206
|
+
|
|
207
|
+
def _only_path(monkeypatch, tmp_path, with_btrfs):
|
|
208
|
+
"""PATH holds nothing but (optionally) a btrfs that prints nothing, whatever the host has."""
|
|
209
|
+
monkeypatch.setattr(statbtrfs, "btrfs_not_found", _real_btrfs_not_found, raising=False)
|
|
210
|
+
if with_btrfs:
|
|
211
|
+
fake = tmp_path / "btrfs"
|
|
212
|
+
fake.write_text("#!/bin/sh\nexit 0\n")
|
|
213
|
+
fake.chmod(0o755)
|
|
214
|
+
monkeypatch.setenv("PATH", str(tmp_path))
|
|
215
|
+
|
|
216
|
+
|
|
217
|
+
def test_main_reports_missing_btrfs_and_exits_with_failure(monkeypatch, capsys, tmp_path):
|
|
218
|
+
# multiCMD's quiet=True hides its own "Command path not found" line for return code 127.
|
|
219
|
+
_only_path(monkeypatch, tmp_path, with_btrfs=False)
|
|
220
|
+
install_mounts(monkeypatch, statbtrfs, MOUNT_LINES_SINGLE)
|
|
221
|
+
monkeypatch.setattr(statbtrfs.sys, "argv", ["statbtrfs"])
|
|
222
|
+
assert statbtrfs.main() == statbtrfs.EXIT_FAILURE
|
|
223
|
+
out = capsys.readouterr().out
|
|
224
|
+
assert "btrfs not found on PATH: install btrfs-progs" in out
|
|
225
|
+
assert "Could not fetch" not in out
|
|
226
|
+
|
|
227
|
+
|
|
228
|
+
def test_main_empty_btrfs_output_with_btrfs_present_keeps_the_fetch_note(monkeypatch, capsys, tmp_path):
|
|
229
|
+
_only_path(monkeypatch, tmp_path, with_btrfs=True)
|
|
230
|
+
install_mounts(monkeypatch, statbtrfs, MOUNT_LINES_SINGLE)
|
|
231
|
+
install_command_map(monkeypatch, CommandMap(default=[]), statbtrfs)
|
|
232
|
+
monkeypatch.setattr(statbtrfs.sys, "argv", ["statbtrfs"])
|
|
233
|
+
assert statbtrfs.main() == statbtrfs.EXIT_FAILURE
|
|
234
|
+
out = capsys.readouterr().out
|
|
235
|
+
assert "btrfs not found" not in out
|
|
236
|
+
assert "Could not fetch complete info for /mnt/a" in out
|
|
237
|
+
|
|
238
|
+
|
|
239
|
+
def test_ctrl_c_outside_scrub_and_watch_exits_130_quietly(monkeypatch, capsys):
|
|
240
|
+
# e.g. while `btrfs filesystem show` hangs on a dead mount.
|
|
241
|
+
install_mounts(monkeypatch, statbtrfs, MOUNT_LINES_SINGLE)
|
|
242
|
+
|
|
243
|
+
def hang(commands):
|
|
244
|
+
raise KeyboardInterrupt
|
|
245
|
+
|
|
246
|
+
monkeypatch.setattr(statbtrfs, "execute_commands", hang)
|
|
247
|
+
monkeypatch.setattr(statbtrfs.sys, "argv", ["statbtrfs"])
|
|
248
|
+
assert statbtrfs.main() == statbtrfs.EXIT_INTERRUPTED == 130
|
|
249
|
+
assert "Traceback" not in capsys.readouterr().err
|
|
@@ -30,10 +30,9 @@ def test_discover_keeps_unparseable_mounts_separate(monkeypatch):
|
|
|
30
30
|
assert all(fs["uuid"] is None for fs in filesystems)
|
|
31
31
|
|
|
32
32
|
|
|
33
|
-
def
|
|
34
|
-
|
|
33
|
+
def test_discover_no_mounts_finds_nothing(monkeypatch):
|
|
34
|
+
_show_map(monkeypatch, {})
|
|
35
35
|
assert statbtrfs.discover_filesystems([]) == []
|
|
36
|
-
assert cm.calls == []
|
|
37
36
|
|
|
38
37
|
|
|
39
38
|
def test_select_filesystems_matches_any_mountpoint():
|
|
@@ -7,10 +7,10 @@ def _fs(*mounts):
|
|
|
7
7
|
|
|
8
8
|
|
|
9
9
|
def _serve_scrub_status(monkeypatch, responses):
|
|
10
|
-
def fake_exec(command
|
|
10
|
+
def fake_exec(command):
|
|
11
11
|
return list(responses[command[-1]])
|
|
12
12
|
|
|
13
|
-
def fake_execs(commands
|
|
13
|
+
def fake_execs(commands):
|
|
14
14
|
return [fake_exec(c) for c in commands]
|
|
15
15
|
|
|
16
16
|
monkeypatch.setattr(statbtrfs, "execute_command", fake_exec)
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
def test_embedded_multicmd_is_used_when_the_installed_one_is_older(tmp_path):
|
|
2
|
+
# An installed multiCMD older than 1.56 is passed over for the embedded copy.
|
|
3
|
+
import os
|
|
4
|
+
import subprocess
|
|
5
|
+
import sys
|
|
6
|
+
from pathlib import Path
|
|
7
|
+
|
|
8
|
+
import statbtrfs
|
|
9
|
+
|
|
10
|
+
root = Path(statbtrfs.__file__).resolve().parent
|
|
11
|
+
(tmp_path / "multiCMD.py").write_text("version = '1.55'\n")
|
|
12
|
+
env = dict(os.environ, PYTHONPATH=os.pathsep.join([str(tmp_path), str(root)]))
|
|
13
|
+
out = subprocess.run(
|
|
14
|
+
[sys.executable, "-c", "import statbtrfs; print(statbtrfs.multiCMD.version)"],
|
|
15
|
+
cwd=str(tmp_path), env=env, stdout=subprocess.PIPE, check=True,
|
|
16
|
+
).stdout.decode("utf-8")
|
|
17
|
+
assert out == "1.56\n"
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
import pytest
|
|
2
|
+
|
|
3
|
+
import statbtrfs
|
|
4
|
+
from conftest import skip_unless_live_btrfs
|
|
5
|
+
|
|
6
|
+
|
|
7
|
+
@pytest.mark.live
|
|
8
|
+
def test_live_status_table(monkeypatch, capsys):
|
|
9
|
+
skip_unless_live_btrfs()
|
|
10
|
+
monkeypatch.setattr(statbtrfs.sys, "argv", ["statbtrfs"])
|
|
11
|
+
# Safety: conftest's autouse fixture already fails any test that reaches run_detached with btrfs.
|
|
12
|
+
statbtrfs.main()
|
|
13
|
+
out = capsys.readouterr().out
|
|
14
|
+
assert "Mount" in out or "scrub_status" in out or "TABLE" in out or "│" in out or "|" in out
|
|
15
|
+
# Header fields appear inside pretty_format_table output; require at least one known column name:
|
|
16
|
+
assert any(h in out for h in ("Mount", "scrub_status", "FS Used", "w_err"))
|
|
@@ -42,23 +42,15 @@ def test_find_btrfs_mounts_runs_no_commands(monkeypatch):
|
|
|
42
42
|
cm = CommandMap(default=[])
|
|
43
43
|
install_command_map(monkeypatch, cm, statbtrfs)
|
|
44
44
|
install_mounts(monkeypatch, statbtrfs, MOUNT_LINES_MULTI)
|
|
45
|
-
statbtrfs.find_btrfs_mounts(
|
|
45
|
+
statbtrfs.find_btrfs_mounts()
|
|
46
46
|
assert cm.calls == []
|
|
47
47
|
|
|
48
48
|
|
|
49
49
|
def test_find_btrfs_mounts_empty(monkeypatch):
|
|
50
50
|
install_mounts(monkeypatch, statbtrfs, [])
|
|
51
|
-
assert statbtrfs.find_btrfs_mounts(
|
|
52
|
-
assert statbtrfs.find_btrfs_mounts(None) == []
|
|
51
|
+
assert statbtrfs.find_btrfs_mounts() == []
|
|
53
52
|
|
|
54
53
|
|
|
55
54
|
def test_find_btrfs_mounts_all(monkeypatch):
|
|
56
55
|
install_mounts(monkeypatch, statbtrfs, MOUNT_LINES_MULTI)
|
|
57
|
-
assert statbtrfs.find_btrfs_mounts(
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
def test_find_btrfs_mounts_pattern_filter(monkeypatch):
|
|
61
|
-
install_mounts(monkeypatch, statbtrfs, MOUNT_LINES_MULTI)
|
|
62
|
-
assert statbtrfs.find_btrfs_mounts(["mnt"]) == ["/mnt/a", "/mnt/b"]
|
|
63
|
-
assert statbtrfs.find_btrfs_mounts(["data"]) == ["/data"]
|
|
64
|
-
assert statbtrfs.find_btrfs_mounts(["mnt", "a"]) == ["/data", "/mnt/a", "/mnt/b"]
|
|
56
|
+
assert statbtrfs.find_btrfs_mounts() == ["/data", "/mnt/a", "/mnt/b"]
|
|
@@ -25,13 +25,11 @@ def test_parse_show_multi_device_paths_joined():
|
|
|
25
25
|
assert missing == 0
|
|
26
26
|
|
|
27
27
|
|
|
28
|
-
def test_parse_show_incomplete_returns_nones(
|
|
28
|
+
def test_parse_show_incomplete_returns_nones():
|
|
29
29
|
uuid, fs_used, device_path, missing = statbtrfs.parse_show_info(SHOW_INCOMPLETE)
|
|
30
30
|
assert uuid == "11111111-2222-3333-4444-555555555555"
|
|
31
31
|
assert fs_used == "1.00GiB"
|
|
32
32
|
assert device_path is None
|
|
33
|
-
out = capsys.readouterr().out
|
|
34
|
-
assert "Could not parse btrfs show info" in out
|
|
35
33
|
|
|
36
34
|
|
|
37
35
|
def test_parse_show_ignores_keywords_inside_label():
|
|
@@ -41,7 +39,7 @@ def test_parse_show_ignores_keywords_inside_label():
|
|
|
41
39
|
assert device_path == "/dev/sda1"
|
|
42
40
|
|
|
43
41
|
|
|
44
|
-
def test_parse_show_totals_line_without_bytes_used_does_not_crash(
|
|
42
|
+
def test_parse_show_totals_line_without_bytes_used_does_not_crash():
|
|
45
43
|
show = [
|
|
46
44
|
"Label: none uuid: 11111111-2222-3333-4444-555555555555",
|
|
47
45
|
"\tTotal devices 1",
|
|
@@ -49,7 +47,6 @@ def test_parse_show_totals_line_without_bytes_used_does_not_crash(capsys):
|
|
|
49
47
|
]
|
|
50
48
|
uuid, fs_used, device_path, missing = statbtrfs.parse_show_info(show)
|
|
51
49
|
assert fs_used is None
|
|
52
|
-
assert "Could not parse btrfs show info" in capsys.readouterr().out
|
|
53
50
|
|
|
54
51
|
|
|
55
52
|
def test_parse_show_counts_devices_missing_from_listing():
|
|
@@ -53,6 +53,19 @@ def test_run_detached_missing_command(monkeypatch):
|
|
|
53
53
|
assert output
|
|
54
54
|
|
|
55
55
|
|
|
56
|
+
def test_exec_failure_is_a_failed_start_not_a_crash(monkeypatch):
|
|
57
|
+
# fork EAGAIN / ENOMEM, or btrfs removed during a long -s: start_scrub reports a failed start, so the
|
|
58
|
+
# orchestration records it and goes on to the queued scrubs.
|
|
59
|
+
def fail(command, **kw):
|
|
60
|
+
raise OSError(11, "Resource temporarily unavailable")
|
|
61
|
+
monkeypatch.setattr(statbtrfs, "USE_SUDO", False)
|
|
62
|
+
monkeypatch.setattr(statbtrfs, "run_detached", run_detached)
|
|
63
|
+
monkeypatch.setattr(statbtrfs.subprocess, "call", fail)
|
|
64
|
+
state, message = statbtrfs.start_scrub("/mnt/a")
|
|
65
|
+
assert state == "failed"
|
|
66
|
+
assert "Resource temporarily unavailable" in message
|
|
67
|
+
|
|
68
|
+
|
|
56
69
|
def test_run_detached_prefixes_sudo_in_per_command_mode(monkeypatch):
|
|
57
70
|
monkeypatch.setattr(statbtrfs, "USE_SUDO", True)
|
|
58
71
|
seen = []
|
|
@@ -1,56 +0,0 @@
|
|
|
1
|
-
import statbtrfs
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
def test_module_imports_without_exiting():
|
|
5
|
-
assert hasattr(statbtrfs, "version")
|
|
6
|
-
assert callable(statbtrfs.main)
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
def test_embedded_multicmd_is_used_when_the_installed_one_is_older_and_lines_up_cjk(tmp_path):
|
|
10
|
-
# An installed multiCMD older than 1.54 is passed over for the embedded copy,
|
|
11
|
-
# whose tables size columns in terminal columns: a CJK character takes two.
|
|
12
|
-
import os
|
|
13
|
-
import subprocess
|
|
14
|
-
import sys
|
|
15
|
-
from pathlib import Path
|
|
16
|
-
|
|
17
|
-
root = Path(statbtrfs.__file__).resolve().parent
|
|
18
|
-
(tmp_path / "multiCMD.py").write_text("version = '1.53'\n")
|
|
19
|
-
env = dict(os.environ, PYTHONPATH=os.pathsep.join([str(tmp_path), str(root)]))
|
|
20
|
-
out = subprocess.run(
|
|
21
|
-
[sys.executable, "-c",
|
|
22
|
-
"import statbtrfs; m = statbtrfs.multiCMD; "
|
|
23
|
-
"print(m.version); print(m.pretty_format_table([['name', 'v'], ['中文', '1']], full=True), end='')"],
|
|
24
|
-
cwd=str(tmp_path), env=env, stdout=subprocess.PIPE, check=True,
|
|
25
|
-
).stdout.decode("utf-8")
|
|
26
|
-
assert out == "1.54\nname | v\n-----+--\n中文 | 1\n"
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
def test_embedded_multicmd_reads_terminal_columns_when_stdout_is_piped(tmp_path):
|
|
30
|
-
# `statbtrfs | less` on a 200x40 terminal: the size comes from stdin's TIOCGWINSZ,
|
|
31
|
-
# whose winsize struct holds the rows before the columns.
|
|
32
|
-
import os
|
|
33
|
-
import subprocess
|
|
34
|
-
import sys
|
|
35
|
-
from pathlib import Path
|
|
36
|
-
|
|
37
|
-
import pytest
|
|
38
|
-
pty = pytest.importorskip("pty")
|
|
39
|
-
import fcntl
|
|
40
|
-
import struct
|
|
41
|
-
import termios
|
|
42
|
-
|
|
43
|
-
root = Path(statbtrfs.__file__).resolve().parent
|
|
44
|
-
(tmp_path / "multiCMD.py").write_text("version = '1.0'\n") # too old: the embedded copy is used
|
|
45
|
-
env = dict(os.environ, PYTHONPATH=os.pathsep.join([str(tmp_path), str(root)]))
|
|
46
|
-
master, slave = pty.openpty()
|
|
47
|
-
try:
|
|
48
|
-
fcntl.ioctl(slave, termios.TIOCSWINSZ, struct.pack("HHHH", 40, 200, 0, 0))
|
|
49
|
-
out = subprocess.run(
|
|
50
|
-
[sys.executable, "-c", "import statbtrfs; print(*statbtrfs.multiCMD.get_terminal_size()[:2])"],
|
|
51
|
-
stdin=slave, stdout=subprocess.PIPE, cwd=str(tmp_path), env=env, universal_newlines=True, check=True,
|
|
52
|
-
).stdout
|
|
53
|
-
finally:
|
|
54
|
-
os.close(slave)
|
|
55
|
-
os.close(master)
|
|
56
|
-
assert out.split() == ["200", "40"]
|
|
@@ -1,39 +0,0 @@
|
|
|
1
|
-
import pytest
|
|
2
|
-
|
|
3
|
-
import statbtrfs
|
|
4
|
-
from conftest import skip_unless_live_btrfs
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
@pytest.mark.live
|
|
8
|
-
def test_live_status_table(monkeypatch, capsys):
|
|
9
|
-
skip_unless_live_btrfs()
|
|
10
|
-
monkeypatch.setattr(statbtrfs.sys, "argv", ["statbtrfs"])
|
|
11
|
-
# Safety: if something patched scrub in, fail hard
|
|
12
|
-
real_exec = statbtrfs.execute_command
|
|
13
|
-
|
|
14
|
-
def guard(command, wait=True):
|
|
15
|
-
if list(command)[:3] == ["btrfs", "scrub", "start"] or list(command)[:4] == [
|
|
16
|
-
"sudo",
|
|
17
|
-
"btrfs",
|
|
18
|
-
"scrub",
|
|
19
|
-
"start",
|
|
20
|
-
]:
|
|
21
|
-
raise AssertionError("live tests must not scrub start")
|
|
22
|
-
return real_exec(command, wait=wait)
|
|
23
|
-
|
|
24
|
-
monkeypatch.setattr(statbtrfs, "execute_command", guard)
|
|
25
|
-
# execute_commands used for status; wrap similarly
|
|
26
|
-
real_execs = statbtrfs.execute_commands
|
|
27
|
-
|
|
28
|
-
def guard_many(commands, wait=True):
|
|
29
|
-
for command in commands:
|
|
30
|
-
if list(command)[:3] == ["btrfs", "scrub", "start"]:
|
|
31
|
-
raise AssertionError("live tests must not scrub start")
|
|
32
|
-
return real_execs(commands, wait=wait)
|
|
33
|
-
|
|
34
|
-
monkeypatch.setattr(statbtrfs, "execute_commands", guard_many)
|
|
35
|
-
statbtrfs.main()
|
|
36
|
-
out = capsys.readouterr().out
|
|
37
|
-
assert "Mount" in out or "scrub_status" in out or "TABLE" in out or "│" in out or "|" in out
|
|
38
|
-
# Header fields appear inside pretty_format_table output; require at least one known column name:
|
|
39
|
-
assert any(h in out for h in ("Mount", "scrub_status", "FS Used", "w_err"))
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|