Commit graph

37 commits

Author SHA1 Message Date
Joshua Hoblitt
41d5d4ccd1 fix regression preventing usage of fragment ensure => /target syntax
Also fix a historical bug that prevents a fragment from being converted
from a symlink to using a source or content parameter.
2013-12-05 22:39:23 -07:00
Joshua Hoblitt
f1a57a6c7e add system tests for file fragments sourced from a single file
In addition to checking for fragment sourcing from a 'list' of files.
2013-12-05 10:12:29 -07:00
Joshua Hoblitt
ae1e74cf36 add system tests for replacing symlinks and directories 2013-11-18 14:58:46 -07:00
Joshua Hoblitt
4ee4be00ac minor system test cleanups 2013-11-13 20:28:27 -07:00
Joshua Hoblitt
c852dc22d7 clean up between system spec files 2013-11-13 17:56:47 -07:00
Tristan Smith
499f338ce5 put the shell() calls into before{} blocks so that they're executed meaningfully. Testing to make sure a file doesn't exist shouldn't be as much of a hack as that is. I'm obviously missing something in the framework, but this works. 2013-11-13 14:23:30 -08:00
Tristan Smith
6c687551d8 Initial pass at test to ensure fragments accept and properly handle the underlying file source attribute. 2013-11-13 11:31:56 -08:00
Joshua Hoblitt
ba9501c1a0 allow source param to concat::fragment to be a string or an Array
This is resolve a regression preventing an array of string(s) being passed to the fragment file resource's source parameter.
2013-11-12 23:20:48 -07:00
Joshua Hoblitt
8695e7ff63 Merge pull request #96 from jhoblitt/fact_tests
add tests for concat_basedir fact
2013-11-03 10:58:26 -08:00
Joshua Hoblitt
8f53c479cb add rspec-puppet pending test for warning on inclusion of concat::setup 2013-11-03 11:26:09 -07:00
Joshua Hoblitt
a08709caf7 add tests for concat_basedir fact 2013-11-03 10:20:32 -07:00
Joshua Hoblitt
1a926b933c deprecate concat::fragment mode, owner, & group params
There's no need to allow the ownership/permissions of a fragment to be set as
the concat define sets ownership/permissions on the final aggregated file.
2013-11-02 13:39:12 -07:00
Ashley Penney
7437a68016 Merge pull request #91 from jhoblitt/exec_as_root_when_root
always exec the concatfragments script as root when running as root
2013-11-02 13:14:51 -07:00
Joshua Hoblitt
79352f4da6 allow concat::fragment target param to be an arbitrary string
Revert validation of the target param as an absolute path and allow it to be an
arbitrary string.  This is so the

    concat { <foo>: path => ...  }
    concat::fragment { ...: target => <foo> }

association may be symbolic as long as concat path param is specified.  This
should resolve the symbolic name regression introduced in:
https://github.com/puppetlabs/puppetlabs-concat/commit/eaf84079
2013-11-02 09:33:41 -07:00
Joshua Hoblitt
256e0bdf9f remove usage of resource defaults for file owner/permissions
In addition, the permissions of the fragment directory and files is now fixed and not world readable.
2013-11-01 18:23:24 -07:00
Joshua Hoblitt
200e4ee205 always exec the concatfragments script as root when running as root
This is to allow the concatfragments script to be installed into a path that may not be accessible by a non-root user.
2013-11-01 18:23:24 -07:00
Joshua Hoblitt
7c4f929e42 add deprecation warnings on removed parameters + warn on inclusion of concat::setup 2013-10-30 22:06:02 -07:00
Joshua Hoblitt
2ec19b80f9 remove purging of /usr/local/bin/concatfragments.sh
The hard coded path of `/usr/local/bin/concatfragments.sh` hasn't been
used for "a long time" so there's no reason to carry the cleanup around
any longer.
2013-10-24 09:34:31 -07:00
Joshua Hoblitt
aa0180d69a remove default owner/user and group values
The use of $::id to set the default user/owner and group has caused
multiple bugs in the past, is incorrectly used to infer the egid,
introduces a dependency on the `id` fact, and provides no functionally
that can't be accomplished by passing `undef` or not setting the
respective params on the file & exec types.

