Skip to content

Commit daa5f39

Browse files
committed
fix plugin smoke fs chmod mode
1 parent 5488069 commit daa5f39

2 files changed

Lines changed: 18 additions & 1 deletion

File tree

examples/runbooks/runbooks/20-fs.check.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -50,7 +50,7 @@ tasks:
5050
use: fs.chmod
5151
with:
5252
path: /tmp/automax-demo
53-
mode: 420
53+
mode: '0644'
5454
- id: fs_chown
5555
use: fs.chown
5656
with:

tests/test_documentation_and_regressions.py

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,7 @@
1111
import sys
1212

1313
import pytest
14+
import yaml
1415
from click.testing import CliRunner
1516

1617
from automax.cli.cli import cli
@@ -627,6 +628,22 @@ def test_runbook_helpers_keep_sudo_password_env_explicit():
627628
assert '--sudo-password-env "$SUDO_PASSWORD_ENV"' in script
628629

629630

631+
def test_plugin_smoke_runbooks_keep_file_modes_as_strings():
632+
offenders = []
633+
for runbook_path in sorted(Path("examples/runbooks/runbooks").glob("*.check.yaml")):
634+
data = yaml.safe_load(runbook_path.read_text(encoding="utf-8"))
635+
for task in data.get("tasks", []):
636+
for step in task.get("steps", []):
637+
for substep in step.get("substeps", []):
638+
params = substep.get("with") or {}
639+
if "mode" in params and not isinstance(params["mode"], str):
640+
offenders.append(
641+
f"{runbook_path}:{substep.get('id')}:{substep.get('use')}: "
642+
f"mode must be quoted string, got {type(params['mode']).__name__}"
643+
)
644+
645+
assert offenders == []
646+
630647
def test_docs_show_sudo_password_env_for_runs_and_capability_installs():
631648
docs = "\n".join(
632649
path.read_text(encoding="utf-8")

0 commit comments

Comments
 (0)