Commit Graph

24 Commits (9af0d916768986f50647b11f896a7cdac1550230)

Author SHA1 Message Date
Sam Doran 004c33d9c5
unarchive - do not fail in init when trying to find required binary (#74892)
Test for the required binaries in the can_handle_archive() method and fail there. This
prevents failures for missing binaries unrelated to the archive type.

* Update missing zip binary message to match tar message
* Update unit tests
* Add integration tests
* Define packages based on the system rather than ignoring failures
3 years ago
Matt Clay ca507ff477 Integration test fixes. 3 years ago
Alexander Sowitzki ff88a2a06d Fix combinated run of unarchive and uri tests under centos 6
The unarchive integration test installs pinned packages via pip,
the uri test installs them from system packages. This explodes.
PR lets unarchive uninstall packages after test ran.
3 years ago
Jeff Squyres 6fd0a74601
unarchive: add support for .tar.zst (zstd compression) (#73265) 4 years ago
Sijis Aviles 034e9b0252
unarchive - add include option (#40522)
This should allow users to extract specific files from an archive as
desired.

Fixes #16130, #27081.

* Rebase and make a few minor changes
* Add changelog
* Improve tests

- move to separate tasks file
- change assertions to check for exactly one file
- use remote_tmp_dir for output dir

* Make exclude and include mutually exclusive
* Don't remove files needed by other tasks
* Fix sanity tests
* Improve feature documentation
* Skip tests that use map() on CentOS 6
* Use fnmatch on include for zip archives
  This matches the behavior of exclude

Co-authored-by: Sam Doran <sdoran@redhat.com>
4 years ago
Rick Elrod ebc91a9b93
[unarchive] work on older RHEL with group: <gid> (#72098)
Change:
- No longer fail due to old Fedora/RHEL and our failure to try to cast
  gids to integers before trying to pass them to getgrgid() before
  trying to use them.
- Add tests for user/mode for various unarchive formats.

Test Plan:
- New integration tests, ran against centos6 container

Tickets:
- Fixes #71903
4 years ago
Matt Martz 7c60dadb9a
Updates to Integration tests to pass against Alpine (#70946)
* Start of alpine testing

* More updates

* Add forgotten file

* remove debug

* Add alpine3

* equal

* group 4

* group 4

* group 5

* Try to decrease test length

* libuser only available in testing

* Remove debug

* Make loops target work on hosts without gnu date

* Enable alpine testing

* ci_complete

* Don't specify uid for creating test user

* ci_complete

* Re-sort docker completion

* use newer container image

* ci_complete

* fix indentation

Co-authored-by: Matt Clay <matt@mystile.com>

Co-authored-by: Matt Clay <matt@mystile.com>
4 years ago
Sam Doran f99f96ceb6
Fix unstable unarchive test (#71004)
* Add mode to copy tasks
* Fix unreliable test by ignoring errors
4 years ago
Philip Douglass ac5f3f8bef
unarchive - Check 'fut_gid' against 'run_gid' in addition to supplemental groups (#65666)
Add integration tests for unarchiving as unprivileged user
Break tasks into separate files for easier reading and maintenance

Create a user by specifying a default group of 'staff' for macOS.

The user module does not actually remove the user directory on macOS,
so explicitly remove it.

Put the removal tasks in an always block to ensure they always run

Co-authored-by: Philip Douglass <philip.douglass@amadeus.com>
Co-authored-by: Sam Doran <sdoran@redhat.com>
4 years ago
Rick Elrod 2af76f16be
Unify yaml style in unarchive tests to be dict-style (refs #68272) (#68477)
Signed-off-by: Rick Elrod <rick@elrod.me>
5 years ago
Rick Elrod 0651e1c25f
Add some more test coverage for unarchive (#68272)
* Add some more test coverage for unarchive

This moves over (and slightly extends) coverage which was found in
incidental_flatpak_remote.

Signed-off-by: Rick Elrod <rick@elrod.me>

* add a group for testing too, user creation does not mean group creation on all platforms

Signed-off-by: Rick Elrod <rick@elrod.me>

* update the test group assert

Signed-off-by: Rick Elrod <rick@elrod.me>

* Fix style

Signed-off-by: Rick Elrod <rick@elrod.me>

* block/always

Signed-off-by: Rick Elrod <rick@elrod.me>
5 years ago
Matt Clay 6a79bb2b91 Simplify package install in unarchive test.
This will enable the test to work on supported platforms when modules for other platforms are not present.
5 years ago
Sam Doran ad341ea4bb Fix unarchive integration test failure due to rpm error (#66420)
* Fix unarchive integration test failure
* Do not cleanup pip packages
5 years ago
Sam Doran 22be69188b
Fix unarchive integration test on CentOS 6 (#66362)
* Cleanup packages added for Python TLS support
5 years ago
Matt Clay 86ae3cfa12 Install zip for unarchive test when using dnf. 5 years ago
Sloane Hertel 23f0ca0acd fix unarchive integration tests when LC_ALL is not set to en_US.UTF-8 (#58431) 5 years ago
Matt Clay d2a7cc0b9f Fix integration tests to support remote hosts. 6 years ago
lrrb 4f9f1754b4 fix: ensure than all item of a list of excluded files aren't checked (#45122)
* fix: ensure than list of excluded files aren't checked
* test: exclude a list of files
6 years ago
Evgeni Golov 7c66c90afc introduce `module_utils.urls.fetch_file` as a wrapper to download and save files (#19172)
* module_utils.urls: add fetch_file function

* apt: use fetch_file instead of own download()

* unarchive: use fetch_file instead of own codecopy

* apt: add test for deb=http://…

* unarchive: add test for a remote file download and unarchive

* yum: replace fetch_rpm_from_url by fetch_file

* use NamedTemporaryFile

* don't add a dot to fileext, it's already there
6 years ago
Sijis Aviles ba3db90e3a Fix: wildcard excludes in unarchive with tar archives (#40935)
* fix: exclude using wildcards for tar archives

Fixes #37842, #22947

* fix: Remove quote() as it munges the exclude format

* test: Refactor to use single archive structure

A common structure archived by different methods should simplify some of
the feature tests.

* test: Use common archive layout to validate exclude feature

* test: Use the same exclude checks for zip/tar archives
6 years ago
Sijis Aviles 529ef6446e fix: Ensure zip excluded files are not checked (#40120)
* fix: Ensure zip excluded files are not checked

Fixes #26279

* test: Verify unarchive excludes behaves as expected

* fix: Typos and whitespaces
6 years ago
Toshio Kuratomi 039383d90f Fix symbolic mode usage in unarchive with zip files
Fixes #21090
7 years ago
chriskarel 991918e9d2 Fix idempotency for Unix permissions in zip files. (#24580)
* Fix idempotency for Unix permissions in zip files.

This fix prevents the unarchive module from reporting 'changed' when a zipfile contains items with Unix permissions that differ from the system default.

* Update zip unarchive tests.

Additional tests for the unarchive module with zip files:
- Test file in zip archive with non-default permissions
- Test file added to zip archive with Windows permissions

* Additional fix for mixed win/unix archives.

  Turns out my original fix fails under some mixed archives, as setting the umask to zero can be applied to those files.  This creates a per-file umask variable, so a mix of permission types don't cause problems.

* CI Checks

CI checks for archives with:
* non default Unix permissions
* Windows permissions


* Workaround for BSD differences.

Using Zipinfo due to lack of support in BSD unzip.
Permissions handling is also different in BSD -- always applies UMASK to file permissions.

* Added checks for creating directories and SSH keys for existing users.
7 years ago
Matt Clay 75e4645ee7 Migrate Linux CI roles to test targets. (#17997) 8 years ago