diff --git a/tests/operations/apt.deb/add.json b/tests/operations/apt.deb/add.json index fa3c4c3c8..48e0d5682 100644 --- a/tests/operations/apt.deb/add.json +++ b/tests/operations/apt.deb/add.json @@ -6,7 +6,7 @@ "path=_tempfile_": "" }, "deb.DebPackage": { - "name=_tempfile_": { + "package=_tempfile_": { "name": "test", "version": 0 } diff --git a/tests/operations/apt.deb/download_add.json b/tests/operations/apt.deb/download_add.json index b2f25b9fa..e64d0a6b0 100644 --- a/tests/operations/apt.deb/download_add.json +++ b/tests/operations/apt.deb/download_add.json @@ -6,7 +6,7 @@ "path=_tempfile_": null }, "deb.DebPackage": { - "name=_tempfile_": null + "package=_tempfile_": null }, "deb.DebPackages": {}, "server.Which": { diff --git a/tests/operations/apt.deb/remove_no_exist.json b/tests/operations/apt.deb/remove_no_exist.json index 9940cabac..29c96ffcb 100644 --- a/tests/operations/apt.deb/remove_no_exist.json +++ b/tests/operations/apt.deb/remove_no_exist.json @@ -9,7 +9,7 @@ "path=_tempfile_": "" }, "deb.DebPackage": { - "name=_tempfile_": { + "package=_tempfile_": { "name": "test", "version": 0 } diff --git a/tests/operations/apt.dist_upgrade/dist_upgrade.json b/tests/operations/apt.dist_upgrade/dist_upgrade.json index 965699070..d6eb50229 100644 --- a/tests/operations/apt.dist_upgrade/dist_upgrade.json +++ b/tests/operations/apt.dist_upgrade/dist_upgrade.json @@ -5,7 +5,7 @@ ], "facts": { "apt.SimulateOperationWillChange": { - + "command=dist-upgrade": {} } } } diff --git a/tests/operations/apt.packages/update_upgrade.json b/tests/operations/apt.packages/update_upgrade.json index d1827145d..210017ac7 100644 --- a/tests/operations/apt.packages/update_upgrade.json +++ b/tests/operations/apt.packages/update_upgrade.json @@ -5,7 +5,9 @@ }, "facts": { "deb.DebPackages": {}, - "apt.SimulateOperationWillChange": {} + "apt.SimulateOperationWillChange": { + "command=upgrade": {} + } }, "commands": [ "apt-get update", diff --git a/tests/operations/apt.repo/add.json b/tests/operations/apt.repo/add.json index 75baccafc..d201f2e79 100644 --- a/tests/operations/apt.repo/add.json +++ b/tests/operations/apt.repo/add.json @@ -3,7 +3,7 @@ "facts": { "apt.AptSources": [], "files.FindInFile": { - "path=/etc/apt/sources.list, pattern=^.*deb http://archive\\.canonical\\.com/ubuntu hardy partner.*$, interpolate_variables=False": [] + "interpolate_variables=False, path=/etc/apt/sources.list, pattern=^.*deb http://archive\\.canonical\\.com/ubuntu hardy partner.*$": [] } }, "commands": [ diff --git a/tests/operations/apt.repo/add_filename.json b/tests/operations/apt.repo/add_filename.json index a25472c12..206ca7b22 100644 --- a/tests/operations/apt.repo/add_filename.json +++ b/tests/operations/apt.repo/add_filename.json @@ -6,7 +6,7 @@ "facts": { "apt.AptSources": [], "files.FindInFile": { - "path=/etc/apt/sources.list.d/somefile.list, pattern=^.*deb http://archive\\.canonical\\.com/ubuntu hardy partner.*$, interpolate_variables=False": [] + "interpolate_variables=False, path=/etc/apt/sources.list.d/somefile.list, pattern=^.*deb http://archive\\.canonical\\.com/ubuntu hardy partner.*$": [] } }, "commands": [ diff --git a/tests/operations/apt.upgrade/upgrade.json b/tests/operations/apt.upgrade/upgrade.json index 758e47ca8..01f1a122b 100644 --- a/tests/operations/apt.upgrade/upgrade.json +++ b/tests/operations/apt.upgrade/upgrade.json @@ -2,10 +2,12 @@ "args": [], "facts": { "apt.SimulateOperationWillChange": { - "upgraded": 15, - "newly_installed": 0, - "removed": 0, - "not_upgraded": 0 + "command=upgrade": { + "upgraded": 15, + "newly_installed": 0, + "removed": 0, + "not_upgraded": 0 + } } }, "commands": [ diff --git a/tests/operations/apt.upgrade/upgrade_autoremove.json b/tests/operations/apt.upgrade/upgrade_autoremove.json index 562c08b28..74c6f9175 100644 --- a/tests/operations/apt.upgrade/upgrade_autoremove.json +++ b/tests/operations/apt.upgrade/upgrade_autoremove.json @@ -5,7 +5,7 @@ ], "facts": { "apt.SimulateOperationWillChange": { - + "command=upgrade --autoremove": {} } } } diff --git a/tests/operations/bsdinit.service/disabled.json b/tests/operations/bsdinit.service/disabled.json index eec109982..bc99ebd52 100644 --- a/tests/operations/bsdinit.service/disabled.json +++ b/tests/operations/bsdinit.service/disabled.json @@ -9,7 +9,7 @@ "nginx": true }, "files.FindInFile": { - "path=/etc/rc.conf.local, pattern=^nginx_enable=.*$, interpolate_variables=False": [ + "interpolate_variables=False, path=/etc/rc.conf.local, pattern=^nginx_enable=.*$": [ "nginx_enable=\"YES\"" ] } diff --git a/tests/operations/bsdinit.service/enabled.json b/tests/operations/bsdinit.service/enabled.json index f21eeea9a..43d2d836a 100644 --- a/tests/operations/bsdinit.service/enabled.json +++ b/tests/operations/bsdinit.service/enabled.json @@ -9,8 +9,8 @@ "nginx": true }, "files.FindInFile": { - "path=/etc/rc.conf.local, pattern=^nginx_enable=.*$, interpolate_variables=False": [], - "path=/etc/rc.conf.local, pattern=^.*nginx_enable=\"YES\".*$, interpolate_variables=False": [] + "interpolate_variables=False, path=/etc/rc.conf.local, pattern=^nginx_enable=.*$": [], + "interpolate_variables=False, path=/etc/rc.conf.local, pattern=^nginx_enable=\"YES\"$": [] } }, "commands": [ diff --git a/tests/operations/dnf.repo/add.json b/tests/operations/dnf.repo/add.json index f17e23eeb..e4c932e9f 100644 --- a/tests/operations/dnf.repo/add.json +++ b/tests/operations/dnf.repo/add.json @@ -11,7 +11,8 @@ "path=/etc/yum.repos.d/somerepo.repo": {} }, "files.Directory": { - "path=/etc/yum.repos.d": true + "path=/etc/yum.repos.d": true, + "path=/etc/yum.repos.d/somerepo.repo": null } }, "commands": [[ diff --git a/tests/operations/files.block/add_existing_block_different_content.json b/tests/operations/files.block/add_existing_block_different_content.json index 3c29332d6..97fb59960 100644 --- a/tests/operations/files.block/add_existing_block_different_content.json +++ b/tests/operations/files.block/add_existing_block_different_content.json @@ -8,7 +8,7 @@ }, "facts": { "files.Block": { - "path=/home/someone/something, marker=None, begin=None, end=None": ["previously was something else"] + "begin=None, end=None, marker=None, path=/home/someone/something": ["previously was something else"] } }, "commands": [ diff --git a/tests/operations/files.block/add_existing_block_different_content_and_backup.json b/tests/operations/files.block/add_existing_block_different_content_and_backup.json index a871a98cd..8a5900d5f 100644 --- a/tests/operations/files.block/add_existing_block_different_content_and_backup.json +++ b/tests/operations/files.block/add_existing_block_different_content_and_backup.json @@ -9,7 +9,7 @@ }, "facts": { "files.Block": { - "path=/home/someone/something, marker=None, begin=None, end=None": ["previously was something else"] + "begin=None, end=None, marker=None, path=/home/someone/something": ["previously was something else"] } }, "commands": [ diff --git a/tests/operations/files.block/add_existing_block_same_content.json b/tests/operations/files.block/add_existing_block_same_content.json index d6ef21326..7b5774b14 100644 --- a/tests/operations/files.block/add_existing_block_same_content.json +++ b/tests/operations/files.block/add_existing_block_same_content.json @@ -8,7 +8,7 @@ }, "facts": { "files.Block": { - "path=/home/someone/something, marker=None, begin=None, end=None": ["the one true string"] + "begin=None, end=None, marker=None, path=/home/someone/something": ["the one true string"] } }, "commands": [], diff --git a/tests/operations/files.block/add_line_given_but_before_eq_after.json b/tests/operations/files.block/add_line_given_but_before_eq_after.json index 901e0a3c4..b3f94edcf 100644 --- a/tests/operations/files.block/add_line_given_but_before_eq_after.json +++ b/tests/operations/files.block/add_line_given_but_before_eq_after.json @@ -9,7 +9,7 @@ }, "facts": { "files.Block": { - "path=/home/someone/something, marker=None, begin=None, end=None": null + "begin=None, end=None, marker=None, path=/home/someone/something": null } }, "exception": { diff --git a/tests/operations/files.block/add_no_content_provided.json b/tests/operations/files.block/add_no_content_provided.json index fc50d36f9..2e1342dd7 100644 --- a/tests/operations/files.block/add_no_content_provided.json +++ b/tests/operations/files.block/add_no_content_provided.json @@ -3,7 +3,7 @@ "args": ["/home/someone/something"], "facts": { "files.Block": { - "path=/home/someone/something, marker=None, begin=None, end=None": null + "begin=None, end=None, marker=None, path=/home/someone/something": null } }, "exception": { diff --git a/tests/operations/files.block/add_no_existing_block_and_no_line.json b/tests/operations/files.block/add_no_existing_block_and_no_line.json index c32a5f6b9..921e0292f 100644 --- a/tests/operations/files.block/add_no_existing_block_and_no_line.json +++ b/tests/operations/files.block/add_no_existing_block_and_no_line.json @@ -8,7 +8,7 @@ }, "facts": { "files.Block": { - "path=/home/someone/something, marker=None, begin=None, end=None": null + "begin=None, end=None, marker=None, path=/home/someone/something": null } }, "commands": [ diff --git a/tests/operations/files.block/add_no_existing_block_line_provided.json b/tests/operations/files.block/add_no_existing_block_line_provided.json index f7b9bbfb5..157452bcd 100644 --- a/tests/operations/files.block/add_no_existing_block_line_provided.json +++ b/tests/operations/files.block/add_no_existing_block_line_provided.json @@ -8,7 +8,7 @@ }, "facts": { "files.Block": { - "path=/home/someone/something, marker=None, begin=None, end=None": [] + "begin=None, end=None, marker=None, path=/home/someone/something": [] } }, "commands": [ diff --git a/tests/operations/files.block/add_no_existing_block_line_provided_escape_regex.json b/tests/operations/files.block/add_no_existing_block_line_provided_escape_regex.json index cd9b1adae..0b261f795 100644 --- a/tests/operations/files.block/add_no_existing_block_line_provided_escape_regex.json +++ b/tests/operations/files.block/add_no_existing_block_line_provided_escape_regex.json @@ -9,7 +9,7 @@ }, "facts": { "files.Block": { - "path=/home/someone/something, marker=None, begin=None, end=None": [] + "begin=None, end=None, marker=None, path=/home/someone/something": [] } }, "commands": [ diff --git a/tests/operations/files.block/add_no_existing_file.json b/tests/operations/files.block/add_no_existing_file.json index 358c1ddca..2cbbecec3 100644 --- a/tests/operations/files.block/add_no_existing_file.json +++ b/tests/operations/files.block/add_no_existing_file.json @@ -8,7 +8,7 @@ }, "facts": { "files.Block": { - "path=/home/someone/something, marker=None, begin=None, end=None": null + "begin=None, end=None, marker=None, path=/home/someone/something": null } }, "commands": [ diff --git a/tests/operations/files.block/add_no_line_given_but_before_ne_after.json b/tests/operations/files.block/add_no_line_given_but_before_ne_after.json index 57e4f335d..1fea58d8e 100644 --- a/tests/operations/files.block/add_no_line_given_but_before_ne_after.json +++ b/tests/operations/files.block/add_no_line_given_but_before_ne_after.json @@ -8,7 +8,7 @@ }, "facts": { "files.Block": { - "path=/home/someone/something, marker=None, begin=None, end=None": null + "begin=None, end=None, marker=None, path=/home/someone/something": null } }, "exception": { diff --git a/tests/operations/files.block/remove_but_content_not_none.json b/tests/operations/files.block/remove_but_content_not_none.json index d0b273c67..41e0f6a30 100644 --- a/tests/operations/files.block/remove_but_content_not_none.json +++ b/tests/operations/files.block/remove_but_content_not_none.json @@ -7,7 +7,7 @@ }, "facts": { "files.Block": { - "path=/home/someone/something, marker=None, begin=None, end=None": ["some existing content"] + "begin=None, end=None, marker=None, path=/home/someone/something": ["some existing content"] } }, "commands": [ diff --git a/tests/operations/files.block/remove_existing_block.json b/tests/operations/files.block/remove_existing_block.json index 02d32e964..1c8464f72 100644 --- a/tests/operations/files.block/remove_existing_block.json +++ b/tests/operations/files.block/remove_existing_block.json @@ -6,7 +6,7 @@ }, "facts": { "files.Block": { - "path=/home/someone/something, marker=None, begin=None, end=None": ["existing content"] + "begin=None, end=None, marker=None, path=/home/someone/something": ["existing content"] } }, "commands": [ diff --git a/tests/operations/files.block/remove_no_existing_block.json b/tests/operations/files.block/remove_no_existing_block.json index 738ed52c6..535035f81 100644 --- a/tests/operations/files.block/remove_no_existing_block.json +++ b/tests/operations/files.block/remove_no_existing_block.json @@ -4,7 +4,7 @@ "kwargs": {"present": false}, "facts": { "files.Block": { - "path=/home/someone/something, marker=None, begin=None, end=None": [] + "begin=None, end=None, marker=None, path=/home/someone/something": [] } }, "commands": [], diff --git a/tests/operations/files.block/remove_no_file.json b/tests/operations/files.block/remove_no_file.json index 4ece19de6..8f9916558 100644 --- a/tests/operations/files.block/remove_no_file.json +++ b/tests/operations/files.block/remove_no_file.json @@ -4,7 +4,7 @@ "kwargs": {"present": false}, "facts": { "files.Block": { - "path=/home/someone/something, marker=None, begin=None, end=None": null + "begin=None, end=None, marker=None, path=/home/someone/something": null } }, "commands": [], diff --git a/tests/operations/files.directory/add_with_spaces.json b/tests/operations/files.directory/add_with_spaces.json index 46336a47b..1687ad802 100644 --- a/tests/operations/files.directory/add_with_spaces.json +++ b/tests/operations/files.directory/add_with_spaces.json @@ -8,7 +8,7 @@ }, "facts": { "files.Directory": { - "path=testdir": null + "path=test dir": null } }, "commands": [ diff --git a/tests/operations/files.line/add.json b/tests/operations/files.line/add.json index 13082cbed..5c6f109f6 100644 --- a/tests/operations/files.line/add.json +++ b/tests/operations/files.line/add.json @@ -2,7 +2,7 @@ "args": ["somefile", "match_line"], "facts": { "files.FindInFile": { - "path=somefile, pattern=^.*match_line.*$, interpolate_variables=False": [] + "interpolate_variables=False, path=somefile, pattern=^.*match_line.*$": [] } }, "commands": [ diff --git a/tests/operations/files.line/add_backup.json b/tests/operations/files.line/add_backup.json index e36757c43..3d7c1d640 100644 --- a/tests/operations/files.line/add_backup.json +++ b/tests/operations/files.line/add_backup.json @@ -5,7 +5,7 @@ }, "facts": { "files.FindInFile": { - "path=somefile, pattern=^.*match_line.*$, interpolate_variables=False": [] + "interpolate_variables=False, path=somefile, pattern=^.*match_line.*$": [] } }, "commands": [ diff --git a/tests/operations/files.line/add_existing.json b/tests/operations/files.line/add_existing.json index e671c6d0f..0a754f9d5 100644 --- a/tests/operations/files.line/add_existing.json +++ b/tests/operations/files.line/add_existing.json @@ -6,7 +6,7 @@ }, "facts": { "files.FindInFile": { - "path=somefile, pattern=^.*match_line.*$, interpolate_variables=False": ["replace_line"] + "interpolate_variables=False, path=somefile, pattern=^.*match_line.*$": ["replace_line"] } }, "commands": [], diff --git a/tests/operations/files.line/add_replace.json b/tests/operations/files.line/add_replace.json index 2c5634806..225849684 100644 --- a/tests/operations/files.line/add_replace.json +++ b/tests/operations/files.line/add_replace.json @@ -7,7 +7,7 @@ "facts": { "files.FindInFile": { "interpolate_variables=False, path=somefile, pattern=^.*match_line.*$": [], - "interpolate_variables=False, path=somefile, pattern=^.*replace_line.*$": [] + "interpolate_variables=False, path=somefile, pattern=^replace_line$": [] } }, "commands": [ diff --git a/tests/operations/files.line/add_replace_noop.json b/tests/operations/files.line/add_replace_noop.json index 43988cc70..217372ecd 100644 --- a/tests/operations/files.line/add_replace_noop.json +++ b/tests/operations/files.line/add_replace_noop.json @@ -6,8 +6,8 @@ }, "facts": { "files.FindInFile": { - "path=somefile, pattern=^.*match_line.*$, interpolate_variables=False": [], - "path=somefile, pattern=^replace_line$, interpolate_variables=False": ["replace_line"] + "interpolate_variables=False, path=somefile, pattern=^.*match_line.*$": [], + "interpolate_variables=False, path=somefile, pattern=^replace_line$": ["replace_line"] } }, "commands": [], diff --git a/tests/operations/files.line/edit.json b/tests/operations/files.line/edit.json index 1c4f1a413..f250b94d4 100644 --- a/tests/operations/files.line/edit.json +++ b/tests/operations/files.line/edit.json @@ -6,7 +6,7 @@ }, "facts": { "files.FindInFile": { - "path=somefile, pattern=^.*match_line.*$, interpolate_variables=False": [ + "interpolate_variables=False, path=somefile, pattern=^.*match_line.*$": [ "match_line" ] } diff --git a/tests/operations/files.line/edit_backup.json b/tests/operations/files.line/edit_backup.json index 280020305..d7dda5f29 100644 --- a/tests/operations/files.line/edit_backup.json +++ b/tests/operations/files.line/edit_backup.json @@ -7,7 +7,7 @@ }, "facts": { "files.FindInFile": { - "path=somefile, pattern=^.*match_line.*$, interpolate_variables=False": [ + "interpolate_variables=False, path=somefile, pattern=^.*match_line.*$": [ "match_line" ] } diff --git a/tests/operations/files.line/pathlib_edit.json b/tests/operations/files.line/pathlib_edit.json index bba7ddd04..4fe4d9090 100644 --- a/tests/operations/files.line/pathlib_edit.json +++ b/tests/operations/files.line/pathlib_edit.json @@ -6,7 +6,7 @@ }, "facts": { "files.FindInFile": { - "path=somefile, pattern=^.*match_line.*$, interpolate_variables=False": [ + "interpolate_variables=False, path=somefile, pattern=^.*match_line.*$": [ "match_line" ] } diff --git a/tests/operations/files.put/copy_local_permissions.json b/tests/operations/files.put/copy_local_permissions.json index f4a40f3e2..7ee952f17 100644 --- a/tests/operations/files.put/copy_local_permissions.json +++ b/tests/operations/files.put/copy_local_permissions.json @@ -11,9 +11,11 @@ }, "facts": { "files.File": { - "path=/home/some\\ file.txt": null + "path=/somefile.txt": null, + "path=/somefile.txt/somefile.txt": null }, "files.Directory": { + "path=/somefile.txt": false, "path=/": true } }, diff --git a/tests/operations/files.put/create_directory.json b/tests/operations/files.put/create_directory.json index 8f548d4e8..6c6c54de1 100644 --- a/tests/operations/files.put/create_directory.json +++ b/tests/operations/files.put/create_directory.json @@ -16,7 +16,8 @@ "path=/home/somefile.txt": null }, "files.Directory": { - "path=/home": null + "path=/home": null, + "path=/home/somefile.txt": null } }, "commands": [ diff --git a/tests/operations/files.put/no_remote.json b/tests/operations/files.put/no_remote.json index fa0a38d61..25058ba61 100644 --- a/tests/operations/files.put/no_remote.json +++ b/tests/operations/files.put/no_remote.json @@ -16,7 +16,8 @@ "path=/home/somefile.txt": null }, "files.Directory": { - "path=/home": true + "path=/home": true, + "path=/home/somefile.txt": null } }, "commands": [ diff --git a/tests/operations/files.put/path_with_spaces.json b/tests/operations/files.put/path_with_spaces.json index 7cfda2a13..1f4a30d75 100644 --- a/tests/operations/files.put/path_with_spaces.json +++ b/tests/operations/files.put/path_with_spaces.json @@ -8,10 +8,11 @@ }, "facts": { "files.File": { - "path=/home/some\\ file.txt": null + "path=/home/some file.txt": null }, "files.Directory": { - "path=/home": true + "path=/home": true, + "path=/home/some file.txt": false } }, "commands": [ diff --git a/tests/operations/files.put/path_with_spaces_already_escaped.json b/tests/operations/files.put/path_with_spaces_already_escaped.json index 9ed33594c..8779b278f 100644 --- a/tests/operations/files.put/path_with_spaces_already_escaped.json +++ b/tests/operations/files.put/path_with_spaces_already_escaped.json @@ -11,7 +11,8 @@ "path=/home/some\\ file.txt": null }, "files.Directory": { - "path=/home": true + "path=/home": true, + "path=/home/some\\ file.txt": false } }, "commands": [ diff --git a/tests/operations/files.put/pathlib_with_spaces.json b/tests/operations/files.put/pathlib_with_spaces.json index f9fec2de2..04418cbeb 100644 --- a/tests/operations/files.put/pathlib_with_spaces.json +++ b/tests/operations/files.put/pathlib_with_spaces.json @@ -9,10 +9,11 @@ }, "facts": { "files.File": { - "path=/home/some\\ file.txt": null + "path=/home/some file.txt": null }, "files.Directory": { - "path=/home": true + "path=/home": true, + "path=/home/some file.txt": null } }, "commands": [ diff --git a/tests/operations/files.put/upload_to_directory.json b/tests/operations/files.put/upload_to_directory.json index 9a2111724..6abf455a5 100644 --- a/tests/operations/files.put/upload_to_directory.json +++ b/tests/operations/files.put/upload_to_directory.json @@ -13,6 +13,7 @@ }, "facts": { "files.File": { + "path=/home": false, "path=/home/somefile.txt": null }, "files.Directory": { diff --git a/tests/operations/files.replace/no_match.json b/tests/operations/files.replace/no_match.json index 4e9cf7aaa..6cb44215c 100644 --- a/tests/operations/files.replace/no_match.json +++ b/tests/operations/files.replace/no_match.json @@ -2,7 +2,7 @@ "args": ["filename", "match", "replace"], "facts": { "files.FindInFile": { - "path=filename, pattern=match, interpolate_variables=False": [] + "interpolate_variables=False, path=filename, pattern=match": [] } }, "commands": [], diff --git a/tests/operations/files.replace/replace_single_quotes_interpolate.json b/tests/operations/files.replace/replace_single_quotes_interpolate.json index 6ef4dc354..cb354da4d 100644 --- a/tests/operations/files.replace/replace_single_quotes_interpolate.json +++ b/tests/operations/files.replace/replace_single_quotes_interpolate.json @@ -5,7 +5,7 @@ }, "facts": { "files.FindInFile": { - "path=filename, pattern='single quote match', interpolate_variables=True": ["'single quote match' rest of line"] + "interpolate_variables=True, path=filename, pattern='single quote match'": ["'single quote match' rest of line"] } }, "commands": [ diff --git a/tests/operations/files.replace/simple_interpolate.json b/tests/operations/files.replace/simple_interpolate.json index bb74fd2e4..e8372ef73 100644 --- a/tests/operations/files.replace/simple_interpolate.json +++ b/tests/operations/files.replace/simple_interpolate.json @@ -6,7 +6,7 @@ }, "facts": { "files.FindInFile": { - "path=filename, pattern=match, interpolate_variables=True": ["matching line"] + "interpolate_variables=True, path=filename, pattern=match": ["matching line"] } }, "commands": [ diff --git a/tests/operations/files.sync/sync_delete_posix.json b/tests/operations/files.sync/sync_delete_posix.json index 8b5b36d71..c86ed8d03 100644 --- a/tests/operations/files.sync/sync_delete_posix.json +++ b/tests/operations/files.sync/sync_delete_posix.json @@ -41,6 +41,9 @@ "path=/home/somedir/underthat/yet-another-file.txt": null }, "files.Directory": { + "path=/home/somedir/somefile.txt": null, + "path=/home/somedir/anotherfile.txt": null, + "path=/home/somedir/underthat/yet-another-file.txt": null, "path=/home/somedir": null, "path=/home/somedir/underthat": null }, diff --git a/tests/operations/files.sync/sync_destination_link.json b/tests/operations/files.sync/sync_destination_link.json index ce13083dc..af89c6e97 100644 --- a/tests/operations/files.sync/sync_destination_link.json +++ b/tests/operations/files.sync/sync_destination_link.json @@ -53,7 +53,10 @@ "path=/home/some-actual-dir": { "mode": 755 }, - "path=/home/somedir/underthat": null + "path=/home/somedir/underthat": null, + "path=/home/somedir/somefile.txt": null, + "path=/home/somedir/anotherfile.txt": null, + "path=/home/somedir/underthat/yet-another-file.txt": null }, "files.FindFiles": { "path=/home/somedir": [ diff --git a/tests/operations/files.sync/sync_exclude_multiple.json b/tests/operations/files.sync/sync_exclude_multiple.json index 499b2bd10..3c4586739 100644 --- a/tests/operations/files.sync/sync_exclude_multiple.json +++ b/tests/operations/files.sync/sync_exclude_multiple.json @@ -60,6 +60,7 @@ }, "facts": { "files.File": { + "path=/home/somedir": false, "path=/home/somedir/somefile.txt": null, "path=/home/somedir/build.log": null, "path=/home/somedir/local_ignore.pyc": null, @@ -71,7 +72,9 @@ "path=/home/somedir": { "mode": 755 }, - "path=/home/somedir/underthat": null + "path=/home/somedir/underthat": null, + "path=/home/somedir/somefile.txt": null, + "path=/home/somedir/underthat/another_file.txt": null }, "files.FindFiles": { "path=/home/somedir": [ @@ -80,7 +83,9 @@ ], "path=/home/somedir/underthat": [] }, - "files.Link": {} + "files.Link": { + "path=/home/somedir": false + } }, "commands": [ "mkdir -p /home/somedir/underthat", diff --git a/tests/operations/files.sync/sync_no_destination_exist.json b/tests/operations/files.sync/sync_no_destination_exist.json index d6ed414ef..f6a98d09f 100644 --- a/tests/operations/files.sync/sync_no_destination_exist.json +++ b/tests/operations/files.sync/sync_no_destination_exist.json @@ -26,13 +26,17 @@ }, "files.Directory": { "path=/home/somedir": null, - "path=/home/somedir/underthat": null + "path=/home/somedir/underthat": null, + "path=/home/somedir/somefile.txt": null, + "path=/home/somedir/underthat/another-file.txt": null }, "files.FindFiles": { "path=/home/somedir": [], "path=/home/somedir/underthat": [] }, - "files.Link": {}, + "files.Link": { + "path=/home/somedir": null + }, "files.Sha1File": { "path=/home/somedir/somefile.txt": "ac2cd59a622114712b5b21081763c54bf0caacb8" } diff --git a/tests/operations/files.sync/sync_partial_exists.json b/tests/operations/files.sync/sync_partial_exists.json index 4117f0047..5e3ffbecb 100644 --- a/tests/operations/files.sync/sync_partial_exists.json +++ b/tests/operations/files.sync/sync_partial_exists.json @@ -35,7 +35,9 @@ }, "path=/home/somedir/underthat": { "mode": 777 - } + }, + "path=/home/somedir/anotherfile.txt": null, + "path=/home/somedir/underthat/yet-another-file.txt": null }, "files.FindFiles": { "path=/home/somedir": [ diff --git a/tests/operations/files.sync/sync_special_chars.json b/tests/operations/files.sync/sync_special_chars.json index 49d460b62..3d9cf8b6e 100644 --- a/tests/operations/files.sync/sync_special_chars.json +++ b/tests/operations/files.sync/sync_special_chars.json @@ -17,7 +17,8 @@ "path=/home/somedir/yet () another {} file $$ __.txt": null }, "files.Directory": { - "path=/home/somedir": null + "path=/home/somedir": null, + "path=/home/somedir/yet () another {} file $$ __.txt": null }, "files.FindFiles": { "path=/home/somedir": [] diff --git a/tests/operations/files.template/no_remote.json b/tests/operations/files.template/no_remote.json index e11335529..753930d15 100644 --- a/tests/operations/files.template/no_remote.json +++ b/tests/operations/files.template/no_remote.json @@ -16,7 +16,8 @@ "path=/home/somefile.txt.j2": null }, "files.Directory": { - "path=/home": true + "path=/home": true, + "path=/home/somefile.txt.j2": null } }, "commands": [ diff --git a/tests/operations/git.repo/clone_keyscan.json b/tests/operations/git.repo/clone_keyscan.json index 456a85217..ce473cfbb 100644 --- a/tests/operations/git.repo/clone_keyscan.json +++ b/tests/operations/git.repo/clone_keyscan.json @@ -15,9 +15,7 @@ } }, "files.FindInFile": { - "path=~/.ssh/known_hosts, interpolate_variables=False": { - "github.com": [] - } + "interpolate_variables=False, path=/home/pyinfra/.ssh/known_hosts, pattern=github.com": [] } }, "commands": [ diff --git a/tests/operations/mysql.database/add_privileges.json b/tests/operations/mysql.database/add_privileges.json index 2b7227c41..48b272b56 100644 --- a/tests/operations/mysql.database/add_privileges.json +++ b/tests/operations/mysql.database/add_privileges.json @@ -9,7 +9,7 @@ "mysql_host=None, mysql_password=None, mysql_port=None, mysql_user=None": {} }, "mysql.MysqlUserGrants": { - "mysql_host=None, mysql_password=None, mysql_port=None, mysql_user=None, user=someuser, hostname=localhost": { + "hostname=localhost, mysql_host=None, mysql_password=None, mysql_port=None, mysql_user=None, user=someuser": { "localhost": {} } } diff --git a/tests/operations/mysql.privileges/add.json b/tests/operations/mysql.privileges/add.json index 691c480ea..10b6663f3 100644 --- a/tests/operations/mysql.privileges/add.json +++ b/tests/operations/mysql.privileges/add.json @@ -2,7 +2,7 @@ "args": ["someuser", ["SELECT", "INSERT", "DELETE"]], "facts": { "mysql.MysqlUserGrants": { - "mysql_host=None, mysql_password=None, mysql_port=None, mysql_user=None, user=someuser, hostname=localhost": { + "hostname=localhost, mysql_host=None, mysql_password=None, mysql_port=None, mysql_user=None, user=someuser": { "*.*": ["set:", "DELETE"] } } diff --git a/tests/operations/mysql.privileges/add_all_with_grant_option.json b/tests/operations/mysql.privileges/add_all_with_grant_option.json index 0c212a4ad..8fb49ab76 100644 --- a/tests/operations/mysql.privileges/add_all_with_grant_option.json +++ b/tests/operations/mysql.privileges/add_all_with_grant_option.json @@ -5,7 +5,7 @@ }, "facts": { "mysql.MysqlUserGrants": { - "mysql_host=None, mysql_password=None, mysql_port=None, mysql_user=None, user=someuser, hostname=localhost": { + "hostname=localhost, mysql_host=None, mysql_password=None, mysql_port=None, mysql_user=None, user=someuser": { "*.*": ["set:"] } } diff --git a/tests/operations/mysql.privileges/add_database.json b/tests/operations/mysql.privileges/add_database.json index 2cf4e01db..a7563140c 100644 --- a/tests/operations/mysql.privileges/add_database.json +++ b/tests/operations/mysql.privileges/add_database.json @@ -5,7 +5,7 @@ }, "facts": { "mysql.MysqlUserGrants": { - "mysql_host=None, mysql_password=None, mysql_port=None, mysql_user=None, user=someuser, hostname=localhost": { + "hostname=localhost, mysql_host=None, mysql_password=None, mysql_port=None, mysql_user=None, user=someuser": { "*.*": ["set:"] } } diff --git a/tests/operations/mysql.privileges/add_delete.json b/tests/operations/mysql.privileges/add_delete.json index e4bdc917e..517b43f19 100644 --- a/tests/operations/mysql.privileges/add_delete.json +++ b/tests/operations/mysql.privileges/add_delete.json @@ -2,7 +2,7 @@ "args": ["someuser", ["SELECT", "INSERT", "DELETE"]], "facts": { "mysql.MysqlUserGrants": { - "mysql_host=None, mysql_password=None, mysql_port=None, mysql_user=None, user=someuser, hostname=localhost": { + "hostname=localhost, mysql_host=None, mysql_password=None, mysql_port=None, mysql_user=None, user=someuser": { "*.*": ["set:", "DELETE", "UPDATE"] } } diff --git a/tests/operations/mysql.privileges/add_delete_usage.json b/tests/operations/mysql.privileges/add_delete_usage.json index 4e5aba7bb..e117c8041 100644 --- a/tests/operations/mysql.privileges/add_delete_usage.json +++ b/tests/operations/mysql.privileges/add_delete_usage.json @@ -2,7 +2,7 @@ "args": ["someuser", ["SELECT"]], "facts": { "mysql.MysqlUserGrants": { - "mysql_host=None, mysql_password=None, mysql_port=None, mysql_user=None, user=someuser, hostname=localhost": { + "hostname=localhost, mysql_host=None, mysql_password=None, mysql_port=None, mysql_user=None, user=someuser": { "*.*": ["set:", "USAGE"] } } diff --git a/tests/operations/mysql.privileges/add_existing.json b/tests/operations/mysql.privileges/add_existing.json index 5582bd3c5..2a56ac436 100644 --- a/tests/operations/mysql.privileges/add_existing.json +++ b/tests/operations/mysql.privileges/add_existing.json @@ -2,7 +2,7 @@ "args": ["someuser", ["SELECT", "INSERT"]], "facts": { "mysql.MysqlUserGrants": { - "mysql_host=None, mysql_password=None, mysql_port=None, mysql_user=None, user=someuser, hostname=localhost": { + "hostname=localhost, mysql_host=None, mysql_password=None, mysql_port=None, mysql_user=None, user=someuser": { "*.*": ["set:", "SELECT", "INSERT"] } } diff --git a/tests/operations/mysql.privileges/add_table.json b/tests/operations/mysql.privileges/add_table.json index 7e432024a..e698e534f 100644 --- a/tests/operations/mysql.privileges/add_table.json +++ b/tests/operations/mysql.privileges/add_table.json @@ -6,7 +6,7 @@ }, "facts": { "mysql.MysqlUserGrants": { - "mysql_host=None, mysql_password=None, mysql_port=None, mysql_user=None, user=someuser, hostname=localhost": { + "hostname=localhost, mysql_host=None, mysql_password=None, mysql_port=None, mysql_user=None, user=someuser": { "*.*": ["set:"] } } diff --git a/tests/operations/mysql.privileges/add_table_invalid.json b/tests/operations/mysql.privileges/add_table_invalid.json index 1ff6b617e..43f63991f 100644 --- a/tests/operations/mysql.privileges/add_table_invalid.json +++ b/tests/operations/mysql.privileges/add_table_invalid.json @@ -5,7 +5,7 @@ }, "facts": { "mysql.MysqlUserGrants": { - "mysql_host=None, mysql_password=None, mysql_port=None, mysql_user=None, user=someuser, hostname=localhost": { + "hostname=localhost, mysql_host=None, mysql_password=None, mysql_port=None, mysql_user=None, user=someuser": { "*.*": [] } } diff --git a/tests/operations/mysql.privileges/add_with_grant_option.json b/tests/operations/mysql.privileges/add_with_grant_option.json index bfc0f6a13..174901eac 100644 --- a/tests/operations/mysql.privileges/add_with_grant_option.json +++ b/tests/operations/mysql.privileges/add_with_grant_option.json @@ -5,7 +5,7 @@ }, "facts": { "mysql.MysqlUserGrants": { - "mysql_host=None, mysql_password=None, mysql_port=None, mysql_user=None, user=someuser, hostname=localhost": { + "hostname=localhost, mysql_host=None, mysql_password=None, mysql_port=None, mysql_user=None, user=someuser": { "*.*": ["set:"] } } diff --git a/tests/operations/mysql.privileges/delete.json b/tests/operations/mysql.privileges/delete.json index 2899c37fb..0f0ce3086 100644 --- a/tests/operations/mysql.privileges/delete.json +++ b/tests/operations/mysql.privileges/delete.json @@ -2,7 +2,7 @@ "args": ["someuser", ["DELETE"]], "facts": { "mysql.MysqlUserGrants": { - "mysql_host=None, mysql_password=None, mysql_port=None, mysql_user=None, user=someuser, hostname=localhost": { + "hostname=localhost, mysql_host=None, mysql_password=None, mysql_port=None, mysql_user=None, user=someuser": { "*.*": ["set:", "SELECT", "INSERT", "DELETE"] } } diff --git a/tests/operations/mysql.privileges/delete_all.json b/tests/operations/mysql.privileges/delete_all.json index 53894ad3d..497be8363 100644 --- a/tests/operations/mysql.privileges/delete_all.json +++ b/tests/operations/mysql.privileges/delete_all.json @@ -2,7 +2,7 @@ "args": ["someuser", ["DELETE"]], "facts": { "mysql.MysqlUserGrants": { - "mysql_host=None, mysql_password=None, mysql_port=None, mysql_user=None, user=someuser, hostname=localhost": { + "hostname=localhost, mysql_host=None, mysql_password=None, mysql_port=None, mysql_user=None, user=someuser": { "*.*": ["set:", "ALL"] } } diff --git a/tests/operations/mysql.privileges/delete_all_with_grant_option.json b/tests/operations/mysql.privileges/delete_all_with_grant_option.json index 3fed332ef..8ddff4ba9 100644 --- a/tests/operations/mysql.privileges/delete_all_with_grant_option.json +++ b/tests/operations/mysql.privileges/delete_all_with_grant_option.json @@ -2,7 +2,7 @@ "args": ["someuser", []], "facts": { "mysql.MysqlUserGrants": { - "mysql_host=None, mysql_password=None, mysql_port=None, mysql_user=None, user=someuser, hostname=localhost": { + "hostname=localhost, mysql_host=None, mysql_password=None, mysql_port=None, mysql_user=None, user=someuser": { "*.*": ["set:", "ALL", "GRANT OPTION"] } } diff --git a/tests/operations/mysql.privileges/delete_with_grant_option.json b/tests/operations/mysql.privileges/delete_with_grant_option.json index ea0de2b16..4c7fa20ad 100644 --- a/tests/operations/mysql.privileges/delete_with_grant_option.json +++ b/tests/operations/mysql.privileges/delete_with_grant_option.json @@ -2,7 +2,7 @@ "args": ["someuser", ["SELECT"]], "facts": { "mysql.MysqlUserGrants": { - "mysql_host=None, mysql_password=None, mysql_port=None, mysql_user=None, user=someuser, hostname=localhost": { + "hostname=localhost, mysql_host=None, mysql_password=None, mysql_port=None, mysql_user=None, user=someuser": { "*.*": ["set:", "SELECT", "GRANT OPTION"] } } diff --git a/tests/operations/mysql.privileges/remove_noop.json b/tests/operations/mysql.privileges/remove_noop.json index 1e86a83c7..f354b7117 100644 --- a/tests/operations/mysql.privileges/remove_noop.json +++ b/tests/operations/mysql.privileges/remove_noop.json @@ -2,7 +2,7 @@ "args": ["someuser", []], "facts": { "mysql.MysqlUserGrants": { - "mysql_host=None, mysql_password=None, mysql_port=None, mysql_user=None, user=someuser, hostname=localhost": { + "hostname=localhost, mysql_host=None, mysql_password=None, mysql_port=None, mysql_user=None, user=someuser": { "*.*": ["set:"] } } diff --git a/tests/operations/mysql.privileges/remove_usage.json b/tests/operations/mysql.privileges/remove_usage.json index 0dcead5ca..05250157d 100644 --- a/tests/operations/mysql.privileges/remove_usage.json +++ b/tests/operations/mysql.privileges/remove_usage.json @@ -2,7 +2,7 @@ "args": ["someuser", []], "facts": { "mysql.MysqlUserGrants": { - "mysql_host=None, mysql_password=None, mysql_port=None, mysql_user=None, user=someuser, hostname=localhost": { + "hostname=localhost, mysql_host=None, mysql_password=None, mysql_port=None, mysql_user=None, user=someuser": { "*.*": ["set:", "USAGE"] } } diff --git a/tests/operations/mysql.user/add_privileges.json b/tests/operations/mysql.user/add_privileges.json index 3ca4d7064..f51a2ab37 100644 --- a/tests/operations/mysql.user/add_privileges.json +++ b/tests/operations/mysql.user/add_privileges.json @@ -9,7 +9,7 @@ "mysql_host=None, mysql_password=None, mysql_port=None, mysql_user=None": {} }, "mysql.MysqlUserGrants": { - "mysql_host=None, mysql_password=None, mysql_port=None, mysql_user=None, user=someuser, hostname=localwhat": {} + "hostname=localwhat, mysql_host=None, mysql_password=None, mysql_port=None, mysql_user=None, user=someuser": {} } }, "commands": [ diff --git a/tests/operations/pkg.packages/pkg_add_packages.json b/tests/operations/pkg.packages/pkg_add_packages.json index 9c7dfcec1..35a55a503 100644 --- a/tests/operations/pkg.packages/pkg_add_packages.json +++ b/tests/operations/pkg.packages/pkg_add_packages.json @@ -10,6 +10,9 @@ }, "files.File": { "path=/etc/installurl": false + }, + "server.Which": { + "command=pkg": null } }, "commands": [ diff --git a/tests/operations/pkg.packages/pkg_add_packages_with_installurl.json b/tests/operations/pkg.packages/pkg_add_packages_with_installurl.json index 4202f8cfc..98a2992c3 100644 --- a/tests/operations/pkg.packages/pkg_add_packages_with_installurl.json +++ b/tests/operations/pkg.packages/pkg_add_packages_with_installurl.json @@ -12,6 +12,9 @@ "path=/etc/installurl": { "size": 0 } + }, + "server.Which": { + "command=pkg": null } }, "commands": [ diff --git a/tests/operations/runit.service/disable.json b/tests/operations/runit.service/disable.json index 0a57d861b..c2e5c68e6 100644 --- a/tests/operations/runit.service/disable.json +++ b/tests/operations/runit.service/disable.json @@ -15,7 +15,8 @@ } }, "files.File": { - "path=/var/service/nginx/down": null + "path=/var/service/nginx/down": null, + "path=/etc/sv/nginx/down": null }, "runit.RunitStatus": { "service=nginx, svdir=/var/service": {"nginx": true} diff --git a/tests/operations/runit.service/enable.json b/tests/operations/runit.service/enable.json index 3d6a2e4da..62c21dc70 100644 --- a/tests/operations/runit.service/enable.json +++ b/tests/operations/runit.service/enable.json @@ -18,7 +18,8 @@ } }, "files.File": { - "path=/var/service/nginx/down": null + "path=/var/service/nginx/down": null, + "path=/etc/sv/nginx/down": null }, "runit.RunitStatus": { "service=nginx, svdir=/var/service": {"nginx": true} diff --git a/tests/operations/selinux.port/add_different.json b/tests/operations/selinux.port/add_different.json index 75f0d197d..e126cc763 100644 --- a/tests/operations/selinux.port/add_different.json +++ b/tests/operations/selinux.port/add_different.json @@ -10,7 +10,7 @@ } }, "server.Which": { - "sepolicy": null + "command=sepolicy": null } }, "commands": [ diff --git a/tests/operations/selinux.port/add_different_direct.json b/tests/operations/selinux.port/add_different_direct.json index 431b66201..15dd7b683 100644 --- a/tests/operations/selinux.port/add_different_direct.json +++ b/tests/operations/selinux.port/add_different_direct.json @@ -5,7 +5,7 @@ }, "facts": { "selinux.SEPort": { - "protocol=tcp, port=22": "xray_port_t" + "port=22, protocol=tcp": "xray_port_t" }, "server.Which": { "command=sepolicy": "/usr/bin/sepolicy" diff --git a/tests/operations/selinux.port/add_not_existing.json b/tests/operations/selinux.port/add_not_existing.json index e620fdf91..ac8d04244 100644 --- a/tests/operations/selinux.port/add_not_existing.json +++ b/tests/operations/selinux.port/add_not_existing.json @@ -8,7 +8,7 @@ "tcp": {"22": ""} }, "server.Which": { - "sepolicy": null + "command=sepolicy": null } }, "commands": [ diff --git a/tests/operations/selinux.port/add_not_existing_direct.json b/tests/operations/selinux.port/add_not_existing_direct.json index 96ebbc4ad..a51c2541b 100644 --- a/tests/operations/selinux.port/add_not_existing_direct.json +++ b/tests/operations/selinux.port/add_not_existing_direct.json @@ -5,7 +5,7 @@ }, "facts": { "selinux.SEPort": { - "protocol=tcp, port=22": "" + "port=22, protocol=tcp": "" }, "server.Which": { "command=sepolicy": "/usr/bin/sepolicy" diff --git a/tests/operations/selinux.port/add_not_existing_protocol.json b/tests/operations/selinux.port/add_not_existing_protocol.json index 3ce50c0e0..b8d0184b6 100644 --- a/tests/operations/selinux.port/add_not_existing_protocol.json +++ b/tests/operations/selinux.port/add_not_existing_protocol.json @@ -8,7 +8,7 @@ "udp": {"53": "dns_port_t"} }, "server.Which": { - "sepolicy": null + "command=sepolicy": null } }, "commands": ["semanage port -a -t ssh_port_t -p tcp 22"] diff --git a/tests/operations/selinux.port/add_same.json b/tests/operations/selinux.port/add_same.json index fc4f1ec5c..4d85b56af 100644 --- a/tests/operations/selinux.port/add_same.json +++ b/tests/operations/selinux.port/add_same.json @@ -8,7 +8,7 @@ "tcp": {"22": "ssh_port_t"} }, "server.Which": { - "sepolicy": null + "command=sepolicy": null } }, "commands": [], diff --git a/tests/operations/selinux.port/add_same_direct.json b/tests/operations/selinux.port/add_same_direct.json index 0cc8428e9..78ff51fcd 100644 --- a/tests/operations/selinux.port/add_same_direct.json +++ b/tests/operations/selinux.port/add_same_direct.json @@ -5,7 +5,7 @@ }, "facts": { "selinux.SEPort": { - "protocol=tcp, port=22": "ssh_port_t" + "port=22, protocol=tcp": "ssh_port_t" }, "server.Which": { "command=sepolicy": "/usr/bin/sepolicy" diff --git a/tests/operations/selinux.port/remove_existing.json b/tests/operations/selinux.port/remove_existing.json index 112a43e4c..416c2404a 100644 --- a/tests/operations/selinux.port/remove_existing.json +++ b/tests/operations/selinux.port/remove_existing.json @@ -8,7 +8,7 @@ "tcp": {"22": "ssh_port_t"} }, "server.Which": { - "sepolicy": null + "command=sepolicy": null } }, "commands": [ diff --git a/tests/operations/selinux.port/remove_existing_direct.json b/tests/operations/selinux.port/remove_existing_direct.json index 43d91e3b2..9ec1a6997 100644 --- a/tests/operations/selinux.port/remove_existing_direct.json +++ b/tests/operations/selinux.port/remove_existing_direct.json @@ -5,7 +5,7 @@ }, "facts": { "selinux.SEPort": { - "protocol=tcp, port=22": "ssh_port_t" + "port=22, protocol=tcp": "ssh_port_t" }, "server.Which": { "command=sepolicy": "/usr/bin/sepolicy" diff --git a/tests/operations/selinux.port/remove_not_existing.json b/tests/operations/selinux.port/remove_not_existing.json index 6eb3cc90c..118fe3252 100644 --- a/tests/operations/selinux.port/remove_not_existing.json +++ b/tests/operations/selinux.port/remove_not_existing.json @@ -5,10 +5,10 @@ }, "facts": { "selinux.SEPorts": { - "tcp": {"22": ""} + "port=22, protocol=tcp": {"22": ""} }, "server.Which": { - "sepolicy": null + "command=sepolicy": null } }, "commands": [], diff --git a/tests/operations/selinux.port/remove_not_existing_direct.json b/tests/operations/selinux.port/remove_not_existing_direct.json index 18353deae..c3a8f13bd 100644 --- a/tests/operations/selinux.port/remove_not_existing_direct.json +++ b/tests/operations/selinux.port/remove_not_existing_direct.json @@ -5,7 +5,7 @@ }, "facts": { "selinux.SEPort": { - "protocol=tcp, port=22": "" + "port=22, protocol=tcp": "" }, "server.Which": { "command=sepolicy": "/usr/bin/sepolicy" diff --git a/tests/operations/server.hostname/set_hostname_bsd.json b/tests/operations/server.hostname/set_hostname_bsd.json index f00f27bce..967adc142 100644 --- a/tests/operations/server.hostname/set_hostname_bsd.json +++ b/tests/operations/server.hostname/set_hostname_bsd.json @@ -7,7 +7,8 @@ "path=/etc/myname": {} }, "files.Directory": { - "path=/etc": true + "path=/etc": true, + "path=/etc/myname": false }, "server.Which": { "command=hostnamectl": null diff --git a/tests/operations/server.hostname/set_hostname_linux.json b/tests/operations/server.hostname/set_hostname_linux.json index 8cc29604e..40b550709 100644 --- a/tests/operations/server.hostname/set_hostname_linux.json +++ b/tests/operations/server.hostname/set_hostname_linux.json @@ -7,7 +7,9 @@ "path=/etc/hostname": {} }, "files.Directory": { - "path=/etc": true + "path=/etc": true, + "path=/etc/myname": false, + "path=/etc/hostname": false }, "server.Which": { "command=hostnamectl": null diff --git a/tests/operations/server.locale/add.json b/tests/operations/server.locale/add.json index 6048b2322..2b38e566d 100644 --- a/tests/operations/server.locale/add.json +++ b/tests/operations/server.locale/add.json @@ -9,6 +9,9 @@ ], "interpolate_variables=False, path=/etc/locale.gen, pattern=^.*fr_FR.UTF-8[[:space:]]\\+.*": [ "# fr_FR.UTF-8 UTF-8" + ], + "interpolate_variables=False, path=/etc/locale.gen, pattern=^# fr_FR.UTF-8 UTF-8$": [ + "# fr_FR.UTF-8 UTF-8" ] }, "server.Locales": [ diff --git a/tests/operations/server.locale/remove.json b/tests/operations/server.locale/remove.json index 1955055a0..ae2d65dbe 100644 --- a/tests/operations/server.locale/remove.json +++ b/tests/operations/server.locale/remove.json @@ -9,6 +9,9 @@ ], "interpolate_variables=False, path=/etc/locale.gen, pattern=^.*fr_FR.UTF-8[[:space:]]\\+.*": [ "# fr_FR.UTF-8 UTF-8" + ], + "interpolate_variables=False, path=/etc/locale.gen, pattern=^# fr_FR.UTF-8 UTF-8$": [ + "# fr_FR.UTF-8 UTF-8" ] }, "server.Locales": [ diff --git a/tests/operations/server.packages/add_apk_packages.json b/tests/operations/server.packages/add_apk_packages.json index 0abbdd486..00331dff6 100644 --- a/tests/operations/server.packages/add_apk_packages.json +++ b/tests/operations/server.packages/add_apk_packages.json @@ -6,7 +6,8 @@ ]], "facts": { "server.Which": { - "command=apk": "/sbin/apk" + "command=apk": "/sbin/apk", + "command=zypper": null }, "apk.ApkPackages": { "something": [""] diff --git a/tests/operations/server.packages/add_dnf_packages.json b/tests/operations/server.packages/add_dnf_packages.json index b4a665f8b..ef22e06b6 100644 --- a/tests/operations/server.packages/add_dnf_packages.json +++ b/tests/operations/server.packages/add_dnf_packages.json @@ -9,15 +9,16 @@ "command=apk": null, "command=apt": null, "command=brew": null, + "command=zypper": null, "command=dnf": "/sbin/dnf" }, "rpm.RpmPackages": { "something": [""] }, "rpm.RpmPackageProvides": { - "name=git": null, - "name=python-devel": null, - "name=something": null + "package=git": null, + "package=python-devel": null, + "package=something": null } }, "commands": [ diff --git a/tests/operations/server.packages/add_yum_packages.json b/tests/operations/server.packages/add_yum_packages.json index 9488a5244..845d30b79 100644 --- a/tests/operations/server.packages/add_yum_packages.json +++ b/tests/operations/server.packages/add_yum_packages.json @@ -12,15 +12,17 @@ "command=dnf": null, "command=pacman": null, "command=xbps": null, + "command=zypper": null, + "command=xbps-install": null, "command=yum": "/sbin/yum" }, "rpm.RpmPackages": { "something": [""] }, "rpm.RpmPackageProvides": { - "name=git": null, - "name=python-devel": null, - "name=something": null + "package=git": null, + "package=python-devel": null, + "package=something": null } }, "commands": [ diff --git a/tests/operations/server.script/upload_run.json b/tests/operations/server.script/upload_run.json index 171912574..5ce13d9a4 100644 --- a/tests/operations/server.script/upload_run.json +++ b/tests/operations/server.script/upload_run.json @@ -10,7 +10,9 @@ "files.File": { "path=_tempfile_": null }, - "files.Directory": {} + "files.Directory": { + "path=_tempfile_": null + } }, "commands": [ ["upload", "/somescript.sh", "_tempfile_"], diff --git a/tests/operations/server.script_template/script.json b/tests/operations/server.script_template/script.json index ff200b857..25a3571d4 100644 --- a/tests/operations/server.script_template/script.json +++ b/tests/operations/server.script_template/script.json @@ -10,7 +10,9 @@ "files.File": { "path=_tempfile_": null }, - "files.Directory": {} + "files.Directory": { + "path=_tempfile_": null + } }, "commands": [ ["upload", "_test_data_", "_tempfile_"], diff --git a/tests/operations/server.security_limit/set.json b/tests/operations/server.security_limit/set.json index d59acdf1b..e7b9538f1 100644 --- a/tests/operations/server.security_limit/set.json +++ b/tests/operations/server.security_limit/set.json @@ -5,7 +5,12 @@ "item": "memlock", "value": "unlimited" }, - "facts": {"files.FindInFile": {}}, + "facts": { + "files.FindInFile": { + "interpolate_variables=False, path=/etc/security/limits.conf, pattern=^root[[:space:]]+hard[[:space:]]+memlock.*$": [], + "interpolate_variables=False, path=/etc/security/limits.conf, pattern=^root\thard\tmemlock\tunlimited$": [] + } + }, "commands": [ "echo 'root\thard\tmemlock\tunlimited' >> /etc/security/limits.conf" ] diff --git a/tests/operations/server.service/invalid.json b/tests/operations/server.service/invalid.json index 8a541ceff..d8b0fd902 100644 --- a/tests/operations/server.service/invalid.json +++ b/tests/operations/server.service/invalid.json @@ -3,7 +3,10 @@ "facts": { "server.Which": { "command=systemctl": false, - "command=initctl": false + "command=initctl": false, + "command=rc-service": false, + "command=sv": false, + "command=service": false }, "files.Directory": { "path=/etc/init.d": false, diff --git a/tests/operations/server.service/start_initd.json b/tests/operations/server.service/start_initd.json index d8d6bc479..541fdb4a0 100644 --- a/tests/operations/server.service/start_initd.json +++ b/tests/operations/server.service/start_initd.json @@ -6,7 +6,10 @@ }, "server.Which": { "command=systemctl": false, - "command=initctl": false + "command=initctl": false, + "command=rc-service": false, + "command=sv": false, + "command=service": false }, "files.Directory": { "path=/etc/init.d": true, diff --git a/tests/operations/server.service/start_initd_service.json b/tests/operations/server.service/start_initd_service.json index e4b0d7b1c..d3c000c82 100644 --- a/tests/operations/server.service/start_initd_service.json +++ b/tests/operations/server.service/start_initd_service.json @@ -7,7 +7,15 @@ "server.Which": { "command=systemctl": false, "command=initctl": false, - "command=service": true + "command=rc-service": false, + "command=sv": false, + "command=service": false + }, + "files.Link": { + "path=/etc/init.d": false + }, + "files.Directory": { + "path=/etc/init.d": true } }, "commands": [ diff --git a/tests/operations/server.service/start_rcd.json b/tests/operations/server.service/start_rcd.json index fca2bf2ad..f10673108 100644 --- a/tests/operations/server.service/start_rcd.json +++ b/tests/operations/server.service/start_rcd.json @@ -7,7 +7,10 @@ }, "server.Which": { "command=systemctl": false, - "command=initctl": false + "command=initctl": false, + "command=rc-service": false, + "command=sv": false, + "command=service": false }, "files.Directory": { "path=/etc/init.d": false, diff --git a/tests/operations/server.service/start_runit.json b/tests/operations/server.service/start_runit.json index ac87a084f..a20673f4f 100644 --- a/tests/operations/server.service/start_runit.json +++ b/tests/operations/server.service/start_runit.json @@ -2,7 +2,11 @@ "args": ["nginx"], "facts": { "server.Which": { - "command=sv": true + "command=sv": true, + "command=systemctl": false, + "command=rc-service": false, + "command=initctl": false, + "command=service": false }, "runit.RunitManaged": { "service=nginx, svdir=/var/service": ["nginx"] diff --git a/tests/operations/server.service/start_systemd.json b/tests/operations/server.service/start_systemd.json index c4207a0d4..d0b46614b 100644 --- a/tests/operations/server.service/start_systemd.json +++ b/tests/operations/server.service/start_systemd.json @@ -2,7 +2,7 @@ "args": ["nginx.service"], "facts": { "systemd.SystemdStatus": { - "user_mode=False, machine=None, user_name=None, services=['nginx.service']": { + "machine=None, services=['nginx.service'], user_mode=False, user_name=None": { "nginx.service": false } }, diff --git a/tests/operations/server.service/start_upstart.json b/tests/operations/server.service/start_upstart.json index eba0f7e19..d2123ad3e 100644 --- a/tests/operations/server.service/start_upstart.json +++ b/tests/operations/server.service/start_upstart.json @@ -6,7 +6,10 @@ }, "server.Which": { "command=systemctl": false, - "command=initctl": true + "command=initctl": true, + "command=rc-service": false, + "command=sv": false, + "command=service": false }, "files.Directory": { "path=/etc/init.d": false, diff --git a/tests/operations/server.sysctl/set_persist.json b/tests/operations/server.sysctl/set_persist.json index 8add2212b..9cf62b138 100644 --- a/tests/operations/server.sysctl/set_persist.json +++ b/tests/operations/server.sysctl/set_persist.json @@ -8,8 +8,8 @@ "keys=['kern.max-files']": {} }, "files.FindInFile": { - "path=/etc/sysctl.conf, pattern=^.*kern.max-files[[:space:]]*=[[:space:]]*2000.*$, interpolate_variables=False": [], - "path=/etc/sysctl.conf, pattern=^.*kern.max-files = 2000.*$, interpolate_variables=False": [] + "interpolate_variables=False, path=/etc/sysctl.conf, pattern=^.*kern.max-files[[:space:]]*=[[:space:]]*2000.*$": [], + "interpolate_variables=False, path=/etc/sysctl.conf, pattern=^kern.max-files = 2000$": [] } }, "commands": [ diff --git a/tests/operations/server.user/add_group_exists.json b/tests/operations/server.user/add_group_exists.json index 54b20c6ea..d1985f858 100644 --- a/tests/operations/server.user/add_group_exists.json +++ b/tests/operations/server.user/add_group_exists.json @@ -5,7 +5,9 @@ "server.Groups": [ "someuser" ], - "files.Directory": {}, + "files.Directory": { + "path=/home/someuser": null + }, "server.Os": "Linux" }, "commands": [ diff --git a/tests/operations/server.user/add_invalid_home_is_file.json b/tests/operations/server.user/add_invalid_home_is_file.json index aef43018c..4e789ea9b 100644 --- a/tests/operations/server.user/add_invalid_home_is_file.json +++ b/tests/operations/server.user/add_invalid_home_is_file.json @@ -10,7 +10,9 @@ "files.Directory": { "path=homedir": false }, - "files.Link": {} + "files.Link": { + "path=homedir": false + } }, "exception": { "name": "OperationError", diff --git a/tests/operations/server.user/key_files.json b/tests/operations/server.user/key_files.json index deab0974c..9332929cc 100644 --- a/tests/operations/server.user/key_files.json +++ b/tests/operations/server.user/key_files.json @@ -39,9 +39,9 @@ } }, "files.FindInFile": { - "path=homedir/.ssh/authorized_keys, pattern=^.*abc.*$, interpolate_variables=False": [], - "path=homedir/.ssh/authorized_keys, pattern=^.*somekeydata.*$, interpolate_variables=False": ["somekeydata"], - "path=homedir/.ssh/authorized_keys, pattern=^.*someotherkeydata.*$, interpolate_variables=False": [] + "interpolate_variables=False, path=homedir/.ssh/authorized_keys, pattern=^.*abc.*$": [], + "interpolate_variables=False, path=homedir/.ssh/authorized_keys, pattern=^.*somekeydata.*$": ["somekeydata"], + "interpolate_variables=False, path=homedir/.ssh/authorized_keys, pattern=^.*someotherkeydata.*$": [] }, "server.Groups": {} }, diff --git a/tests/operations/server.user/keys.json b/tests/operations/server.user/keys.json index f39b22e8e..ab12e3131 100644 --- a/tests/operations/server.user/keys.json +++ b/tests/operations/server.user/keys.json @@ -32,7 +32,7 @@ } }, "files.FindInFile": { - "path=homedir/.ssh/authorized_keys, pattern=^.*abc.*$, interpolate_variables=False": [] + "interpolate_variables=False, path=homedir/.ssh/authorized_keys, pattern=^.*abc.*$": [] }, "server.Groups": {} }, diff --git a/tests/operations/server.user/keys_nohome.json b/tests/operations/server.user/keys_nohome.json index 3d2847730..a1b34beb3 100644 --- a/tests/operations/server.user/keys_nohome.json +++ b/tests/operations/server.user/keys_nohome.json @@ -31,7 +31,7 @@ } }, "files.FindInFile": { - "path=/root/.ssh/authorized_keys, pattern=^.*abc.*$, interpolate_variables=False": [] + "interpolate_variables=False, path=/root/.ssh/authorized_keys, pattern=^.*abc.*$": [] }, "server.Groups": {} }, diff --git a/tests/operations/server.user/keys_single.json b/tests/operations/server.user/keys_single.json index a72dcfeba..bcf1069ea 100644 --- a/tests/operations/server.user/keys_single.json +++ b/tests/operations/server.user/keys_single.json @@ -32,7 +32,7 @@ } }, "files.FindInFile": { - "path=homedir/.ssh/authorized_keys, pattern=^.*abc.*$, interpolate_variables=False": [] + "interpolate_variables=False, path=homedir/.ssh/authorized_keys, pattern=^.*abc.*$": [] }, "server.Groups": {} }, diff --git a/tests/operations/systemd.service/daemon_reload.json b/tests/operations/systemd.service/daemon_reload.json index 5b303f838..1f730203c 100644 --- a/tests/operations/systemd.service/daemon_reload.json +++ b/tests/operations/systemd.service/daemon_reload.json @@ -5,7 +5,7 @@ }, "facts": { "systemd.SystemdStatus": { - "user_mode=False, machine=None, user_name=None, services=['redis-server.service']": { + "machine=None, services=['redis-server.service'], user_mode=False, user_name=None": { "redis-server.service": true } } diff --git a/tests/operations/systemd.service/disabled.json b/tests/operations/systemd.service/disabled.json index cfa3a35ba..454249c72 100644 --- a/tests/operations/systemd.service/disabled.json +++ b/tests/operations/systemd.service/disabled.json @@ -5,12 +5,12 @@ }, "facts": { "systemd.SystemdStatus": { - "user_mode=False, machine=None, user_name=None, services=['redis-server.service']": { + "machine=None, services=['redis-server.service'], user_mode=False, user_name=None": { "redis-server.service": true } }, "systemd.SystemdEnabled": { - "user_mode=False, machine=None, user_name=None, services=['redis-server.service']": { + "machine=None, services=['redis-server.service'], user_mode=False, user_name=None": { "redis-server.service": true } } diff --git a/tests/operations/systemd.service/enabled.json b/tests/operations/systemd.service/enabled.json index 416789f5a..00cddc6da 100644 --- a/tests/operations/systemd.service/enabled.json +++ b/tests/operations/systemd.service/enabled.json @@ -5,12 +5,12 @@ }, "facts": { "systemd.SystemdStatus": { - "user_mode=False, machine=None, user_name=None, services=['redis-server.service']": { + "machine=None, services=['redis-server.service'], user_mode=False, user_name=None": { "redis-server.service": true } }, "systemd.SystemdEnabled": { - "user_mode=False, machine=None, user_name=None, services=['redis-server.service']": { + "machine=None, services=['redis-server.service'], user_mode=False, user_name=None": { "redis-server.service": false } } diff --git a/tests/operations/systemd.service/machine_daemon_reload.json b/tests/operations/systemd.service/machine_daemon_reload.json index 365f0a9d8..7d6887a48 100644 --- a/tests/operations/systemd.service/machine_daemon_reload.json +++ b/tests/operations/systemd.service/machine_daemon_reload.json @@ -7,7 +7,7 @@ }, "facts": { "systemd.SystemdStatus": { - "user_mode=False, machine=testmachine, user_name=None, services=['redis-server.service']": { + "machine=testmachine, services=['redis-server.service'], user_mode=False, user_name=None": { "redis-server.service": true } } diff --git a/tests/operations/systemd.service/machine_disabled.json b/tests/operations/systemd.service/machine_disabled.json index 536175103..a5c653ed8 100644 --- a/tests/operations/systemd.service/machine_disabled.json +++ b/tests/operations/systemd.service/machine_disabled.json @@ -6,12 +6,12 @@ }, "facts": { "systemd.SystemdStatus": { - "user_mode=False, machine=testmachine, user_name=None, services=['redis-server.service']": { + "machine=testmachine, services=['redis-server.service'], user_mode=False, user_name=None": { "redis-server.service": true } }, "systemd.SystemdEnabled": { - "user_mode=False, machine=testmachine, user_name=None, services=['redis-server.service']": { + "machine=testmachine, services=['redis-server.service'], user_mode=False, user_name=None": { "redis-server.service": true } } diff --git a/tests/operations/systemd.service/machine_enabled.json b/tests/operations/systemd.service/machine_enabled.json index 0d6b97939..d770b5456 100644 --- a/tests/operations/systemd.service/machine_enabled.json +++ b/tests/operations/systemd.service/machine_enabled.json @@ -6,12 +6,12 @@ }, "facts": { "systemd.SystemdStatus": { - "user_mode=False, machine=testmachine, user_name=None, services=['redis-server.service']": { + "machine=testmachine, services=['redis-server.service'], user_mode=False, user_name=None": { "redis-server.service": true } }, "systemd.SystemdEnabled": { - "user_mode=False, machine=testmachine, user_name=None, services=['redis-server.service']": { + "machine=testmachine, services=['redis-server.service'], user_mode=False, user_name=None": { "redis-server.service": false } } diff --git a/tests/operations/systemd.service/machine_start.json b/tests/operations/systemd.service/machine_start.json index fa6d4672e..9dab7d9c7 100644 --- a/tests/operations/systemd.service/machine_start.json +++ b/tests/operations/systemd.service/machine_start.json @@ -6,7 +6,7 @@ }, "facts": { "systemd.SystemdStatus": { - "user_mode=False, machine=testmachine, user_name=None, services=['redis-server.service']": { + "machine=testmachine, services=['redis-server.service'], user_mode=False, user_name=None": { "redis-server.service": false } } diff --git a/tests/operations/systemd.service/running_ambiguous_unit.json b/tests/operations/systemd.service/running_ambiguous_unit.json index 444dc521c..bcf8d5638 100644 --- a/tests/operations/systemd.service/running_ambiguous_unit.json +++ b/tests/operations/systemd.service/running_ambiguous_unit.json @@ -2,7 +2,7 @@ "args": ["redis-server"], "facts": { "systemd.SystemdStatus": { - "user_mode=False, machine=None, user_name=None, services=['redis-server.service']": { + "machine=None, services=['redis-server.service'], user_mode=False, user_name=None": { "redis-server.service": false } } diff --git a/tests/operations/systemd.service/running_noop.json b/tests/operations/systemd.service/running_noop.json index 69c50281b..ec228ed58 100644 --- a/tests/operations/systemd.service/running_noop.json +++ b/tests/operations/systemd.service/running_noop.json @@ -2,7 +2,7 @@ "args": ["redis-server.service"], "facts": { "systemd.SystemdStatus": { - "user_mode=False, machine=None, user_name=None, services=['redis-server.service']": { + "machine=None, services=['redis-server.service'], user_mode=False, user_name=None": { "redis-server.service": true } } diff --git a/tests/operations/systemd.service/running_timer.json b/tests/operations/systemd.service/running_timer.json index 9d4552237..f83949170 100644 --- a/tests/operations/systemd.service/running_timer.json +++ b/tests/operations/systemd.service/running_timer.json @@ -2,7 +2,7 @@ "args": ["some-timer.timer"], "facts": { "systemd.SystemdStatus": { - "user_mode=False, machine=None, user_name=None, services=['some-timer.timer']": { + "machine=None, services=['some-timer.timer'], user_mode=False, user_name=None": { "some-timer.timer": false } } diff --git a/tests/operations/systemd.service/start.json b/tests/operations/systemd.service/start.json index d16e8ed0c..680de98fc 100644 --- a/tests/operations/systemd.service/start.json +++ b/tests/operations/systemd.service/start.json @@ -2,7 +2,7 @@ "args": ["redis-server.service"], "facts": { "systemd.SystemdStatus": { - "user_mode=False, machine=None, user_name=None, services=['redis-server.service']": { + "machine=None, services=['redis-server.service'], user_mode=False, user_name=None": { "redis-server.service": false } } diff --git a/tests/operations/systemd.service/stopped_noop.json b/tests/operations/systemd.service/stopped_noop.json index 9e8ed98ac..e66e17be4 100644 --- a/tests/operations/systemd.service/stopped_noop.json +++ b/tests/operations/systemd.service/stopped_noop.json @@ -5,7 +5,7 @@ }, "facts": { "systemd.SystemdStatus": { - "user_mode=False, machine=None, user_name=None, services=['redis-server.service']": { + "machine=None, services=['redis-server.service'], user_mode=False, user_name=None": { "redis-server.service": false } } diff --git a/tests/operations/systemd.service/timer.json b/tests/operations/systemd.service/timer.json index 3805d7402..6fc720a78 100644 --- a/tests/operations/systemd.service/timer.json +++ b/tests/operations/systemd.service/timer.json @@ -2,7 +2,7 @@ "args": ["logrotate.timer"], "facts": { "systemd.SystemdStatus": { - "user_mode=False, machine=None, user_name=None, services=['logrotate.timer']": { + "machine=None, services=['logrotate.timer'], user_mode=False, user_name=None": { "logrotate.timer": false } } diff --git a/tests/operations/systemd.service/user_daemon_reload.json b/tests/operations/systemd.service/user_daemon_reload.json index f1e38e5d5..3525af285 100644 --- a/tests/operations/systemd.service/user_daemon_reload.json +++ b/tests/operations/systemd.service/user_daemon_reload.json @@ -6,7 +6,7 @@ }, "facts": { "systemd.SystemdStatus": { - "user_mode=True, machine=None, user_name=None, services=['redis-server.service']": { + "machine=None, services=['redis-server.service'], user_mode=True, user_name=None": { "redis-server.service": true } } diff --git a/tests/operations/systemd.service/user_disabled.json b/tests/operations/systemd.service/user_disabled.json index 8f1c0f7ee..efe50fa74 100644 --- a/tests/operations/systemd.service/user_disabled.json +++ b/tests/operations/systemd.service/user_disabled.json @@ -6,12 +6,12 @@ }, "facts": { "systemd.SystemdStatus": { - "user_mode=True, machine=None, user_name=None, services=['redis-server.service']": { + "machine=None, services=['redis-server.service'], user_mode=True, user_name=None": { "redis-server.service": true } }, "systemd.SystemdEnabled": { - "user_mode=True, machine=None, user_name=None, services=['redis-server.service']": { + "machine=None, services=['redis-server.service'], user_mode=True, user_name=None": { "redis-server.service": true } } diff --git a/tests/operations/systemd.service/user_machine_daemon_reload.json b/tests/operations/systemd.service/user_machine_daemon_reload.json index 6f9b81422..8f26776c8 100644 --- a/tests/operations/systemd.service/user_machine_daemon_reload.json +++ b/tests/operations/systemd.service/user_machine_daemon_reload.json @@ -8,7 +8,7 @@ }, "facts": { "systemd.SystemdStatus": { - "user_mode=True, machine=testmachine, user_name=testuser, services=['redis-server.service']": { + "machine=testmachine, services=['redis-server.service'], user_mode=True, user_name=testuser": { "redis-server.service": true } } diff --git a/tests/operations/systemd.service/user_machine_disabled.json b/tests/operations/systemd.service/user_machine_disabled.json index 75322843f..4591143ee 100644 --- a/tests/operations/systemd.service/user_machine_disabled.json +++ b/tests/operations/systemd.service/user_machine_disabled.json @@ -8,12 +8,12 @@ }, "facts": { "systemd.SystemdStatus": { - "user_mode=True, machine=testmachine, user_name=testuser, services=['redis-server.service']": { + "machine=testmachine, services=['redis-server.service'], user_mode=True, user_name=testuser": { "redis-server.service": true } }, "systemd.SystemdEnabled": { - "user_mode=True, machine=testmachine, user_name=testuser, services=['redis-server.service']": { + "machine=testmachine, services=['redis-server.service'], user_mode=True, user_name=testuser": { "redis-server.service": true } } diff --git a/tests/operations/systemd.service/user_machine_enabled.json b/tests/operations/systemd.service/user_machine_enabled.json index 6e176b790..a23f33cc1 100644 --- a/tests/operations/systemd.service/user_machine_enabled.json +++ b/tests/operations/systemd.service/user_machine_enabled.json @@ -8,12 +8,12 @@ }, "facts": { "systemd.SystemdStatus": { - "user_mode=True, machine=testmachine, user_name=testuser, services=['redis-server.service']": { + "machine=testmachine, services=['redis-server.service'], user_mode=True, user_name=testuser": { "redis-server.service": true } }, "systemd.SystemdEnabled": { - "user_mode=True, machine=testmachine, user_name=testuser, services=['redis-server.service']": { + "machine=testmachine, services=['redis-server.service'], user_mode=True, user_name=testuser": { "redis-server.service": false } } diff --git a/tests/operations/systemd.service/user_machine_start.json b/tests/operations/systemd.service/user_machine_start.json index 0372346d6..2add8387b 100644 --- a/tests/operations/systemd.service/user_machine_start.json +++ b/tests/operations/systemd.service/user_machine_start.json @@ -7,7 +7,7 @@ }, "facts": { "systemd.SystemdStatus": { - "user_mode=True, machine=testmachine, user_name=testuser, services=['redis-server.service']": { + "machine=testmachine, services=['redis-server.service'], user_mode=True, user_name=testuser": { "redis-server.service": false } } diff --git a/tests/operations/systemd.service/user_start.json b/tests/operations/systemd.service/user_start.json index 8961d218f..74df03e35 100644 --- a/tests/operations/systemd.service/user_start.json +++ b/tests/operations/systemd.service/user_start.json @@ -5,7 +5,7 @@ }, "facts": { "systemd.SystemdStatus": { - "user_mode=True, machine=None, user_name=None, services=['redis-server.service']": { + "machine=None, services=['redis-server.service'], user_mode=True, user_name=None": { "redis-server.service": false } } diff --git a/tests/operations/upstart.service/disabled.json b/tests/operations/upstart.service/disabled.json index 01977640e..493c5aa1d 100644 --- a/tests/operations/upstart.service/disabled.json +++ b/tests/operations/upstart.service/disabled.json @@ -11,7 +11,8 @@ "path=/etc/init/redis-server.override": null }, "files.Directory": { - "path=/etc/init": {"mode": 777} + "path=/etc/init": {"mode": 777}, + "path=/etc/init/redis-server.override": null } }, "commands": [ diff --git a/tests/operations/yum.repo/add.json b/tests/operations/yum.repo/add.json index f17e23eeb..e4c932e9f 100644 --- a/tests/operations/yum.repo/add.json +++ b/tests/operations/yum.repo/add.json @@ -11,7 +11,8 @@ "path=/etc/yum.repos.d/somerepo.repo": {} }, "files.Directory": { - "path=/etc/yum.repos.d": true + "path=/etc/yum.repos.d": true, + "path=/etc/yum.repos.d/somerepo.repo": null } }, "commands": [[ diff --git a/tests/util.py b/tests/util.py index ae40fae7b..25d3be81a 100644 --- a/tests/util.py +++ b/tests/util.py @@ -206,7 +206,7 @@ def get_fact(self, fact_cls, *args, **kwargs): fact_key = self._get_fact_key(fact_cls) fact = getattr(self.fact, fact_key, None) if fact is None: - raise KeyError("Missing test fact data: {0}".format(fact_key)) + raise KeyError(f"Missing test fact: {fact_key}") # This does the same thing that pyinfra.apit.facts._handle_fact_kwargs does if args or kwargs: @@ -215,14 +215,10 @@ def get_fact(self, fact_cls, *args, **kwargs): if kwargs: self._check_fact_args(fact_cls, kwargs) - fact_ordered_keys = {_sort_kwargs_str(key): value for key, value in fact.items()} - kwargs_str = _sort_kwargs_str(get_kwargs_str(kwargs)) + kwargs_str = get_kwargs_str(kwargs) if kwargs_str not in fact: - s = f"Possible missing entry '{kwargs_str}' for fact '{fact_key}', if the fact " - "is supposed to return None, set the entry to null in the JSON test file." - print(s) - warnings.warn(s) - return fact_ordered_keys.get(kwargs_str) + raise KeyError(f"Missing test fact key: {fact_key} -> {kwargs_str}") + return fact.get(kwargs_str) return fact