File tree Expand file tree Collapse file tree
examples/runbooks/runbooks Expand file tree Collapse file tree Original file line number Diff line number Diff line change 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 :
Original file line number Diff line number Diff line change 1111import sys
1212
1313import pytest
14+ import yaml
1415from click .testing import CliRunner
1516
1617from 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+
630647def test_docs_show_sudo_password_env_for_runs_and_capability_installs ():
631648 docs = "\n " .join (
632649 path .read_text (encoding = "utf-8" )
You can’t perform that action at this time.
0 commit comments