diff --git a/tests/pytests/pkg/integration/test_bash_completion.py b/tests/pytests/pkg/integration/test_bash_completion.py new file mode 100644 index 000000000000..9a47f5e7669e --- /dev/null +++ b/tests/pytests/pkg/integration/test_bash_completion.py @@ -0,0 +1,19 @@ +import pathlib + + +def test_bash_completion_installed(grains): + # This test specifically checks for a regression of #66560. + if grains.get("os_family") == "Debian": + completions_dir = pathlib.Path("/usr/share/bash-completion/completions") + for exec_name in ("salt", "salt-call", "salt-cp", "salt-key"): + # Bash-completion finds the completion when it is installed as + # , .bash, or _, so we test all three + # variants before failing. + completion_file1 = completions_dir / exec_name + completion_file2 = completions_dir / f"{exec_name}.bash" + completion_file3 = completions_dir / f"_{exec_name}" + assert ( + completion_file1.exists() + or completion_file2.exists() + or completion_file3.exists() + )