summaryrefslogtreecommitdiffstats
path: root/test/t/test_fio.py
diff options
context:
space:
mode:
authorDaniel Baumann <daniel.baumann@progress-linux.org>2024-05-04 01:03:18 +0000
committerDaniel Baumann <daniel.baumann@progress-linux.org>2024-05-04 01:03:18 +0000
commitf2621414ee5f2f601424c22f00e207903e3b6104 (patch)
tree56a856dafd1ca684bb23263cacaa723ee4f404fc /test/t/test_fio.py
parentAdding debian version 1:2.11-8. (diff)
downloadbash-completion-f2621414ee5f2f601424c22f00e207903e3b6104.tar.xz
bash-completion-f2621414ee5f2f601424c22f00e207903e3b6104.zip
Merging upstream version 1:2.12.0.
Signed-off-by: Daniel Baumann <daniel.baumann@progress-linux.org>
Diffstat (limited to 'test/t/test_fio.py')
-rw-r--r--test/t/test_fio.py40
1 files changed, 39 insertions, 1 deletions
diff --git a/test/t/test_fio.py b/test/t/test_fio.py
index 0f6eba7..dadb5ac 100644
--- a/test/t/test_fio.py
+++ b/test/t/test_fio.py
@@ -10,6 +10,44 @@ class TestFio:
def test_2(self, completion):
assert completion
- @pytest.mark.complete("fio --debug=foo,")
+ @pytest.mark.complete("fio --debug=foo,", require_cmd=True)
def test_3(self, completion):
assert completion
+
+ @pytest.mark.complete("fio --ioengin", require_cmd=True)
+ def test_cmdhelp_all(self, completion):
+ """Test we got a "known present" option from --cmdhelp=all."""
+ assert completion == "e=" or "e" in completion
+
+ @pytest.mark.complete("fio --ioengine=", require_cmd=True)
+ def test_enghelp(self, completion):
+ """Test --enghelp parsing."""
+ assert completion
+
+ @pytest.mark.complete("fio --unlink=", require_cmd=True)
+ def test_cmdhelp_boolean(self, completion):
+ """Test --cmdhelp=COMMAND boolean parsing."""
+ assert completion == "0 1".split()
+
+ @pytest.mark.complete("fio --kb_base=", require_cmd=True)
+ def test_cmdhelp_valid_values(self, completion):
+ """Test --cmdhelp=COMMAND valid values parsing."""
+ # We expect kb_base args to be stable, no additions/removals.
+ assert completion == "1000 1024".split()
+
+ @pytest.mark.complete("fio --non_exist3nt_option=", require_cmd=True)
+ def test_cmdhelp_nonexistent(self, completion):
+ """Test --cmdhelp=COMMAND errors out gracefully."""
+ assert not completion
+
+ @pytest.mark.complete(
+ "fio --crctest=",
+ require_cmd=True,
+ xfail="! fio --help 2>&1 | command grep -q -- --crctest",
+ )
+ def test_crctest(self, completion):
+ assert "sha1" in completion
+
+ @pytest.mark.complete("fio --debug=", require_cmd=True)
+ def test_debug(self, completion):
+ assert "process" in completion