Skip to content

Commit

Permalink
Add test for bash-completion on Debian / Ubuntu.
Browse files Browse the repository at this point in the history
  • Loading branch information
smarsching committed Aug 22, 2024
1 parent dd619d7 commit a18a630
Showing 1 changed file with 19 additions and 0 deletions.
19 changes: 19 additions & 0 deletions tests/pytests/pkg/integration/test_bash_completion.py
Original file line number Diff line number Diff line change
@@ -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
# <command>, <command>.bash, or _<command>, 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()
)

0 comments on commit a18a630

Please sign in to comment.