diff options
author | Matt Clay <matt@mystile.com> | 2023-02-07 12:18:20 -0800 |
---|---|---|
committer | GitHub <noreply@github.com> | 2023-02-07 12:18:20 -0800 |
commit | c8c1402ff66cf971469b7d49ada9fde894dabe0d (patch) | |
tree | be7912aad688924a67e21896c2ea88b39e6b72f3 /test/lib/ansible_test/_internal/config.py | |
parent | c7c991e79d025b223e6b400e901b6aa2f0aa36d9 (diff) | |
download | ansible-c8c1402ff66cf971469b7d49ada9fde894dabe0d.tar.gz |
ansible-test - Fix file permissions for delegation (#79932)
* ansible-test - Fix file permissions for delegation
* Set more restrictive permissions for SSH key
* Check all execute bits, not just owner
* Add a breaking_changes changelog entry
Diffstat (limited to 'test/lib/ansible_test/_internal/config.py')
-rw-r--r-- | test/lib/ansible_test/_internal/config.py | 12 |
1 files changed, 9 insertions, 3 deletions
diff --git a/test/lib/ansible_test/_internal/config.py b/test/lib/ansible_test/_internal/config.py index 372c23abb0..ea0e103dc7 100644 --- a/test/lib/ansible_test/_internal/config.py +++ b/test/lib/ansible_test/_internal/config.py @@ -24,6 +24,7 @@ from .metadata import ( from .data import ( data_context, + PayloadConfig, ) from .host_configs import ( @@ -114,7 +115,7 @@ class EnvironmentConfig(CommonConfig): self.dev_systemd_debug: bool = args.dev_systemd_debug self.dev_probe_cgroups: t.Optional[str] = args.dev_probe_cgroups - def host_callback(files: list[tuple[str, str]]) -> None: + def host_callback(payload_config: PayloadConfig) -> None: """Add the host files to the payload file list.""" config = self @@ -123,6 +124,8 @@ class EnvironmentConfig(CommonConfig): state_path = os.path.join(config.host_path, 'state.dat') config_path = os.path.join(config.host_path, 'config.dat') + files = payload_config.files + files.append((os.path.abspath(settings_path), settings_path)) files.append((os.path.abspath(state_path), state_path)) files.append((os.path.abspath(config_path), config_path)) @@ -225,9 +228,10 @@ class TestConfig(EnvironmentConfig): if self.coverage_check: self.coverage = True - def metadata_callback(files: list[tuple[str, str]]) -> None: + def metadata_callback(payload_config: PayloadConfig) -> None: """Add the metadata file to the payload file list.""" config = self + files = payload_config.files if config.metadata_path: files.append((os.path.abspath(config.metadata_path), config.metadata_path)) @@ -264,8 +268,10 @@ class SanityConfig(TestConfig): self.display_stderr = self.lint or self.list_tests if self.keep_git: - def git_callback(files: list[tuple[str, str]]) -> None: + def git_callback(payload_config: PayloadConfig) -> None: """Add files from the content root .git directory to the payload file list.""" + files = payload_config.files + for dirpath, _dirnames, filenames in os.walk(os.path.join(data_context().content.root, '.git')): paths = [os.path.join(dirpath, filename) for filename in filenames] files.extend((path, os.path.relpath(path, data_context().content.root)) for path in paths) |