summaryrefslogtreecommitdiff
path: root/test
AgeCommit message (Collapse)AuthorFilesLines
2012-03-30Remove useless or redundant Test::Unit tests.Daniel Pittman104-25639/+0
The other test suites, especially acceptance, cover everything that these tests cover for the a whole bunch of the RAL tests in the older system. Others were entirely disabled, and can simply be stripped out. Signed-off-by: Daniel Pittman <daniel@puppetlabs.com>
2012-03-30Port the large fixture for the sshkey test from Test::Unit.Daniel Pittman1-112/+0
The only test not present in the existing spec was an effort to parse a large sample file, and ensure it would round-trip correctly through the parsedfile provider. This is now ported over. Signed-off-by: Daniel Pittman <daniel@puppetlabs.com>
2012-03-30Port the base service provider tests from Test::Unit.Daniel Pittman1-76/+0
The `base` service provider is terribly anæmic, but we had some tests, and it does serve as the parent for almost every other provider. So, port those tests over. Also, add a dash of cross-platform support by invoking the current Ruby interpreter to do file system manipulation things - rather than leaning on Unix tools that are not available everywhere. Signed-off-by: Daniel Pittman <daniel@puppetlabs.com>
2012-03-30Port the provider tests from Test::Unit.Daniel Pittman1-529/+0
The provider tests exercise a whole pile of code that wasn't covered by the specs. This ports those tests over, and extends them to do further combination testing in a few places. These are very repetitive, table driven tests - but so is the underlying feature we are trying to test. Signed-off-by: Daniel Pittman <daniel@puppetlabs.com>
2012-03-30Port the aptrpm and aptitude tests from Test::Unit.Daniel Pittman2-146/+0
These are fairly weak tests, but they exist - which ensures that we can't slip through a syntax error in that provider. So, better ported than destroyed. Signed-off-by: Daniel Pittman <daniel@puppetlabs.com>
2012-03-30Port the crontab Test::Unit tests to RSpec.Daniel Pittman2-674/+0
These tests covered a bunch of content that wasn't already covered, so they should be ported. Includes some fun around enumerators and Ruby 1.8.5. Signed-off-by: Daniel Pittman <daniel@puppetlabs.com>
2012-03-30Port the mailalias test directly to RSpec.Daniel Pittman1-45/+0
The old Test::Unit mailalias test is fairly up-front about being a weak test, but it was more than we had in the spec area at all. So, it can be ported as-is to retain at least the same level of testing of the type. Signed-off-by: Daniel Pittman <daniel@puppetlabs.com>
2012-03-30Port the useful cron Test::Unit test to an acceptance test.Daniel Pittman1-505/+0
Signed-off-by: Daniel Pittman <daniel@puppetlabs.com>
2012-03-30Port some exec tests from Test::Unit to RSpecDaniel Pittman1-727/+0
Most of the tests were redundant to either existing acceptance tests, or to existing spec tests, but a couple of combination tests were worth porting. Signed-off-by: Daniel Pittman <daniel@puppetlabs.com>
2012-03-30Port over `ral/manager` tests to RSpec.Daniel Pittman5-811/+0
The RAL manager tests exercise code that isn't otherwise exercised, so most of the tests can be ported over. Signed-off-by: Daniel Pittman <daniel@puppetlabs.com>
2012-03-30Port some type class tests over to RSpec.Daniel Pittman1-68/+0
The type tests exercise parts of the type code in ways that the other tests don't, so they should be ported over. Signed-off-by: Daniel Pittman <daniel@puppetlabs.com>
2012-03-30Port tests of the defaults system from Test::Unit.Daniel Pittman1-19/+0
The only meaningful test was that the Puppet version number was sane. Signed-off-by: Daniel Pittman <daniel@puppetlabs.com>
2012-03-30Port `test/provider` to RSpecDaniel Pittman1-90/+0
This brings over the meaningful tests of the provider class over from Test::Unit to RSpec. Signed-off-by: Daniel Pittman <daniel@puppetlabs.com>
2012-03-30Port old `test/language` tests into rspec...Daniel Pittman54-2826/+0
In Ruby 1.9 the Test::Unit library was replaced by MiniTest. This changes some "esoteric" parts of the code, sadly including the parts of the library we depend on to confine certain tests to only some systems. Instead of investing heavily in rebuilding that facility over the new MiniTest library it makes sense to just check for and either destroy or port the old tests to the new rspec harness. This is our desired future - that only one test framework exist - and we might as well take full advantage of this opportunity to clean up our legacy code. It also drops tests that duplicate testing already present in the spec suite. Signed-off-by: Daniel Pittman <daniel@puppetlabs.com>
2012-03-30Whitespace cleanup in old-style aptrpm package test.Daniel Pittman1-50/+13
There are no functional changes, just fixing odd whitespace. Signed-off-by: Daniel Pittman <daniel@puppetlabs.com>
2012-03-27Merge branch '2.7.x'cprice1-1/+0
Conflicts: lib/puppet/daemon.rb spec/unit/daemon_spec.rb spec/unit/parser/ast/leaf_spec.rb spec/unit/provider/package/dpkg_spec.rb spec/unit/util/settings_spec.rb
2012-03-22(#7749) doc / tests cleanupcprice1-33/+0
2012-03-20(#7749) rename "Settings#setdefaults" to "define_settings"cprice2-37/+37
This is just to clarify the intent of the code, mostly in defaults.rb. The old signature still exists, but prints a deprecation warning.
2012-03-20(#7749) Improvements to handling settings, bootstrapping puppetcprice2-88/+95
Major changes include: * support multiple config files (/etc/puppet, ~/.puppet). we no longer use "run_mode" to determine the location of the config file. * remove all references to application run_mode/state from defaults * make the typing of settings a little more strict * create a new setting type for directories, to make us a little less vulnerable to the terrible matching algorithm in FileSetting
2012-03-16Merge remote-tracking branch ↵Patrick Carlisle1-1/+0
'daniel-pittman/refactor/2.7.x/4862-remove-the-event-loop-library' into 2.7.x * daniel-pittman/refactor/2.7.x/4862-remove-the-event-loop-library: (#4862) Finally remove the event-loop library. (#4862) define_method is not a public method in Ruby. (#4862) `returning` is not a standard Ruby method. (#4862) Stop using EventLoop in the Puppet daemon.
2012-03-05Merge branch '2.7.x'Patrick Carlisle1-0/+125
* 2.7.x: (#10722) Add spec to verify that an error is logged on bad http (#10722) Refactor http_spec to use expectations Updating CHANGELOG for 2.7.12rc2 (#7592) Remove redundant call to String#to_s (#11988) Work around Augeas reload bug when changing save modes (#11988) Don't overwrite symlinks in augeas provider (#8312) Fix zypper provider so ensure => 'latest' now works (#12844) Fix a unit test relating to lockfiles (#12914) Allow puppet to be interrupted while waiting for child (#12933) Better error message when agent is administratively disabled (#7592) Remove redundant call to String#to_s (#12844) Agent lockfiles: backwards compatibility with 2.7.10/2.7.11 (#10722) Display errors on HTTP report submission failures Revert "Merge remote-tracking branch 'masterzen/tickets/2.7.x/3757' into 2.7.x" Revert "(#12844) Backwards compatibility for 'puppet agent --enable'" (#11988) Work around Augeas reload bug when changing save modes (#11988) Don't overwrite symlinks in augeas provider (#12881) Fix cron type default name error on windows (#12844) Backwards compatibility for 'puppet agent --enable' (#8312) Fix zypper provider so ensure => 'latest' now works Conflicts: lib/puppet/provider/augeas/augeas.rb lib/puppet/reports/http.rb lib/puppet/util/pidlock.rb spec/unit/application/agent_spec.rb spec/unit/provider/augeas/augeas_spec.rb spec/unit/reports/http_spec.rb
2012-03-03(#12844) Fix a unit test relating to lockfilescprice1-3/+2
The recent changes to support backwards compatibility with 2.7.10 and 2.7.11 introduced a very minor change in behavior with regards to when a stale lockfile gets cleaned up. Fixed this test to recognize the change.
2012-03-01Revert "Merge remote-tracking branch 'masterzen/tickets/2.7.x/3757' into 2.7.x"cprice1-0/+126
This reverts commit 86a806f595f8b7bb280c8c445eef51dfd71bf39d, reversing changes made to ac81771a9cc70b5fb58f86439ebb0585ce92d4e8. See tickets #3757, #12844, #4836, #11057. These changes were deemed to be breaking public APIs, and thus are being reverted from 2.7.x. They'll be reintroduced in 3.x. (The changes in question were relating to how puppet agent creates / manages its lockfiles.) Conflicts: lib/puppet/util/pidlock.rb spec/unit/agent_spec.rb spec/unit/util/pidlock_spec.rb
2012-02-28(#3324) Ported yumrepo unit tests to speccprice3-151/+0
* Port test from test/ral/type/yumrepo.rb into yumrepo_spec.rb * Delete old test and supporting files
2012-02-23Merge branch '2.7.x'Patrick Carlisle1-0/+16
* 2.7.x: (63 commits) Maint: Fix bad copy and paste (#12725) Fix puppet agent --listen on Windows (#11740) Wait on the handle from the PROCESS_INFORMATION structure (#12564) Stub CHILDSTATUS in all test cases, not just failure cases. Updating CHANGELOG and lib/puppet.rb for 2.7.11 (#12412) Mark symbolic file modes test as pending on Windows Symbolic file mode test fixes when no mode change happens. Fix spec ordering failure on environment Updating CHANGELOG and lib/puppet.rb for 2.7.11 Disable specs that use replace_file on Windows Disable replace_file on Windows Remove unnecessary fallbacks in change_{user,group} Document uid/gid-related methods in Puppet::Util Copy owner/group in replace_file (#12463) eliminate `secure_open` in favour of `replace_file` (#12460) use `replace_file` for the .k5login file (#12462) user_role_add: use `replace_file` for /etc/shadow (#12463) add secure `replace_file` to Puppet::Util (#12459) drop supplementary groups when permanently dropping UID (#12458) default to users primary group, not root, in `asuser` ... Conflicts: lib/puppet/application/queue.rb lib/puppet/provider/package/openbsd.rb lib/puppet/util.rb spec/unit/network/http/webrick_spec.rb spec/unit/util_spec.rb test/lib/puppettest/servertest.rb
2012-02-22(#4862) Finally remove the event-loop library.Daniel Pittman1-1/+0
Now that all the consumers of the event-loop abstraction have been removed, delete the obsolete code from Puppet. Signed-off-by: Daniel Pittman <daniel@puppetlabs.com>
2012-02-14(#6663) Raise default key lengths in Puppet.Daniel Pittman2-0/+20
The CA key length was lower than it should be - 1024 bits is no longer secure enough for real world use. This raises both client and CA certs to use 4096 bit keys. Those are slow, but effective for long term security. People who know enough to decide that the trade-off of speed vs limited window of security can still totally reduce the size of the key without much trouble, but we default to being more cautious. This also pegs the key lengths low in testing, since building a 4K key is awful slow if you want to do it time and time again over the course of dozens of tests. Signed-off-by: Daniel Pittman <daniel@puppetlabs.com>
2012-02-02(#12309) Refactor deprecated uses of Util.executecprice1-9/+9
* Improve logic of deprecation_warning * Add utility method for logging deprecation warnings to a file * Refactored all references of Puppet::Util.execute to call Puppet::Util::Execution.execute
2012-02-02(#12309) move execution-related methods from Util to Util::ExecutionChris Price1-33/+0
There are still deprecated stubs for execpipe, execfail, and execute in Puppet::Util for backwards compatibility. rspecs are all passing, but would still like to go through and check for deprecation warnings that were triggered by this changeset (and fix them, obviously). get spec tests running against Puppet::Util -> Util::Execution refactor
2012-01-25(#11860) Fix unit test broken by previous commitChris Price1-1/+1
Passing ":squelch => true" to Puppet::Util.execute used to have the side-effect of setting :failonfail to "false"; you must pass :failonfail explicitly now if you want it to override the default behavior of :failonfail => true.
2012-01-25(#11860) Add parameter to control locale overrideChris Price1-31/+0
Puppet::Util.execute_posix contained some code that would override some locale-related environment variables in order to force the command being executed to produce well-known, consistent, predictably formatted output so that it could be parsed. However, there are some cases (such as a user-defined "exec" block) where we need to respect the system/user locale settings. Add a boolean parameter to the Puppet::Util.execute method that allows toggling this locale override behavior. The "exec" provider now passes "false" for this value, meaning that we no longer override the locale for user-defined "exec" resources. Users may choose to override the locale themselves by specifying the appropriate locale-related vars in the "environment" section of their resource. All of this is ignored on windows at the moment, but the parameter is passed in to "execute", which is responsible for calling "execute_windows" on windows systems. We could decide to do something with this parameter on windows at some point in the future.
2012-01-21Merge branch 'codec-ticket/10907-logoutput-on-failure'Daniel Pittman1-2/+12
2012-01-21(#10907) default for exec provider log output is on_failurecodec1-2/+12
Signed-off-by: Daniel Pittman <daniel@puppetlabs.com>
2012-01-21(#9160) Change logging facility to debug for not supported provider featuresFranz Pletz1-1/+1
2012-01-03Merge branch '2.7.x'Matt Robinson1-126/+0
* 2.7.x: (21 commits) (#7296) Make the Debian service provider handle services that don't conform to the debain policy manual. (#4836) - Agent --disable should allow to put a message (#3757) - Refactor enable/disable to its own module (#3757) - Move enable/disable to its own lock Fix failing tests with ruby 1.9.2 in the instrumentation framework Use all lower-case file name for Puppet::Util::Instrumentation::Instrumentable Maint: Fix typo in usage example for create_resources function Set of faces to manage instrumentation listeners, data and probes Example probes for the indirector Add probe indirection for probe management Process name instrumentation listener Add the 'performance' instrumentation listener Add the example 'log' listener Add a way to add probe to puppet code Add indirection (REST usable) to manipulate instrumentation Instrumentation foundation layer (#8119) Write reports to a temporary file and move them into place (#11414) Test Augeas versions correctly with versioncmp (#11414) Save/execute changes on versions of Augeas < 0.3.6 Updated CHANGELOG for 2.6.13 ... Conflicts: spec/unit/application/agent_spec.rb spec/unit/provider/augeas/augeas_spec.rb
2011-12-29(#8296) Remove XMLRPC codeMatt Robinson7-1544/+0
The XMLRPC code was left in place to ensure backward compatibility with Puppet 0.24.x clients, but 0.24.x clients haven't been able to talk to masters since 0.25.6 due to other bugs and incompatibilities. Therefore, the XMLRPC code has been dead code for a long time and removing it makes the codebase a lot easier to navigate. Paired with Patrick Carlisle <patrick@puppetlabs.com>
2011-12-28(#11552) Remove TransObject and TransBucketMatt Robinson5-258/+0
TransObject and TransBucket were no longer used except as an intermediate form when converting between Puppet::Resource and Puppet::Type::Resource. This removes TransBucket and TransObject entirely and rewrites the conversion (to_resource) so the intermediate to_trans call is unneeded. There was custom logic in Puppet::Type::File#to_trans that was moved to a to_resource method. Backward compatibility with 0.24.x has been broken for some time (0.25.5 is the last release I've seen that works running a master with 0.24.x agents), but we removed Network::Handler::Master which depended on TransObject. This is the beginning of removing XMLRPC code (ticket #8296), which is what in theory provided the 0.24.x backward compatibility. Paired with Patrick Carlisle <patrick@puppetlabs.com>
2011-12-28(#3757) - Move enable/disable to its own lockBrice Figureau1-126/+0
This change also contains a refactor split of Pidlock into its anonymous counterpart. Signed-off-by: Brice Figureau <brice-puppet@daysofwonder.com>
2011-11-29Merge branch '2.7.x'Josh Cooper1-11/+5
* 2.7.x: (#10739) Provide default subjectAltNames while bootstrapping master Give variables more descriptive names maint: Rename xgenerate to add_dynamically_generated_resources (#6907) Prefetch unsuitable providers (#6907) Allow providers to be selected in the run they become suitable maint: Fix incorrect whitespace Fix description in service provider test for FreeBSD (#6697) Set service provider default path to /etc/rc.d on Archlinux (#6335) Allow optional trailing comma in argument lists. (#8255) Always use string modes when creating resources from FileSetting settings (#7274) Output 4-digit file modes in File type (#10799) Regexp escaping too much
2011-11-28maint: Rename xgenerate to add_dynamically_generated_resourcesMatt Robinson1-1/+1
Now we don't need comments everywhere it's used and defined to explain what it does.
2011-11-28(#6907) Prefetch unsuitable providersNick Lewis1-11/+5
Previously, if we chose to use an unsuitable provider, we would not prefetch it because it wasn't suitable at the beginning of the run. Now, we lazily prefetch, waiting until the first resource of a particular provider is evaluated. If the provider we are prefetching is also the default provider for its type, we also find resources of that type with no specified provider, and assign them the default provider. This allows us to avoid prefetching the same provider twice (once for resources explicitly using it, and once for resources implicitly using it because it's the default).
2011-11-21Merge branch 'ticket/master/3669-make-puppet-honor-DNS-SRV-records'Josh Cooper1-6/+5
* ticket/master/3669-make-puppet-honor-DNS-SRV-records: (#3669) Find servers via DNS SRV records Reset saved indirection state to an empty hash instead of nil after restoring Realign test/lib/puppettest.rb after the Great Indentation Change
2011-11-15Merge remote-tracking branch 'lifton/2.7.x'Joshua Harlan Lifton1-1/+1
2011-11-11(#9671) Exit early from #eval_generate if nothing is createdNick Lewis1-1/+1
We now exit early if #eval_generate does not produce any resources. This has the impact of not adding a completed_ whit for the resource, which is not necessary without any children. We also now return true if #eval_generate created resources, and false if it did not. This allows callers to reason about whether the graph actually changed.
2011-10-28Merge branch '2.7.x'Nick Lewis15-1186/+1
2011-10-21(#2848) Eliminate redundant `master_dns_alt_names`.Daniel Pittman1-1/+1
Now that `dns_alt_names` applies to local CSR generation, there is no need for a special configuration option only applied to a master certificate. Eliminating that option allows us to simplify the overall model, and provide more uniform access to the `subjectAltName` setting when required. Documentation about the option is also updated. Signed-off-by: Daniel Pittman <daniel@puppetlabs.com>
2011-10-21(#2848) Rework the xmlrpc CA handler to use the modern SSL codeNick Lewis1-220/+0
In order to remove the legacy SSLCertificates code, we first need to rework the one place it's still being used, which is the CA handler. Now, this handler essentially just defers to the Puppet::SSL classes. Signed-off-by: Daniel Pittman <daniel@puppetlabs.com>
2011-10-21(#2848) Remove unused xmlrpc codeNick Lewis14-960/+0
We no longer use the xmlrpc client in 2.6, so this is dead code. Because it depends on the legacy SSLCertificates code, which is also going away, this code needs to be removed. We leave the server code for backward compatibility with older clients. Signed-off-by: Daniel Pittman <daniel@puppetlabs.com>
2011-10-21(#2848) Rename `certdnsnames` to match new behaviour.Daniel Pittman3-16/+11
As part of the update to SSL the behaviour of the `certdnsnames` options changed sufficiently that it would be terribly confusing to retain it. Instead, modify the setting to warn that it is ignored, and add a new setting to set the default subjectAltName value for bootstrapping a master certificate. This retains the one really useful part of the feature, without the risk that someone will accidentally use the old name and receive a nasty surprise. It should also draw more attention to formerly insecure configurations. Signed-off-by: Daniel Pittman <daniel@puppetlabs.com>
2011-10-19Realign test/lib/puppettest.rb after the Great Indentation ChangeJacob Helwig1-6/+5
The change from four to two space indents left some code blocks mis-aligned. This addresses those mis-alignments found in test/lib/puppettest.rb.