Commit Graph

64 Commits

Author SHA1 Message Date
Alex Willmer b822f20007 ansible_mitogen: Handle AnsibleUnsafeText et al in Ansible >= 7
Follwing fixes in Ansible 7-9 for CVE-2023-5764 cating `AnsibleUnsafeBytes` &
`AnsibleUnsafeText` to `bytes()` or `str()` requires special handling. The
handling is Ansible specific, so it shouldn't go in the mitogen package but
rather the ansible_mitogen package.

`ansible_mitogen.utils.unsafe.cast()` is most like `mitogen.utils.cast()`.
During development it began as `ansible_mitogen.utils.unsafe.unwrap_var()`,
closer to an inverse of `ansible.utils.unsafe_procy.wrap_var()`. Future
enhancements may move in this direction.

refs #977, refs #1046

See also
- https://github.com/advisories/GHSA-7j69-qfc3-2fq9
- https://github.com/ansible/ansible/pull/82293
- https://github.com/mitogen-hq/mitogen/wiki/AnsibleUnsafe-notes
2024-04-04 09:11:23 +01:00
Alex Willmer 526422b74b tests: Name tasks
For easier grep, and easier identification in task_profiler summaries.
2022-09-12 19:27:40 +01:00
Alex Willmer db0ffae352 tests: Enable stricter error handling, fix resulting failures 2022-07-17 13:44:05 +01:00
Alex Willmer 216e7c9150 tests: Correct Ansible targets 2022-07-17 13:44:05 +01:00
Alex Willmer f070767dad tests: Use meaningful play names 2022-07-17 13:44:05 +01:00
Klaus Zerwes 2b4f04c554 Revert "Revert "fixed tests for ansible 2.12""
This reverts commit 478f286efb.
2021-12-12 22:12:01 +01:00
Klaus Zerwes 478f286efb Revert "fixed tests for ansible 2.12"
include is deprecated and will be removed in 2.16, so there is some time to fix this left
This reverts commit 2d3970552e.
2021-12-12 20:34:52 +01:00
Klaus Zerwes 2d3970552e fixed tests for ansible 2.12 2021-12-08 23:46:36 +01:00
Alex Willmer 3c58215a91 tests: Tag Ansible tests
This makes it easier to run subsets using ANSIBLE_RUN_TAGS=...
2021-11-02 20:07:28 +00:00
Alex Willmer cfa5888547 tests: Print variables on failure of assert tasks
Fixes #852
2021-09-07 22:10:25 +01:00
Steven Robertson 5a0da02e6c code review changes, using when statements and adding trailing comma 2020-11-12 20:47:28 -08:00
Steven Robertson 24d716aab9 oops, 0664 not 0666 2020-10-03 16:46:52 -07:00
Steven Robertson 355e2ffba2 fix fixup_perms2() test 2020-10-03 16:39:23 -07:00
Steven Robertson 22bc5448b1 default copy perms look like 0644 now based on ansible source and docs 2020-10-03 16:10:50 -07:00
Steven Robertson 8481c50a59 ignore synchronize for now, made ticket 2020-10-01 21:25:13 -07:00
Steven Robertson a7705a3435 add back in ansible tests but don't run synchronize 2020-09-22 19:26:33 -07:00
Steven Robertson b26a636bba remove ansible 2.4-specific test 2020-09-06 15:08:56 -07:00
Steven Robertson fbb92e461f fix fixup_perms2 default file mode 2020-09-06 14:51:40 -07:00
Steven Robertson 8925f8a9d7 disabled another issue with sudo on this test 2020-02-21 13:29:38 -08:00
Steven Robertson ebf628a812 disabling another test 2020-02-21 13:04:05 -08:00
Steven Robertson ecb15cd5f0 disable failing Azure test but that works locally 2020-02-20 14:29:01 -08:00
Steven Robertson 79b8814142 bump macOS test vm to replicate what passes locally 2020-02-19 11:25:20 -08:00
Steven Robertson a7fe74cdba forgot to dump gid info 2020-02-19 10:08:17 -08:00
Steven Robertson 96f896b56c added debugging to figure out what's up with become_user and sudo runas gid not found 2020-02-19 10:04:51 -08:00
Steven Robertson 371ef07683 with statement doesn't exist in early python 2020-02-18 15:35:33 -08:00
Steven Robertson 9eedff97a6 closed fp after writing to temp files 2020-02-15 15:40:10 -08:00
David Wilson 61b651bdd2 issue #587: workaround for ansible/ansible#56629 2019-05-27 20:15:02 +01:00
David Wilson 6309774be2 issue #554: fix Ansible 2.4 compatibility 2019-03-06 12:06:55 +00:00
David Wilson f36b4b47bf issue #554: don't rely on tmp_path autoremoval in test.
Ansible doesn't do this, so we shouldn't either.
2019-03-06 11:22:40 +00:00
David Wilson 7743e57ff3 issue #554: track and remove multiple make_tmp_path() calls. 2019-03-06 10:55:07 +00:00
David Wilson 9df314f9c5 issue #499: another totally moronic implementation difference 2019-01-29 03:55:18 +00:00
David Wilson c61498202e issue #477: use assert_equal for nicer debug. 2019-01-27 03:50:41 +00:00
David Wilson 7d1b0e0807 issue #477: Ansible 2.3 did not support gather_facts min subset. 2019-01-27 02:03:15 +00:00
David Wilson c1a4597e32 issue #477: tests: use Ansible 2.3-compatible include rather than import
This will break with Ansible 2.8. Probably going to end up with a regex
hack for CI.
2019-01-24 04:17:07 +00:00
David Wilson bd82fa1986 issue #426: fix low_level_execute_command.yml breakage. 2019-01-18 23:30:12 +00:00
David Wilson a6e6fd14be issue #426: more 2->3 test fixes. 2019-01-18 23:30:12 +00:00
David Wilson 67f710fd9b issue #426: use delegate_to in fixup_perms2 and copy.yml 2019-01-18 23:30:12 +00:00
David Wilson bef4b0c962 tests: fix copy.yml title 2018-11-06 22:31:50 +00:00
David Wilson f87553b165 tests: must set ansible_become_pass in synchronize.yml. 2018-11-05 13:00:47 +00:00
David Wilson fd5066d671 tests: teach various tests to cleanup /tmp when they're done. 2018-10-23 15:34:18 +01:00
David Wilson 1b17aa1d1a ansible: fix temp cleanup regression and add test; closes #397. 2018-10-23 14:42:44 +01:00
David Wilson 2eb3ea78d6 tests: remove a bunch of stray debug 2018-10-02 19:19:30 +01:00
David Wilson 5521945bd2 ansible: temporary files take 5. 2018-10-02 19:19:30 +01:00
David Wilson 638e473ff1 tests: hacksmash synchronize test to work
Avoid password typing idiocy.
2018-10-02 19:19:30 +01:00
David Wilson 638b196a45 ansible: fix put_file() for large temporary files.
Reverts 49736b3a, large file copies can't avoid the RTT.

The parent stack must be blocked while FileService progresses, as unlike
the small file path, it does not make a snapshot of the (possibly
temporary) file passed by the action plug-in. So we need to keep that
file alive while the service runs.

Add a new integration test and a new soak test to cover both.
2018-09-10 19:09:37 +01:00
David Wilson 001b63074c tests: fix another typo. 2018-09-10 03:18:57 +01:00
David Wilson d5524178bf tests: fix bonehead syntax error. 2018-09-10 02:27:19 +01:00
David Wilson 65f03e03f5 tests: remote_tmp test fixes. 2018-09-10 02:17:01 +01:00
David Wilson 72fa129f8a tests: fix clash when localhost is test-target 2018-09-08 20:53:11 +01:00
David Wilson 90c2ed03d0 ansible: fix synchronize module
Broken by recent connection delegation fixes.
2018-08-20 15:43:56 +01:00