Skip to content

Commit 854b330

Browse files
Carlos FernandezLUCI
authored andcommitted
test_wrapper: add test for repo script executable permission
Add a test to verify that the repo launcher script has the executable bit set, guarding against accidental permission changes. Change-Id: I314658b57ed174673188fbbc5962d9fdeefac97d Reviewed-on: https://gerrit-review.googlesource.com/c/git-repo/+/569242 Reviewed-by: Gavin Mak <gavinmak@google.com> Commit-Queue: Carlos Fernandez <carlosfsanz@meta.com> Reviewed-by: Mike Frysinger <vapier@google.com> Tested-by: Carlos Fernandez <carlosfsanz@meta.com>
1 parent 654690e commit 854b330

1 file changed

Lines changed: 5 additions & 0 deletions

File tree

tests/test_wrapper.py

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -106,6 +106,11 @@ def test_python_constraints(self, repo_wrapper: wrapper.Wrapper) -> None:
106106
>= repo_wrapper.MIN_PYTHON_VERSION_HARD
107107
)
108108

109+
def test_repo_script_is_executable(self) -> None:
110+
"""The repo launcher script should be executable."""
111+
repo_path = utils_for_test.THIS_DIR.parent / "repo"
112+
assert os.access(repo_path, os.X_OK), f"{repo_path} is not executable"
113+
109114
def test_init_parser(self, repo_wrapper: wrapper.Wrapper) -> None:
110115
"""Make sure 'init' GetParser works."""
111116
parser = repo_wrapper.GetParser()

0 commit comments

Comments
 (0)