summaryrefslogtreecommitdiffstats
path: root/spec/unit/provider
Commit message (Collapse)AuthorAgeFilesLines
...
| | * | | (#2645) Adding a less-stubby test to verify the "system" attribute's behaviorJesse Wolfe2011-03-092-5/+13
| | | | | | | | | | | | | | | | | | | | Paired-with: Jacob Helwig <jacob@puppetlabs.com>
| | * | | Fixed #2645 - Added support for creating system usersJames Turnbull2011-03-091-3/+36
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | On Red Hat, Ubuntu, Debian and deriatives the -r flag allows creation of "system" users with a UID below that defined in /etc/login.defs. This commit adds support for a system parameter and a system_users feature which can be used like so: user { "foo": system => true, ensure => present, } This will create a user with a lower UID. The system parameter defaults to false.
* | | | | (#6441) Add mount fixture for AIX's /etc/filesystemsJacob Helwig2011-03-091-0/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This fixture is currently unused, largely due to the mount type being based on parsedfile, which is incapable of parsing /etc/filesystems. Paired-with: Daniel Pittman <daniel@puppetlabs.com>
* | | | | (#6641) Make it easier to add future platforms to the suite.Daniel Pittman2011-03-081-2/+8
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | When a new fstab fixture is added, we also want to try to test mount output. If that fixture is missing, we would have failed a test, but now mark it pending. This is more correct when, for example, we don't yet have that fixture: it isn't technically a failure, just an incomplete set of test data.
* | | | | (#6441) Mark solaris tests pending, because we can't stub it.Daniel Pittman2011-03-081-3/+8
| | | | | | | | | | | | | | | | | | | | | | | | | In the final combination test we need to mark Solaris pending, because we genuinely have a bug where we can't test due to stubbing order.
* | | | | (#6641) fix mount provider tests broken in the 2.6 merge.Daniel Pittman2011-03-081-16/+13
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | A number of fixture-related changes were made in next, but not 2.6, which resulted in extra tests added during 2.6 being broken. The main thrust of this change is to fix those tests by porting the fixture support code to the newer helpers. This also highlighted some shortfalls in our platform fixtures, which we extend to add a bunch of additional fixtures, and to uniformly walk those to perform fstab vs mount testing.
* | | | | Merge branch '2.6.next' into nextMatt Robinson2011-03-072-177/+241
|\| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This was a particularly nasty merge, so rather than hold up merges into next any longer, I'm going to push this merge with a few outstanding problems. The tests that were failing in the following areas have been marked pending, and will be addressed separately, immediately following this push. TODO: Verify that brice's rdoc change is still valid: tests to show that line numbers from class, define and node get into the ast Fix mount parsed_spec spec/unit/provider/mount/parsed_spec.rb * 2.6.next: (85 commits) (#5148) Fix failing spec due to timezone (#5148) Add support for PSON to facts (#6338) Remove inventory indirection, and move to facts indirection (#6445) Fix inline docs: puppet agent does not accept --mkusers Update CHANGELOG and version for 2.6.6rc1 (#6541) Fix content with checksum truncation bug (#6418) Recursive files shouldn't be audited (#6541) maint: whitespace cleanup on the file integration spec (#6541) Fix content with checksum truncation bug (#5466) Write specs for output of puppet resource (#5466) Monkey patch Symbol so that you can sort them (#5466) Fixed puppet resource bug with trailing , Update CHANGELOG for 2.6.5 (#4922) Don't truncate remotely-sourced files on 404 (#6338) Remove unused version control tags Maint: Align tabs in a code block in the Augeas type. (#6509) Inline docs: Fix erroneous code block in directoryservice provider for computer type Maint: Rewrite comments about symlinks to reflect best practice. (#6509) Inline docs: Fix broken lists in Launchd provider. (#6509) Inline docs: Fix broken code blocks in zpool type ... Manually Resolved Conflicts: lib/puppet/application/inspect.rb lib/puppet/defaults.rb lib/puppet/file_bucket/dipper.rb lib/puppet/network/http/handler.rb lib/puppet/node/facts.rb lib/puppet/parser/parser.rb lib/puppet/parser/parser_support.rb lib/puppet/util/command_line/puppet lib/puppet/util/command_line/puppetd lib/puppet/util/command_line/puppetmasterd lib/puppet/util/monkey_patches.rb lib/puppet/util/rdoc/parser.rb spec/unit/application/agent_spec.rb spec/unit/file_bucket/file_spec.rb spec/unit/indirector/file_bucket_file/file_spec.rb spec/unit/network/http/handler_spec.rb spec/unit/parser/parser_spec.rb spec/unit/provider/mount/parsed_spec.rb
| * | | | Merge branch 'ticket/2.6.x/4914' into maint/2.6.next/revert-6309Paul Berry2011-02-282-159/+255
| |\ \ \ \ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * ticket/2.6.x/4914: (#4914) Improved stubbing in mount/parsed_spec tests. (#4914) Improved parsed_spec for mount (#4914) Remove mount specs (#4914) Specs for mounted? match new behaviour (#4914) Add specs for modified mount provider (#4914) Add specs for modified mount type (#4914) Update property blocks (#4914) Query property_hash for mountstate (#4914) Prefetch mountstate (#4914) Join lines for better readability Conflicts: lib/puppet/provider/mount.rb lib/puppet/provider/mount/parsed.rb spec/unit/provider/mount/parsed_spec.rb spec/unit/provider/mount_spec.rb spec/unit/type/mount_spec.rb
| | * | | | (#4914) Improved stubbing in mount/parsed_spec tests.Paul Berry2011-02-251-1/+5
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | A few of the spec tests were attempting to stub Puppet::Type::Mount#default_target so that it pointed to a temporary file rather than /etc/fstab, but they were creating the stub after the first call to default_target, so both /etc/fstab and the temporary file were being read. This caused errors when running spec tests on platforms where /etc/fstab is unreadable by non-privileged users. Fixed the problem by moving the stub declaration earlier in the test.
| | * | | | (#4914) Improved parsed_spec for mountStefan Schulte2011-02-201-47/+192
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Add specs for the new prefetching and the correct parsing of vfstab on Solaris and fstab on other systems
| | * | | | (#4914) Remove mount specsStefan Schulte2011-02-201-80/+3
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Remove mount specs that seem to only test if the parsedfile provider is working correctly or are obsolete specs.
| | * | | | (#4914) Specs for mounted? match new behaviourStefan Schulte2011-01-301-37/+13
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The question if a filesystem is mounted or not can be answered without calling mount and the specs have to reflect that.
| | * | | | (#4914) Add specs for modified mount providerStefan Schulte2011-01-251-13/+46
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Change specs - No need to call flush before mounting (explicitly), because the type and syncothers will to that for us - Add tests regarding the prefetched mount status
| * | | | | Revert "(#6309) Ensure the correct device is mounted when managing mounts"Paul Berry2011-02-252-123/+66
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This reverts commit 6cb365a887d47606bdfae0ff540038b0c49b7451, which fixed bug #6309 but introduced bug #6411. In addition, it conflicts with a significant patch to the mount provider that addresses #4914. After merging in the fix for #4914 I will determine whether bug #6309 still exists, and if so work on an improved fix for it.
| * | | | | Remove pending tests from parsed mount providerJacob Helwig2011-02-181-10/+0
| | | | | | | | | | | | | | | | | | | | | | | | Paired-with: Jesse Wolfe <jesse@puppetlabs.com>
| * | | | | (#6309) Ensure the correct device is mounted when managing mountsJacob Helwig2011-02-182-66/+123
| | |/ / / | |/| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Previously the mount type would only check if anything was mounted at the desired point, when 'ensure => mounted' was specified. Now we check not only whether something is mounted at the desired point, but also that it is the thing we wish to be mounted there. There is also a chance that the mount point directory could be "automagically" removed for us, when unmounting incorrect devices, so we attempt to re-create the directory after unmounting to give the mount of the correct device a better chance at succeeding. Paired-with: Matt Robinson <matt@puppetlabs.com> Paired-with: Nick Lewis <nick@puppetlabs.com> Paired-with: Jesse Wolfe <jesse@puppetlabs.com>
* | | | | (#6582) eliminate fakeresource use in ssh_authorized_key spec.Daniel Pittman2011-03-032-27/+18
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | We replace it with an instance of the actual resource we are testing, which reduces the number of ways this code is tied to the specific implementation. Reviewed-By: Nick Lewis <nick@puppetlabs.com>
* | | | | (#6582) eliminate fakeparsefile helper method.Daniel Pittman2011-03-033-32/+10
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This was a helper that implemented rspec style "shared behaviour" for Test::Unit; now that we have moved on we can use the upstream implementation instead. This eliminates a whole bit of code we have to maintain. Reviewed-By: Nick Lewis <nick@puppetlabs.com>
* | | | | (#6582) Eliminate the old fakedata helper method.Daniel Pittman2011-03-033-10/+4
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This is replaced with the new my_fixture{,s} methods; old fixture data is ported into the spec tests at the same time, but left where it was against unit tests that require it. Reviewed-By: Nick Lewis <nick@puppetlabs.com>
* | | | | Merge branch 'ticket/next/5496' into nextNick Lewis2011-03-011-0/+30
|\ \ \ \ \ | |_|_|_|/ |/| | | |
| * | | | (#5496) Added tests for the new zpool output formatDevon Peters2011-03-011-0/+30
| | | | | | | | | | | | | | | | | | | | Reviewed-By: Nick Lewis
* | | | | Merge branch '2.6.x' into nextMatt Robinson2011-02-023-0/+101
|\ \ \ \ \ | | |/ / / | |/| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * 2.6.x: (46 commits) Augmentation of tests for prior commit Fix to fix for #5755 -- backref serialization issues in zaml Fixed #5564 - Added some more fqdn_rand documentation Fixed #4968 - Updated list of options turned on by --test in documentation (#5061) - allow special hostclass/define variables to be evaluated as defaults. (#6107) Fix an error when auditing a file with empty content Remove already initialized constant warning from file_spec.rb tests (#5566) Treat source only File checksums as syntax errors when used with content Rename variable used in File type validation to be more clear Remove invalid "timestamp" and "time", and add missing "ctime" File checksum types. Remove order dependency when specifying source and checksum on File type Bug #5755 -- ZAML generates extra newline in some hash backreferences. bug #5681 -- code fix to handle AIX mount output Bug #5681 -- parse AIX mount command output. Spec for #5681 to allow parsing of AIX mount output in mount provider Fixed #6091 - Changed POSIX path matching to allow multiple leading slashes Bug #6091 -- test leading double-slash in filenames are allowed. Fixed #6071 - Fixed typo and improved exec path error message Fixed #6061 - Allowed -1 as password min/max age Bug #6061 -- verify that negative {min,max}_password_age are accepted. ... Manually Resolved Conflicts: lib/puppet/util/zaml.rb spec/unit/util/zaml_spec.rb
| * | | | Spec for #5681 to allow parsing of AIX mount output in mount providerRick Bradley2011-01-311-0/+8
| | | | | | | | | | | | | | | | | | | | | | | | | This also adds a fixture file containing the AIX mount output as submitted by the ticket author.
| * | | | Feature #5855 -- undefined method 'withenv' in FreeBSD package provider.Daniel Pittman2011-01-261-0/+55
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The FreeBSD package provider fails to install when any source is given, yielding instead an 'undefined method' error. This adds tests that prove the bug exists.
| * | | | Fixed #6009 - nested member list vs directory service group providerJames Turnbull2011-01-251-0/+38
| | |/ / | |/| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The Directory Service group (and user) provider behaves erratically if members is a nested list; this happens with the following manifest: $r = ["root"] $a = ["daemon", "crc"] $n = ["nobody"] group { "testgroup": ensure => present, members => [$r, $a, $n] } This resolves the issue by flattening the list at the time we are using it; while a more general solution might be desirable this resolves the specific issue cleanly enough. Original patch from Clay Caviness. Tests by Daniel Pittman <daniel@puppetlabs.com> Signed-off-by: Daniel Pittman <daniel@puppetlabs.com> Signed-off-by: James Turnbull <james@lovedthanlost.net>
* | | | Merge branch '2.6.x' into nextNick Lewis2011-01-061-2/+1
|\| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Conflicts: Rakefile lib/puppet/resource/type_collection.rb lib/puppet/simple_graph.rb lib/puppet/transaction.rb lib/puppet/transaction/report.rb lib/puppet/util/metric.rb spec/integration/indirector/report/rest_spec.rb spec/spec_specs/runnable_spec.rb spec/unit/configurer_spec.rb spec/unit/indirector_spec.rb spec/unit/transaction/change_spec.rb
| * | | (#5771) Upgrade rspec to version 2Matt Robinson2011-01-041-2/+1
| | |/ | |/| | | | | | | | | | | | | | | | | | | | | | The biggest change is that we no longer need to monkey patch rspec to get confine behavior. Describe blocks can now be conditional like confine used to be. "describe" blocks with "shared => true" are now "shared_examples_for". Paired-With: Nick Lewis
* | | Merge branch '2.6.x' into nextNick Lewis2010-12-161-0/+2
|\| | | | | | | | | | | | | | | | | | | | | | | | | | Manually Resolved Conflicts: lib/puppet/resource/type_collection.rb spec/unit/configurer_spec.rb spec/unit/indirector/catalog/active_record_spec.rb spec/unit/resource/type_collection_spec.rb spec/unit/transaction/resource_harness_spec.rb
| * | maint: Fully stub partially stubbed test.Jesse Wolfe2010-12-101-0/+2
| | | | | | | | | | | | | | | | | | This test was succeeding in versions of Mocha before 0.9.10, because the Mocha expectation exceptions were being incorrectly interpreted as if they were File Not Found exceptions.
* | | (#5427) Using Propery::OrderedList for host_aliasStefan Schulte2010-12-141-10/+18
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This uses the propertyclass Puppet::Property::OrderedList to represent the list of host_aliases. This lets us remove the in_sync, should_to_s etc overrides. In the provider class the list is represented by a string (=no array) so there were a few changes necessary as well. Because Puppet::Property::List uses the specified delimiter when converting should values to strings, I changed the delimiter to a simple space instead a tab. This keeps messages produced by puppet in a nice format. The tests had to be changed to work with the new behaviour of host_aliases. There are a few additional tests as well.
* | | Merge remote branch 'someword/feature/master/5391' into nextPaul Berry2010-12-061-1/+1
|\ \ \ | | | | | | | | | | | | | | | | * someword/feature/master/5391: (#5391) Include additional zfs properties
| * | | (#5391) Include additional zfs propertiesDerek Olsen2010-11-241-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | We added the following zfs properties to the zfs provider :recordsize, :aclmode, :aclinherit, :primarycache, :secondarycache Currently zfs users have to chain an exec to the zfs filesystem creation and the inclusion of these properties would allow puppet to set them natively.
* | | | maint: Use expand_path when requiring spec_helper or puppettestMatt Robinson2010-12-0643-43/+43
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Doing a require to a relative path can cause files to be required more than once when they're required from different relative paths. If you expand the path fully, this won't happen. Ruby 1.9 also requires that you use expand_path when doing these requires. Paired-with: Jesse Wolfe
* | | | Merge branch 'ticket/next/5211' into nextMatt Robinson2010-12-021-0/+24
|\ \ \ \ | |_|_|/ |/| | | | | | | | | | | * ticket/next/5211: (#5211) Added patch and tests for checking the size of the arrary which is returned
| * | | (#5211) Added patch and tests for checking the size of the arrary which is ↵Steve Nielson2010-12-021-0/+24
| | |/ | |/| | | | | | | returned
* | | Merge branch 'maint/next/make_upstart_tests_more_robust' into nextPaul Berry2010-11-231-2/+1
|\ \ \
| * | | Maint: made upstart tests more robust.Paul Berry2010-11-231-2/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The tests for the upstart provider were attempting to stub Process::Status.exitstatus. However, this doesn't work (presumably because Process::Status is implemented in C). As a result, the upstart spec tests were failing if the most recent exit code was nonzero. Changed the tests so that instead of stubbing Process::Status.exitstatus to return zero, they execute a command that is known to succeed (`true`). Paired-with: Jesse Wolfe <jesse@puppetlabs.com>
* | | | (#2866) yum should support downgrade.Dan Bode2010-11-231-7/+13
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | patch originally from Grzegorz Nosek with contributions on the test from Oliver Hookins. checks if the current version is greater than the should version, if so, calls yum downgrade. Reviewed-by: Matt Robinson
* | | | (#4711) Provide unit tests for yum package provider.Dan Bode2010-11-231-0/+61
|/ / /
* | | Merge branch 'ticket/next/5274' into nextNick Lewis2010-11-171-0/+196
|\ \ \
| * | | (#5274) New tests for new hosttype/parsedproviderStefan Schulte2010-11-171-0/+44
| | | | | | | | | | | | | | | | | | | | Just a few additional tests for the new property "comment" of the host type.
| * | | (#5274) Tests for hostprovider removes commentsStefan Schulte2010-11-171-0/+152
| |/ / | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | I noticed that the hostprovider will remove all inline comments from the /etc/hosts file, when puppet updates at least one entry. Puppet will also remove comments from entries, the user doesnt want to manage with puppet. To split up changes a bit this commit will only introduce tests for the host type and the hostprovider. A few will fail, indicating the bug: The hostprovider parses all entries and builds a hash. When building the recordhash all comments are discarded. When puppet has to update at least one entry it uses the to_line function to convert the record hash back to a file. Because the comments are not stored in the hash, they cannot be written back to the file.
* | | Merge commit '2.6.3' into nextPaul Berry2010-11-174-16/+65
|\| | | | | | | | | | | | | | | | | Resolved conflicts manually: spec/integration/indirector/bucket_file/rest_spec.rb spec/integration/indirector/certificate_revocation_list/rest_spec.rb
| * | Fix for #4279 -- mount detection on HP-UXMarkus Roberts2010-11-161-1/+8
| | | | | | | | | | | | | | | This is based on the discussion on ticket, simplified slightly and with test adjustment.
| * | Fix for #4299 -- Don't require whichMarkus Roberts2010-11-121-13/+6
| | | | | | | | | | | | | | | | | | We already had an internal implementation of which hiding under an assumed name (Puppet::Util.binary); this commit calls it out of hiding and uses it consisantly.
| * | (#4573) FreeBSD service provider now supports versions <7 and >8Nick Lewis2010-11-101-0/+50
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Running "/etc/rc.d/SERVICE rcvar" outputs different formats for different versions of FreeBSD. This patch adds support for those formats, as well as tests. Based on patches from: o Joost van Beurden o Russell Jackson Paired-With: Matt Robinson
| * | (#5233) Randomize tmp dir pathsMatt Robinson2010-11-081-2/+1
| | | | | | | | | | | | | | | | | | | | | Standardize how we create tmpdirs by using the puppet function instead of Dir.tmpdir. Paired-with: Paul Berry <paul@puppetlabs.com>
* | | (#3747) Add specs for upstart providerNick Lewis2010-11-111-0/+50
|/ / | | | | | | Paired-With: Matt Robinson
* | Minimal fix for #4975 -- only call chage when managing password age rulesMarkus Roberts2010-10-131-0/+42
| | | | | | | | | | This is intended to be a minimal fix, with tests, to prevent chage from running unless needed.
* | Fix for #4963 -- Use correct commands for password expiry on solarisMarkus Roberts2010-10-131-1/+1
| | | | | | | | | | This fixes the command / option issues of #4963 as suggested on the ticket; the setting-expiry when not needed aspects are deferred to #4975.