A possible alternative would be to introduce a dep on the $::gid fact
but that would mean the entire module would depend on a version of
facter than hasn't shipped yet (unworkable) or to add a gid/egid fact
into this module (ugly).
2013-10-24 08:48:37 -07:00
Joshua Hoblitt
4d884d3242 only backup target concat file + remove backup param from concat::fragment
Disable filebucket backup of all file resources except for the the
target file that's being concatenated.
2013-10-23 15:42:44 -07:00
Joshua Hoblitt
b6ee7e40e5 compatibility fixes for ruby 1.8.7 / puppet 2.7 2013-10-23 12:18:09 -07:00
Joshua Hoblitt
89dc9a9f71 mv spec/defines -> spec/unit/defines
To be more consistent with other PL modules
2013-10-23 10:57:03 -07:00
Joshua Hoblitt
86522e1eb2 make class concat::setup a private class 2013-10-23 10:55:05 -07:00
Joshua Hoblitt
cca9401844 remove puppet 0.24 support
Introduction of stdlib functions makes support of puppet < 2.7
impractical.
2013-10-23 10:55:05 -07:00
Joshua Hoblitt
6e554e1a26 add stdlib to rspec-system tests 2013-10-23 10:55:05 -07:00
Joshua Hoblitt
d7498a4e25 add tests for class concat::setup 2013-10-23 10:55:05 -07:00
Joshua Hoblitt
7b992f79e3 validate define concat::fragment params 2013-10-23 10:55:01 -07:00
Joshua Hoblitt
eaf8407941 validate define concat params + split warn param
In addition, the warn param has been split into a warn (a bool) and
warn_message (a string).
2013-10-23 10:48:34 -07:00
Graham Bleach
fbb8f40594 Fix group ownership on files.
And add a test to stop it being broken again.
2013-10-22 12:36:19 +01:00
Joshua Hoblitt
cdb6d6b007 remove undocumented requirement to include concat::setup in manifest
Unless the class `concat::setup` has been manually included into the
manifest before using the `concat` / `concat::fragment` defined types,
the puppet master will generate this warning while compiling the catalog.

    Tue Oct 15 14:05:06 -0700 2013 Scope(Concat[/etc/exports]) (warning):
    Could not look up qualified variable 'concat::setup::root_group'; class
    concat::setup has not been evaluated

The need to `include concat::setup` directly into the manifest has never
been part of the documented API.
2013-10-17 15:07:57 -07:00
petems
c89863cf7c Updated .gitignore for spec generated files 2013-10-02 13:53:00 +01:00
Tom McLaughlin
1830a686e7 Fix spec tests 2013-08-09 10:19:00 -04:00
Ashley Penney
1d403b6763 Add rspec-system tests. 2013-08-08 08:44:31 -07:00
Jan Vansteenkiste
1972a9b86b Add a second spec test for the name/path combination 2012-08-30 10:10:23 +02:00
Paul Belanger
7d0b5709c9 Lets use puppetlabs_spec_helper
Signed-off-by: Paul Belanger <paul.belanger@polybeacon.com>
2012-06-23 17:13:08 -04:00
sathlan
1fbe790b9a Cleanup. 2012-05-31 14:42:49 +02:00
sathlan
653444bd0a Adding basic tests.
Successfully tested inside rvm:
  - ruby 1.8.7-p302;
  - puppet (2.7.13)
  - facter (1.6.9)
  - bundler (1.1.3)
  - diff-lcs (1.1.3)
  - metaclass (0.0.1)
  - mocha (0.11.4)
  - puppet-lint (0.1.13)
  - rake (0.9.2.2)
  - rspec (2.8.0)
  - rspec-core (2.8.0)
  - rspec-expectations (2.8.0)
  - rspec-mocks (2.8.0)
  - rspec-puppet (0.1.3)
  - rubygems-bundler (1.0.2)
  - rvm (1.11.3.3)
2012-05-31 14:31:43 +02:00