Island: Add unit test leaving no readme if no target dir

This commit is contained in:
Ilija Lazoroski 2021-07-09 11:23:22 +02:00
parent 69754205d0
commit 80050b89e6
1 changed files with 13 additions and 0 deletions

View File

@ -244,3 +244,16 @@ def test_readme_already_exists(
).run_payload() ).run_payload()
mock_copy_file.assert_not_called() mock_copy_file.assert_not_called()
def test_no_readme_if_no_directory(
build_ransomware_payload, ransomware_payload_config, ransomware_target
):
ransomware_payload_config["encryption"]["enabled"] = True
ransomware_payload_config["encryption"]["directories"]["linux_target_dir"] = ""
ransomware_payload_config["encryption"]["directories"]["windows_target_dir"] = ""
ransomware_payload_config["other_behaviors"]["readme"] = True
ransomware_payload = build_ransomware_payload(ransomware_payload_config)
ransomware_payload.run_payload()
assert not Path(ransomware_target / README_DEST).exists()