summaryrefslogtreecommitdiff
path: root/spec/unit/module_tool/tar/gnu_spec.rb
AgeCommit message (Collapse)AuthorFilesLines
2014-05-14(PUP-2561) Fix spec test on windowsKylo Ginsberg1-1/+1
2014-05-13(PUP-2561) Revert to using UNIX pipes in PMT’s tar operations.Pieter van de Bruggen1-7/+5
Prior to this change, we’d attempted to handle shell escaping of arguments by passing arrays of arguments rather than a single full command string. While this worked as intended, it meant that we needed to stream data between processes through Ruby. As it happens, larger tarballs would cause the write pipeline to become backed up, and since we would attempt to write all the data before reading any, we would effectively deadlock. Rather than attempting to stream by chunks, we’ve reverted back to using the full string commands, and managing shell escapes (where needed) in Ruby.
2014-04-24(Maint) Don't expand tar cf - sourcedir pathJosh Cooper1-1/+1
The Gnu tar implementation executes `tar cf - #{sourcedir}`, which can be a relative path. So it is not necessary to expand it, and doing so causes the test to fail on windows.
2014-04-24(maint) Adding File.expand_path to the Tar::Gnu specs.Pieter van de Bruggen1-6/+6
Prior to this commit, the specs made assertions about absolute file paths, which works perfectly until you try running the tests under Windows. This change patches the tests so that they will continue to run properly under both Windows and Linux.
2014-04-21(PUP-2278) Parameterize the mode of Puppet::Util::Execution.execpipe.Pieter van de Bruggen1-2/+2
In the previous commit, the default behavior of `execpipe` was changed to ensure that the pipe was always opened in read/write mode. While we aren't aware of any regressions this change would cause, the cautious route is to maintain the same default behavior for now; to that end, this commit adds a `mode` parameter to `execpipe`, allowing callers to choose the mode the pipe is opened in.
2014-04-18(PUP-2278) Accept paths with spaces in PMT tarball interactions.Pieter van de Bruggen1-9/+11
Prior to this commit, if the module_working_dir or the path to a module being built contained whitespace, our simple string-interpolation would fail to create a valid call to `tar` or `gzip`. This change fixes the bugs resulting from that behavior.
2014-02-22Add tests for module_tool changesReid Vandewiele1-1/+2
I'm not entirely sure if I'm using #yields() correctly but this allows me to expect that Dir.chdir is called, and still expect all the calls to Puppet::Util::Execution.execute to be made.
2013-11-11(#9546) Update test to reflect changed permissionsAndrew Parker1-2/+2
2013-08-06Ensure that PMT uses the correct group membership.Pieter van de Bruggen1-2/+2
Previously, modules installed by the root user would retain the original group membership information. This change ensures that the group will match the module directory being installed to.
2013-08-06(#14333) Ensure module permissions are sane.Pieter van de Bruggen1-2/+5
Prior to this change, tarballs unpacked by the root user would be unpacked with the permissions and the ownership information present in the tarball. In the best case, this made some modules fail to function after installation since the newly installed module was owned by a different user. In the worst case, this could be seen as a fairly serious security vulnerability. This change ensures that the module's permissions are always owner-writable, world-readable, and that the owner is always the same as the module's parent directory.
2013-04-17(maint) Fix puppet module build empty tar issue on SolarisJeff McCune1-1/+1
Without this patch `puppet module build` produces an empty tar file when run on Solaris. This is obviously a problem. The root cause is that tar defaults to writing the archive to the tape device instead of STDOUT as was expected. This patch fixes the problem by explicitly using `tar cf - ...` to write the archive to STDOUT. Paired-with: Andrew Parker <andy@puppetlabs.com>
2013-04-15(#11276) Select tar command or minitarJosh Cooper1-0/+19
Previously, the module tool relied on GNU versions of tar and gzip/gunzip to build and install modules, which isn't portable on Windows in particular. This commit adds Gnu, Solaris, and Mini tar implementations for packing and unpacking tar.gz format. It modifies the module tool to select the appropriate implementation for the platform it's currently running on. Paired-with: Andy Parker <andy@puppetlabs.com>