Граф коммитов

1584 Коммитов

Автор SHA1 Сообщение Дата
Luke Kanies 76274413de Fixing most failing test/ tests.
This is mostly just adjusting existing tests to
meet new APIs, but it's a small amount of fixing the
code to meet new standards and an even smaller amount
of porting code over.

Signed-off-by: Luke Kanies <luke@reductivelabs.com>
2010-02-17 06:50:53 -08:00
Luke Kanies 149d5efa66 Fixing some compatibility and old tests
We all know these tests should be removed,
but hey, at least these ones pass now.

Signed-off-by: Luke Kanies <luke@reductivelabs.com>
2010-02-17 06:50:53 -08:00
Luke Kanies 2cbd9e8525 Switching transactions to callback-based events
Events are now queued as they are created, and
the queues are managed through simple interfaces,
rather than collecting events over time and
responding to them inline.

This drastically simplifies event management,
and will make moving it to a separate system
essentially trivial.

Signed-off-by: Luke Kanies <luke@madstop.com>
2010-02-17 06:50:53 -08:00
Jesse Wolfe b19a0442ed Some tests were leaking state when the test failed 2010-02-17 06:50:53 -08:00
Jesse Wolfe 5b2802c73b Typo in method call in test. 2010-02-17 06:50:53 -08:00
Jesse Wolfe 6a148e2e97 Supressing warnings (not really failures) in test/unit 2010-02-17 06:50:53 -08:00
Rein Henrichs 06deee78ba Fix test using wrong Puppet util filesetting group 2010-02-17 06:50:53 -08:00
Rein Henrichs 74f516773e Mock user in SUIDManager tests 2010-02-17 06:50:53 -08:00
Rein Henrichs 000d37a0ba Removing resources generate tests
Tests that generating resources performs a check and only returns
resources that check as true. There is already spec coverage for this
behavior.
2010-02-17 06:50:53 -08:00
Rein Henrichs 11379c0e56 Removing old test for service/debian provider
it has been superceded by an rspec spec.
2010-02-17 06:50:53 -08:00
Rein Henrichs 2b8125ccb7 Replace test/unit file write test with spec 2010-02-17 06:50:53 -08:00
Brice Figureau 75c32f910e Fix #2389 - Enhance Puppet DSL with Hashes
This bring a new container syntax to the Puppet DSL: hashes.

Hashes are defined like Ruby Hash:
{ key1 => val1, ... }

Hash keys are strings, but hash values can be any possible right
values admitted in Puppet DSL (ie function call, variables access...)

Currently it is possible:

1) to assign hashes to variable
$myhash = { key1 => "myval", key2 => $b }

2) to access hash members (recursively) from a variable containing
a hash (works for array too):

$myhash = { key => { subkey => "b" }}
notice($myhash[key][subjey]]

3) to use hash member access as resource title

4) to use hash in default definition parameter or resource parameter if
the type supports it (known for the moment).

It is not possible to string interpolate an hash access. If it proves
to be an issue it can be added or work-arounded with a string concatenation
operator easily.

It is not possible to use an hash as a resource title. This might be
possible once we support compound resource title.

Unlike the proposed syntax in the ticket it is not possible to assign
individual hash member (mostly to respect write once nature of variable
in puppet).

Signed-off-by: Brice Figureau <brice-puppet@daysofwonder.com>
2010-02-17 06:50:53 -08:00
Markus Roberts 27322e5460 Merge branch '0.25.x'
Conflicts:
	lib/puppet/agent.rb
	lib/puppet/application/puppet.rb
	lib/puppet/configurer.rb
	man/man5/puppet.conf.5
	spec/integration/defaults.rb
	spec/unit/configurer.rb
2010-02-09 15:17:53 -08:00
James Turnbull 0533cea09d Forgot fakedata called in spec 2010-02-04 01:20:03 +11:00
James Turnbull 55f6239d8e Minor unit test fixes 2010-01-30 11:10:16 +11:00
Markus Roberts 10becce443 Fix for #3077 (unit tests broken in 0.25.1-->0.25.4)
Most of these were caused by alias --> host_aliases; one was
caused by the canonicalization of resource references and one
by the removal of puppet_module.
2010-01-30 09:29:51 +11:00
Luke Kanies 58a81ba0e0 Fixing #1054 - transaction reports are always sent
This refactors how reports, catalogs, configurers, and transactions
are all related - the Configurer class manages the report, both
creating and sending it, so the transaction is now just responsible
for adding data to it.  I'm still a bit uncomfortable of the coupling
between transactions, the report, and configurer, but it's better than
it was.

This also fixes #2944 and #2973.

Signed-off-by: Luke Kanies <luke@madstop.com>
2010-01-18 23:21:52 +11:00
Brice Figureau 53869e9914 Fix #2818 - scope variable assigned with undef are not "undef"
The following manifest doesn't work:
$foo = undef
case $foo {
  undef: { notice("undef") }
  default: { notice("defined") }
}

This is because "undef" scope variable are returned as an empty
string.

This patch introduces a behavior change:
Now, unassigned variable usage returns also undef.

This might produce some issues in existing manifests, although
care has been taken to allow correct behavior in the most commonly
used patterns.

For instance:
case $bar {
  undef: { notice("undef") }
  default: { notice("defined") }
}
will print "undef".

But matching undef in case/selector/if will also match "".
case $bar {
  "": { notice("empty") }
  default: { notice("defined") }
}
will print "empty".

Of course "" doesn't match undef :-)

Signed-off-by: Brice Figureau <brice-puppet@daysofwonder.com>
2009-12-29 18:45:47 +11:00
Jesse Wolfe 9cfe390515 Fixing 2812 authorized_keys without comments fail
This is technically a duplicate of #1531, I think this change prevents
the problem that appears in #2812, without touching the underlying issues
of #1531.

ssh_authorized_key was failing on keys in ~/.ssh/authorized_keys that
lack a comment field - it would generate a Ssh_authorized_key resource
with the name set to nil, which raises "ArgumentError: Field 'name' is
required."

Fixed by setting such keys' name fields to an empty string.
This prevents the error from being raised and the authorized_keys files
round-trip successfully.

Signed-off-by: Jesse Wolfe <jes5199@gmail.com>
2009-11-21 13:38:22 +11:00
Markus Roberts fbdded7647 Ticket #2685 (Type error in ssh_authorized_keys)
In post processing a Symbol was being passed to StringScanner.
StringScanner was not happy with this.  The error message lost
backtrace information and the test coverage was both inadequate
and broken (see #2745).

To be fully effective, this patch needs/assumes the patch for

Signed-off-by: Markus Roberts <Markus@reality.com>
2009-10-23 15:52:22 +11:00
Markus Roberts 4d9f76ad26 Fix for #2745 fakedata tests not working
The old fakedata test facility was not playing nicely with the
spec tests; although it looped through all the files failures
in any example file after the first were being ignored because
of the way fakedataparse was interacting with the before blocks.

Signed-off-by: Markus Roberts <Markus@reality.com>
2009-10-23 15:49:31 +11:00
Luke Kanies 058514aaf4 Moving Setting classes into separate files
This isn't really a refactor, just moving code around.

I did some simple method renaming, also.

Signed-off-by: Luke Kanies <luke@madstop.com>
2009-08-24 11:36:20 +10:00
Luke Kanies 3ab3a5c7ab Removing unnecessary debug output
Signed-off-by: Luke Kanies <luke@madstop.com>
2009-08-03 15:50:44 -07:00
Luke Kanies 488e368efc Adding integration tests for #2371 (backup refactor)
Also removed old conflicting file tests.

Signed-off-by: Luke Kanies <luke@madstop.com>
2009-08-03 15:02:56 -07:00
Luke Kanies a002e58fe9 Removing old filebucket test
Signed-off-by: Luke Kanies <luke@madstop.com>
2009-08-03 07:42:54 +10:00
Till Maas 266aafa6ef default server in remote filebuckets
With the path parameter set to false, the server defaults
to Puppet[:server]. This allows to use a remote filebucket without
syncing the servername there with the one used on the config file.

To use the default server, this manifest can be used:
filebucket { main: path => false }

A related bug report is:
http://projects.reductivelabs.com/issues/2456
2009-08-03 07:42:54 +10:00
James Turnbull b3545fc528 Fixed global deprecation error in useradd Unit tests 2009-08-02 17:03:13 +10:00
Luke Kanies d4d8372bf8 Fixing a small test by stubbing instead of mocking
Signed-off-by: Luke Kanies <luke@madstop.com>
2009-08-02 16:38:49 +10:00
Luke Kanies 54a225dd26 Fixing tests broken by caching autoload results
These tests tried to load something, verified
the loads didn't work, and then created
the thing to load.  This is a bit silly,
so I just removed those sections of the tests.

Signed-off-by: Luke Kanies <luke@madstop.com>
2009-08-02 16:38:49 +10:00
Luke Kanies 1ce31b4f5c Migrating Handler base tests from test/ to spec/
Signed-off-by: Luke Kanies <luke@madstop.com>
2009-08-02 16:38:48 +10:00
Luke Kanies cc3f56a68b Migrating Feature tests to spec
This was to fix a failing test/unit test.

Test coverage is now a bit better, more maintainable,
and I refactored the code just slightly to make it a bit
cleaner.

Signed-off-by: Luke Kanies <luke@madstop.com>
2009-08-02 16:38:48 +10:00
Luke Kanies 21d1d257a8 Fixing cron test to match new behaviour
7 was added as a valid weekday in #2293, and this
test just corrects that.

Signed-off-by: Luke Kanies <luke@madstop.com>
2009-08-02 16:38:48 +10:00
Luke Kanies 849fa67b6e Migrating tests to spec and removing an obsolete test
Signed-off-by: Luke Kanies <luke@madstop.com>
2009-08-02 16:38:48 +10:00
Brice Figureau 58a73b5c68 Make sure node are referenced by their names
This patch uses the unused AST::HostName as the only way to reference
a node in the AST nodes array.
The AST::HostName respect the hash properties of the underlying
string, to keep the O(1) hash properties.

Signed-off-by: Brice Figureau <brice-puppet@daysofwonder.com>
2009-08-01 11:15:29 +10:00
Brice Figureau 3ebf148bf3 Enhance selector and case statements to match with regexp
The case and selector statements define ephemeral vars, like 'if'.

Usage:

case statement:
$var = "foobar"
case $var {
    "foo": {
         notify { "got a foo": }
    }
    /(.*)bar$/: {
         notify{ "hey we got a $1": }
    }
}

and for selector:
$val = $test ? {
  /^match.*$/ => "matched",
  default => "default"
}

Signed-off-by: Brice Figureau <brice-puppet@daysofwonder.com>
2009-08-01 11:15:29 +10:00
Brice Figureau ef68967f2b Fix #2033 - Allow regexp in if expression
This changeset introduces regexp in if expression with the use of the
=~ (match) and !~ (not match) operator.

Usage:

if $uname =~ /Linux|Debian/ {
  ...
}

Moreover this patch creates ephemeral variables ($0 to $9) in the current
scope which contains the regex captures:
if $uname =~ /(Linux|Debian)/ {
  notice("this is a $1 system")
}

Signed-off-by: Brice Figureau <brice-puppet@daysofwonder.com>
2009-08-01 11:15:29 +10:00
Luke Kanies b3b76dffdd Fixing #2296 - overlapping recursions work again
This fixes the behaviour when you have file recursions
that overlap - we again correctly use the most
specific information.

It's still a bit expensive when you do this, but
at least it behaves correctly, and it should be
a rare circumstance.

Signed-off-by: Luke Kanies <luke@madstop.com>
2009-07-25 12:00:02 +10:00
Luke Kanies 7c859a7dd7 Fixing #2399 - removing client-side rrd graphs
This feature has been broken since who knows when,
yet no one's noticed.  Thus, it's a good
candidate for removal.

Signed-off-by: Luke Kanies <luke@madstop.com>
2009-07-23 22:42:20 -07:00
Luke Kanies 935c46351f Fixing #2403 - provider specificity is richer and better
We have extended the concept of provider specificity so it
now includes both specified defaults and class depth, so:

* We are much more likely to choose the correct provider;
  e.g., 'init' will be chosen over 'base'

* We're much less likely to print this warning, because it's
  only printed when provider specificities are equal which
  is much rarer

lib/puppet/provider.rb   |    4 ++--
lib/puppet/type.rb       |    4 ++--
spec/unit/type.rb        |   17 +++++++++++++++++
test/ral/manager/type.rb |   22 ----------------------
4 files changed, 21 insertions(+), 26 deletions(-)

Signed-off-by: Luke Kanies <luke@madstop.com>
2009-07-24 09:49:05 +10:00
Luke Kanies eb40966777 Ruby no longer clobbers puppet autoloading
We basically just make sure that we tell Ruby
about files we've loaded, so you can 'require' these
files and doing so will essentially no-op, rather
than clobbering the already-loaded code.

Signed-off-by: Luke Kanies <luke@madstop.com>
2009-07-16 21:23:03 +10:00
Nigel Kersten a42e8788b1 deprecate NetInfo providers and examples, remove all NetInfo references and tests. 2009-07-14 07:54:15 -07:00
Brice Figureau ea66cf6b9a Fix #2348 - Allow authstore (and REST auth) to match allow/deny against opaque strings
This patch removes the limitation of allow/deny which were
only matching ip addresses or hostname (or pattern of).

It makes sure any kind of string can be matched (by strict
equality) while still keeping the old behaviour.

Opaque strings can only contains: alphanumeric characters, -
_ and @.

Signed-off-by: Brice Figureau <brice-puppet@daysofwonder.com>
2009-07-07 16:19:39 +10:00
Luke Kanies cddc365e9b Switching to LoadedCode from ASTSet
I also took the opportunity to clean up and simplify
the interface to the parts of the parser that interact
with this.  Mostly it was method renames.

Signed-off-by: Luke Kanies <luke@madstop.com>
2009-07-05 18:47:08 +10:00
Luke Kanies ed876e0264 Refactoring part of the file/filebucket integration
The goal of this commit is to fix ordering issues
that could result when the filebuckets are added
to the catalog after the resources that use them.

This condition showed up somewhat arbitrarily.

Signed-off-by: Luke Kanies <luke@madstop.com>
2009-06-14 19:27:30 -05:00
Brice Figureau d3323331e9 Fix #2333 - Make sure lexer skip whitespace on non-token
Comments and multi-line comments produces no token per-se during
lexing, so the lexer loops to find another token.
The issue was that we were not skipping whitespace after finding
such non-token.

Signed-off-by: Brice Figureau <brice-puppet@daysofwonder.com>
2009-06-12 22:52:29 +10:00
Luke Kanies e4ae870f61 Fixing #2336 - qualified variables only throw warnings
We were previously throwing exceptions.

This also ports all of the tests for variable lookup
over to rspec.

Signed-off-by: Luke Kanies <luke@madstop.com>
2009-06-11 18:35:14 -05:00
Ian Taylor 4f2c066a97 Removed extra whitespace from end of lines 2009-06-06 09:12:00 +10:00
Ian Taylor 41ce18cc8e Changed tabs to spaces without interfering with indentation or alignment 2009-06-06 09:11:28 +10:00
Brice Figureau f3b4092360 Fix #2308 - Mongrel should use X-Forwarded-For
Mongrel puppet code uses REMOTE_ADDR to set the ip address which will
be use to authenticate the client access.
Since mongrel is always used in a proxy mode with Puppet, REMOTE_ADDR
is always the address of the proxy (usually 127.0.0.1), which defeats
the purpose.
With this changeset, the mongrel code now uses the X-Forwarded-For
HTTP header value if it is passed over the REMOTE_ADDR.

Signed-off-by: Brice Figureau <brice-puppet@daysofwonder.com>
2009-06-05 07:59:56 +10:00
Luke Kanies d860a2fb71 Fixing a transaction test that had some broken plumbing
Signed-off-by: Luke Kanies <luke@madstop.com>
2009-05-26 13:43:39 +10:00
Luke Kanies d489a2b9e2 Adding modulepath caching to the Autoloader
There's more caching to add, but this simplifies
the interface to the list of paths and then caches
that list so we aren't constantly searching the
filesystem.

Signed-off-by: Luke Kanies <luke@madstop.com>
2009-05-20 18:29:04 +10:00
Luke Kanies fb957ccb66 Modules now can find their own paths
Previously, when you created a module you had to specify
the path.  Now Module instances can use the module path
to look up their paths, and there are methods for determining
whether the module is present (if the path is present).

Also cleaned up the methods for figuring out what's in
the module (plugins, etc.).

Signed-off-by: Luke Kanies <luke@madstop.com>
2009-05-15 10:01:26 +10:00
Brice Figureau 2d580c257e Fix snippets tests failing because of activated storeconfigs
All the snippets tests were failing because some parser and scope
tests activated storeconfigs without reseting the state.
Activating storeconfigs is not undoable at the moment by just
setting storeconfig=false as some terminus are changed.

Signed-off-by: Brice Figureau <brice-puppet@daysofwonder.com>
2009-05-15 09:56:58 +10:00
Brice Figureau 6a80b764ef Fix some master failing tests
Signed-off-by: Brice Figureau <brice-puppet@daysofwonder.com>
2009-05-15 09:56:58 +10:00
Brice Figureau 1c46205445 Fix #2207 - type was doing its own tag management leading to subtile bugs
This patch moves Type to use Puppet::Util::Tagging as the other
part of Puppet. This brings uniformity and consistency in the
way the tags are used and/or compared to each other.
Type was storing tags in Symbol format, which produced #2207.

Signed-off-by: Brice Figureau <brice-puppet@daysofwonder.com>
2009-04-29 19:32:38 +02:00
Luke Kanies adff2c5a27 Removing a non-functional and horrible test
Signed-off-by: Luke Kanies <luke@madstop.com>
2009-04-24 18:05:19 -05:00
Brice Figureau 22b82abcd2 Add dynamic authorization to authstore
The idea is to have allow/deny authorization directives
that are dynamic: their evaluation is deferred until
we perform the authorization checking in allowed?.
This is done to allow replacing backreferences in allow/deny
directives by parameters of the match that selected this right.
For instance, it is possible to:
allow $1.$2
And using Right::interpolate() with the result of a regex match
using 2 captures, will evaluate $1.$2 to those captures.
For instance, if we captured [host, reductivelabs.com], then the
allow directive is replaced by:
allow host.reductivelabs.com
It is then safe to call allowed?, after which we can reset the
interpolation.
This interpolation is thread-safe.

Signed-off-by: Brice Figureau <brice-puppet@daysofwonder.com>

authconfig regex support
2009-04-23 20:52:02 +02:00
Luke Kanies b694b3c069 Fixing tests that apparently only worked sometimes
Signed-off-by: Luke Kanies <luke@madstop.com>
2009-04-22 14:39:40 +10:00
Luke Kanies 93246c0c70 Removing the old rails tests.
They don't work with the modified code, and we
rely almost entirely on manual integration testing
for this stuff anyway.

We definitely need to add tests where we can, but
these tests are totally useless.

Signed-off-by: Luke Kanies <luke@madstop.com>
2009-04-22 14:39:40 +10:00
Luke Kanies a677e26eb1 Fixing all tests that were apparently broken in the 0.24.x merge.
Signed-off-by: Luke Kanies <luke@madstop.com>
2009-04-02 19:41:17 -05:00
Luke Kanies e016307f00 Fixing Rakefile; apparently there was a rake or gem incompatibility
Signed-off-by: Luke Kanies <luke@madstop.com>
2009-04-02 19:34:38 -05:00
Luke Kanies 6e79cc0096 Merge branch '0.24.x'
Conflicts:
	bin/ralsh
	lib/puppet/executables/client/certhandler.rb
	lib/puppet/parser/functions/versioncmp.rb
	lib/puppet/parser/resource/reference.rb
	lib/puppet/provider/augeas/augeas.rb
	lib/puppet/provider/nameservice/directoryservice.rb
	lib/puppet/provider/ssh_authorized_key/parsed.rb
	lib/puppet/type.rb
	lib/puppet/type/file/checksum.rb
	spec/integration/defaults.rb
	spec/integration/transaction/report.rb
	spec/unit/executables/client/certhandler.rb
	spec/unit/indirector/ssl_rsa/file.rb
	spec/unit/node/catalog.rb
	spec/unit/provider/augeas/augeas.rb
	spec/unit/rails.rb
	spec/unit/type/ssh_authorized_key.rb
	spec/unit/type/tidy.rb
	test/executables/filebucket.rb
	test/executables/puppetbin.rb
2009-04-02 18:56:53 -05:00
Brice Figureau 33d3624c91 Fix #1469 - Add an option to recurse only on remote side
When using recurse and a source, if the client side has many files
it can take a lot of CPU/memory to checksum the whole client
hierarchy. The idea is that it is not necessary to recurse on the
client side if all we want is to manage the files that are sourced
from the server.

This changeset adds the "remote" recurse value which prevents recursing
on the client side when a source is present. Since it also is necessary
to limit the remote side recursion a new File{} parameter has been
added called "recurselimit".

Moreover, the Filetset API is changing to allow the new recurselimit
parameter, and passing the recursion depth limit in the recurse parameter
as an integer is now deprecated and not supported anymore.

Signed-off-by: Brice Figureau <brice-puppet@daysofwonder.com>
2009-03-20 21:44:00 +11:00
Brice Figureau af4455e31d Fix #1088 - part2 - Add rspec tests
Signed-off-by: Brice Figureau <brice-puppet@daysofwonder.com>
2009-03-14 11:31:29 +11:00
Luke Kanies 88aa1bc2cf Fixing tests broken in previous commits
Signed-off-by: Luke Kanies <luke@madstop.com>
2009-03-11 23:52:53 -05:00
Luke Kanies 0c16426a77 Fixing broken 0.24.x tests in test/.
These tests once again largely were caused
by /usr/sbin not being in the path and by
~ not being writable.

The only tests still failing are Rails tests,
and my guess is that they're all failing because
of the recent work by Brice.  They should probably
just be removed.

Signed-off-by: Luke Kanies <luke@madstop.com>
2009-02-28 07:55:56 +00:00
James Turnbull 5f73eb553f Fixed #1849 - Ruby 1.9 portability: `when' doesn't like colons, replace with semicolons 2009-02-26 11:43:39 +11:00
Luke Kanies c0d5037d11 Removing or fixing old tests
Most of these were just obsolete tests that have
been sitting around and broke with recent internal
changes.

Signed-off-by: Luke Kanies <luke@madstop.com>
2009-02-19 17:51:22 -06:00
Luke Kanies e87de9d8f3 Merge branch '0.24.x'
Conflicts:
	test/ral/manager/type.rb
2009-02-14 18:10:37 -06:00
Luke Kanies 3ef5849020 Fixing a test I broke in commit:"897539e857b0da9145f15648b6aa2ef124ec1a19".
I hadn't removed the call to 'prefetch' on the instance in the test.

Signed-off-by: Luke Kanies <luke@madstop.com>
2009-02-14 12:24:42 -06:00
Luke Kanies 72bd378d62 Removing a no-longer-valid test.
The fix for #1884 removed this no-longer-needed
feature, so this test is now unnecessary.

Signed-off-by: Luke Kanies <luke@madstop.com>
2009-02-14 12:24:42 -06:00
Luke Kanies 3fbec12076 Merge branch '0.24.x'
Conflicts:
	lib/puppet/indirector/facts/facter.rb
	lib/puppet/provider/augeas/augeas.rb
	lib/puppet/util/filetype.rb
	spec/unit/indirector/facts/facter.rb
	spec/unit/provider/augeas/augeas.rb
	test/util/filetype.rb
2009-02-13 18:24:34 -06:00
Luke Kanies 53f15b9208 Removing the apparently obsolete netinfo filetype.
Signed-off-by: Luke Kanies <luke@madstop.com>
2009-02-13 14:16:36 +11:00
Luke Kanies 4e89156b21 Migrated FileType tests to spec, and fleshed them out a bit.
Signed-off-by: Luke Kanies <luke@madstop.com>
2009-02-13 14:16:35 +11:00
Luke Kanies 5335788411 Fixing tests broken during the #1405 fix.
Most of these were small changes, like moved methods.

Signed-off-by: Luke Kanies <luke@madstop.com>
2009-02-06 18:08:44 -06:00
Luke Kanies 08a5d492dd Adding an Agent::Runner class.
This will eventually be used by puppetrun, but
for now is just called by the old-school Runner handler.

Signed-off-by: Luke Kanies <luke@madstop.com>
2009-02-06 18:08:43 -06:00
Luke Kanies c0fcb2137e Creating and using a new Puppet::Daemon class
This replaces the short-lived EventManager class, all of
the service- and timer-related code in puppet.rb, and moves
code from agent.rb, server.rb, and other places into one
class responsible for starting, stopping, pids, and more.

The Daemon module is no longer in existence, so it's been
removed from the classes that were using it.

Signed-off-by: Luke Kanies <luke@madstop.com>
2009-02-06 18:08:43 -06:00
Luke Kanies fc14b81f99 Splitting the Agent class into Agent and Configurer
Once I went to add runinterval support to the Agent class,
I realized it's really two classes:  One that handles starting,
stopping, running, et al (still called Agent), and one that
handles downloading the catalog, running it, etc. (now
called Configurer).

This commit includes some additional code, but 95% of it is just moving code around.

Signed-off-by: Luke Kanies <luke@madstop.com>
2009-02-06 18:08:42 -06:00
Luke Kanies 337057ad66 Removing obsolete code and tests for the agent.
Signed-off-by: Luke Kanies <luke@madstop.com>
2009-02-06 18:08:42 -06:00
Luke Kanies 9d76b70c07 Removing the Agent code that added client-side facts
It's now moved to the Facter indirector terminus.

Signed-off-by: Luke Kanies <luke@madstop.com>
2009-02-06 18:08:40 -06:00
Luke Kanies 37692e5851 Renmaing Puppet::Network::Client::Master to Puppet::Agent
Made minor changes, including removing the parent class.

The functionality hasn't changed yet -- that comes in later patches --
but all but a couple of the older tests pass.

Signed-off-by: Luke Kanies <luke@madstop.com>
2009-02-06 18:08:40 -06:00
Paul Lathrop 234a035b97 Fix #1560
Adds an rspec test which demonstrates #1560 and a custom 'process'
method for the aliases provider to fix it.

The default processing uses split() to break the line into records on
the separator, which breaks if records can contain the separator. The
custom method I've added uses a 'limited' split() to break the line on
the first separator only.

This commit fixes #1560

Signed-off-by: Paul Lathrop <paul@tertiusfamily.net>
2009-01-22 10:45:22 +11:00
James Turnbull 4c648bb1e7 Merge branch '0.24.x'
Conflicts:
	CHANGELOG
2008-12-27 12:43:52 +11:00
Luke Kanies 0fc067449a Fixing all of the test/ tests I broke in previous dev.
Most of these are straightforward changes to the tests,
but a couple required small refactorings (e.g., References
can now be created with Puppet::Type instances, and they
know how to extract the type/title from them).

Signed-off-by: Luke Kanies <luke@madstop.com>
2008-12-18 11:10:26 -06:00
Luke Kanies e4ba3db196 Deprecating the Puppet::Type.create.
This method is no longer necessary; you can use the
normal 'new' class method.

Signed-off-by: Luke Kanies <luke@madstop.com>
2008-12-18 11:10:25 -06:00
Luke Kanies b6db545851 Deprecating 'Puppet.type'; replacing all instances with Puppet::Type.type
Signed-off-by: Luke Kanies <luke@madstop.com>
2008-12-18 11:10:25 -06:00
Luke Kanies 89c25ad066 Finishing the work to use Puppet::Resource instead of TransObject
This was a complicated project because TransObject had made its
way into too many classes.  The usage by Util::Settings
was particularly nefarious.  Refactoring and fixing this
exposed some other issues.

The main complication, though, was the extent to which the
Puppet::Type class depended on TransObject.

Signed-off-by: Luke Kanies <luke@madstop.com>
2008-12-18 11:10:24 -06:00
Luke Kanies 352d7be1a2 Refactoring the Settings class to use Puppet::Resource
It also now uses the Catalog instead of the recursive
TransObject stuff.

Signed-off-by: Luke Kanies <luke@madstop.com>
2008-12-18 11:10:23 -06:00
Luke Kanies 14c3c54ee1 Replacing TransObject usage with Puppet::Resource
This completely reorganizes how RAL resources are
initialized, and in the process I was able to remove a lot
of code (I removed other apparently obsolete code at
the same time).

Signed-off-by: Luke Kanies <luke@madstop.com>
2008-12-18 11:10:22 -06:00
Luke Kanies 60062e4b9a Renaming the "Catalog#to_type" method to "Catalog#to_ral"
Signed-off-by: Luke Kanies <luke@madstop.com>
2008-12-18 11:10:22 -06:00
Luke Kanies e3b1590f57 Adding resource convertion to the parser resources
Also uses Puppet::Resource's method for creating
transportable resources.

Signed-off-by: Luke Kanies <luke@madstop.com>
2008-12-18 11:10:21 -06:00
Luke Kanies d48fff6658 Renaming Puppet::Node::Catalog to Puppet::Resource::Catalog
Signed-off-by: Luke Kanies <luke@madstop.com>
2008-12-18 11:10:21 -06:00
Luke Kanies b966ea02a9 Modifying the corruption-checking test.
It is now more likely to fail if there's a problem,
since the yaml should be corrupt, causing a yaml failure.

Also removing the equivalent test from the Storage module.

Signed-off-by: Luke Kanies <luke@madstop.com>
2008-12-15 19:27:45 +11:00
Luke Kanies 2385a78a7c Preparing to fix #1812 - Moving locking code to a module
This moves the locking code out of Puppet::Util into a
separate module, to make the code cleaner.

Signed-off-by: Luke Kanies <luke@madstop.com>
2008-12-12 09:44:42 +11:00
Luke Kanies 71b8befa42 Merge branch '0.24.x'
Conflicts:

	CHANGELOG
	lib/puppet/type/tidy.rb
	spec/unit/type/file/ensure.rb
	spec/unit/type/tidy.rb
2008-12-09 15:10:09 -06:00
Brice Figureau b22303e316 Fix rake abort when there is a matching confine
Signed-off-by: Brice Figureau <brice-puppet@daysofwonder.com>
2008-12-08 08:29:23 +11:00
Luke Kanies 6b30171435 Fixing all broken tests. Most of them were broken by fileserving changes.
Signed-off-by: Luke Kanies <luke@madstop.com>
2008-12-02 22:28:22 -06:00
Luke Kanies 99a9b5a045 Merge branch '0.24.x'
Conflicts:

	bin/puppetca
	lib/puppet/type/group.rb
	lib/puppet/type/tidy.rb
	lib/puppet/util/settings.rb

Also edited the following files so tests will pass:

       lib/puppet/type/component.rb
       spec/unit/ssl/certificate_request.rb
       spec/unit/type/computer.rb
       spec/unit/type/mcx.rb
       spec/unit/type/resources.rb
       spec/unit/util/settings.rb
       spec/unit/util/storage.rb
       test/ral/type/zone.rb
2008-12-02 16:26:54 -06:00
Luke Kanies 78bced1de8 Fixing #1683 - accessing and changing settings is now thread-safe.
Applying patch by Matt Palmer.

Signed-off-by: Luke Kanies <luke@madstop.com>
2008-11-26 12:57:53 +11:00
Luke Kanies 5bd27c8b81 Partially fixing #1772 - broken 'resources' tests.
The main problem was that the directory_services user provider was returning
a string for its uid instead of an integer.  I also began a 'resources'
spec file.

Signed-off-by: Luke Kanies <luke@madstop.com>
2008-11-26 12:56:12 +11:00
James Turnbull c96d250f71 Fixed #1711 - fileserver test fails due to incorrect mocking 2008-11-19 18:55:57 +11:00
Brice Figureau 2c05a0abcb Move function existance test to parser evaluation
The aim is to let --parseonly succeeds even if the function
is not (yet) present. This is usefull in commit-hooks and
for the inline documentation generation system.

Signed-off-by: Brice Figureau <brice-puppet@daysofwonder.com>
2008-11-17 21:05:50 +11:00
Luke Kanies cc1297031d Completely refactoring the tidy type.
This was necessary because of how I changed file recursion.

The type works much more intelligently now -- files to
be removed have a file resource generated for them, and that
resource handles deletion.

Also fixes #1717; neither age nor size is required now.

Signed-off-by: Luke Kanies <luke@madstop.com>
2008-11-15 02:25:48 -06:00
Luke Kanies 053d7bfa67 These changes are all about making sure file data is expired when appropriate.
All file tests now pass.

Signed-off-by: Luke Kanies <luke@madstop.com>
2008-11-15 02:25:47 -06:00
Luke Kanies 14af971bc6 Changing the Cacher.invalidate method to Cacher.expire.
Signed-off-by: Luke Kanies <luke@madstop.com>
2008-11-11 12:53:37 -08:00
Brice Figureau e032034fc4 Fix #1737 - ssh_authorized_keys should be able to parse options containing commas
Signed-off-by: Brice Figureau <brice-puppet@daysofwonder.com>
2008-11-11 10:15:38 +11:00
Luke Kanies fe0b818c41 Fixing tests broken by fileserving and other refactoring.
Signed-off-by: Luke Kanies <luke@madstop.com>
2008-11-08 12:52:52 -06:00
Luke Kanies 0149e2e125 Converting the file 'source' property to a parameter.
This makes a lot of sense because source was always
more of a metaparameter than a property -- it affected
the 'should' values of other properties, but it shouldn't
have done any other work.

It will hopefully make everything else much cleaner.

This is such a large commit mostly because of the need
to fix a lot of tests.

Signed-off-by: Luke Kanies <luke@madstop.com>
2008-11-05 23:04:33 -06:00
Luke Kanies aa8d09149c Switched all value management in props/params to internal classes.
This is a significant refactor of some very murky code, and it's
all much cleaner and more readable now.  All of the 'newvalue' methods
and any value-related code is in a ValueCollection class.

This puts us in a good position to refactor the Property and Parameter
classes more completely.

Signed-off-by: Luke Kanies <luke@madstop.com>
2008-11-04 16:20:46 -06:00
Luke Kanies 05e1325891 Moving a file purging test to rspec
Signed-off-by: Luke Kanies <luke@madstop.com>
2008-11-04 16:20:45 -06:00
Luke Kanies a4d4444ba2 Removing obsolete methods and tests:
Removing obsolete handleignore method
    Removing obsolete FileSource class
    Removing a now-obsolete test/unit test
    Removing a now-obsolete recursive filebucket test

Signed-off-by: Luke Kanies <luke@madstop.com>
2008-11-04 16:20:45 -06:00
Luke Kanies b4f4866b45 Making it so (once again) files with sources set can still be deleted
(which I think is kinda stupid, but apparently people want it).

Signed-off-by: Luke Kanies <luke@madstop.com>
2008-11-04 16:20:45 -06:00
Luke Kanies caf15c27b8 Fixing and migrating more file tests.
This is an unfortunately messy commit; I should have tried harder
to separate the different tasks into different commits, but it's
not worth going back and doing now.

This is the first commit in the long road of fixing the existing file
tests, and in the process refactoring and better testing the code.

The refactoring in this commit is mostly around the 'stat' instance
variable that tests whether the file exists (and provides its metadata
if it does) and the 'insync?' method in the source property.

Signed-off-by: Luke Kanies <luke@madstop.com>
2008-11-04 16:20:45 -06:00
Luke Kanies 781a685248 Fixing a test I broke when fixing a reporting bug
Signed-off-by: Luke Kanies <luke@madstop.com>
2008-11-01 10:42:17 +11:00
Luke Kanies e70c1a067a Fixing forward-compatibility issues resulting from no global resources
Signed-off-by: Luke Kanies <luke@madstop.com>
2008-10-31 16:10:45 -05:00
Luke Kanies 4596d2d80e Fixing a test I broke when fixing a reporting bug
Signed-off-by: Luke Kanies <luke@madstop.com>
2008-10-31 16:05:18 -05:00
Luke Kanies e76cac7df1 Merge branch '0.24.x'
Conflicts:

	CHANGELOG
2008-10-31 16:01:28 -05:00
Brice Figureau 2d37f09aa0 Fix #1402 - Allow multiline comments
Signed-off-by: Brice Figureau <brice-puppet@daysofwonder.com>
2008-10-29 10:30:38 +01:00
Brice Figureau 9f30306d2c Fix #857 - Multiple class of the same name don't append code
The following manifest wasn't working:
class one {
notice('class one')
}

class one {
notice('second class one')
}

include one

It all boiled down to class code not being arrays.
Encapsulating code in ASTArray when needed is enough to append code,
because of the property of ASTArray to evaluate all their members in
turn.

Signed-off-by: Brice Figureau <brice-puppet@daysofwonder.com>
2008-10-29 10:28:32 +01:00
James Turnbull 56f3be66a4 Fixed #1710 - Spurious output in test run 2008-10-29 14:36:20 +11:00
Luke Kanies 801b8a643d Merge branch '0.24.x'
Conflicts:

	lib/puppet/type/user.rb
2008-10-22 18:30:57 -05:00
Brice Figureau 6d05cbc1e1 Fix #936 - Allow trailing comma in array definition
Signed-off-by: Brice Figureau <brice-puppet@daysofwonder.com>
2008-10-21 21:15:53 +11:00
Brice Figureau e6f99f92ec Fix #636 - Allow extraneous comma in function argument list
Signed-off-by: Brice Figureau <brice-puppet@daysofwonder.com>
2008-10-21 09:32:28 +11:00
Luke Kanies 8aee40de69 Merge branch '0.24.x' Removed the 'after' blocks that call Type.clear,
since that method is deprecated.

Conflicts:

	CHANGELOG
	bin/puppetca
	lib/puppet/file_serving/fileset.rb
	lib/puppet/network/xmlrpc/client.rb
	lib/puppet/type/file/selcontext.rb
	spec/unit/file_serving/metadata.rb
	spec/unit/type/file.rb
2008-10-17 09:01:04 -05:00
Luke Kanies 0fff7d76e8 Fixing some tests that were broken in 2fba85af
Signed-off-by: Luke Kanies <luke@madstop.com>
2008-10-08 23:44:41 -05:00
Luke Kanies 2afbd0d877 Fixing a test that was failing as a result of the fix to #1491
Signed-off-by: Luke Kanies <luke@madstop.com>
2008-10-08 22:33:05 -05:00
Luke Kanies aea55823db Removing a gid test for users, since it is a bad test and has mostly been replaced in rspec
Signed-off-by: Luke Kanies <luke@madstop.com>
2008-10-08 22:32:56 -05:00
Luke Kanies 65d3040d5d Fixing a test that was broken in ee579641
Signed-off-by: Luke Kanies <luke@madstop.com>
2008-10-08 22:32:56 -05:00
Luke Kanies b08002e45a Fixing some tests that were broken in the fix for #1633
Signed-off-by: Luke Kanies <luke@madstop.com>
2008-10-08 22:32:56 -05:00
Luke Kanies 952ebb8bfa Fixing a test that was failing because of the change to retrieve() in ee579641
Signed-off-by: Luke Kanies <luke@madstop.com>
2008-10-08 22:05:43 -05:00
Luke Kanies a5fe87fb3c Fixing a file source test that was failing because missing sources is now a failure
Signed-off-by: Luke Kanies <luke@madstop.com>
2008-10-08 22:04:49 -05:00
Luke Kanies 53b7d42bb0 Fixing the broken tests resulting from the fix for #1551.
The test was expecting the current time, albeit as an integer.

Signed-off-by: Luke Kanies <luke@madstop.com>
2008-10-08 22:03:22 -05:00
Luke Kanies 5ec6b0734d Adding warnings when example groups are skipped.
Signed-off-by: Luke Kanies <luke@madstop.com>
2008-10-08 21:27:21 -05:00
Luke Kanies 54abe7084d Moving some test/ package tests to rspec integration tests
and disabling a gem test that hangs forever for me.

Signed-off-by: Luke Kanies <luke@madstop.com>
2008-10-08 21:16:26 -05:00
Brice Figureau 0c297be5da Fix #1109 - allow empty if or else branches
This changesets allow empty if or else branches:

if true {
} else {
}

It works by emitting on the parser stack an AST node that doesn't
do anything (a no-op). This allows the less intrusive code
as no part of the if evaluation code has been touched.
2008-10-07 07:51:44 +11:00
Francois Deppierraz 990e8e3caa Fix #1530: Correctly parse ssh type 1 keys
This doesn't implies that puppet can managed SSH type 1 keys, it only
ignores them.
2008-10-07 00:24:02 +11:00
James Turnbull 06edac4a23 Fixed additional environments tests 2008-10-05 22:50:18 +11:00
Brice Figureau 79bb1f201c Rspec Tests for #381.
Moved part of the old resource reference tests to rspec.
2008-10-05 14:53:13 +11:00
James Turnbull 782181e0da Minor test fix for #1614 2008-10-04 13:21:51 +10:00
Luke Kanies db7f108f54 Adding rspec tests for the Puppet::Util::Log class.
Also using Puppet::Util::Tagging to handle the tagging,
rather than custom methods.

Signed-off-by: Luke Kanies <luke@madstop.com>
2008-10-04 08:48:16 +10:00
Luke Kanies 6bcfd9f021 Fixing #947 - pluginsync no longer fails poorly when no plugins exist
Note that it still fails -- it's just a more reasonable failure.

Signed-off-by: Luke Kanies <luke@madstop.com>
2008-10-03 13:11:44 -05:00
Luke Kanies d39bab9a02 Fixing package provider tests to use the new Transaction::Change interface
Signed-off-by: Luke Kanies <luke@madstop.com>
2008-10-02 13:36:26 +10:00
Luke Kanies e32256af93 Migrating the apt and dpkg tests to rspec.
I left the aptitude and aptrpm tests as an exercise
for the reader.

Signed-off-by: Luke Kanies <luke@madstop.com>
2008-10-02 13:36:26 +10:00
Luke Kanies 8620775135 Fixed #791 - You should now be able to create and find a user/group in one transaction.
The real problem was that the 'gid' and 'uid' methods didn't handle
the case where 'get_posix_field' didn't return a value, and
the subsequent 'get_posix_field' calls couldn't handle that.

This commit moves the tests for Posix to spec, and fixes the
specific bug.

Signed-off-by: Luke Kanies <luke@madstop.com>
2008-10-02 07:32:03 +10:00
Brice Figureau 4cf9710bd2 Add parser for arbitrary expressions
The expressions can be used in if 'test' and in the
right side of assignements.

The expressions can contain any number of sub-expressions
combined by either arithmetic operators, comparison operators,
or boolean operators.

Random Usage Examples:
$result = ((( $two + 2) / $one) + 4 * 5.45) - (6 << 7) + (0x800 + -9)
or
if ($a < 10) and ($a + 10 != 200) {
...
}
2008-10-01 01:35:03 +10:00
Luke Kanies 4aeabbbb21 Merge branch '0.24.x'
Conflicts:

	lib/puppet/metatype/container.rb
	lib/puppet/metatype/instances.rb
	lib/puppet/metatype/metaparams.rb
	lib/puppet/metatype/relationships.rb
	lib/puppet/metatype/schedules.rb
2008-09-23 22:31:55 -05:00
Brice Figureau 7a3a38f58c Add rspec unit test for the append operator
Signed-off-by: Brice Figureau <brice-puppet@daysofwonder.com>
2008-09-21 02:32:51 +10:00
Luke Kanies 5b9dd01326 Merge commit 'turnbull/0.24.x' 2008-08-26 22:40:26 -07:00
James Turnbull 29ae879232 Fixes tests broken by 95aa085 2008-08-27 15:30:24 +10:00
Andrew Shafer 0d118a5f22 Fix leaking LoadedFile when adding templates to be watched 2008-08-23 22:03:10 +10:00
Luke Kanies e3971b9751 Merge branch '0.24.x'
Conflicts:

	CHANGELOG
	test/util/posixtest.rb
2008-08-18 11:47:40 -05:00
James Turnbull 18dda20b41 Fixed $1456 - add proxy configuration to yum repo 2008-08-13 10:34:19 +10:00
Daniel Pittman 404450a715 Add testing for the changes to resolve redmine #1427, where Kernel methods shadow
variables that the puppet template should otherwise see.  Specific changes:

* Added testing of the Scope#to_hash method, which returns a hash of name and
  value pairs in a scope or, optionally, in the scope and enclosing scopes.

* Use member variables rather than methods in the function tests.

* Fix up tests that fail once we move over to instance variables rather than
  methods: Puppet can no longer detect an undefined variable reference, so we
  end up failing any test that expected to get a parser error.

* Several tests have manual checks introduced to simulate an end user manually
  writing the checks that used to be automatic, and others drop the validation
  that parsing fails when a variable is not in scope.

* Added tests for legacy variable lookup and that the shadowing of local
  variables by Kernel methods is still in effect.

Signed-off-by: Daniel Pittman <daniel@rimspace.net>
(cherry picked from commit 5c5f315cceadc52203e53883b77bc01c1d7a2e7f)
2008-08-01 08:54:05 +10:00
Luke Kanies 40375a8fc3 Merge branch '0.24.x' into merging
Conflicts:

	test/ral/type/filesources.rb
2008-07-29 00:46:11 -05:00
James Turnbull 97987a705d Feature #1241 : Improve performance of group lookups 2008-07-29 08:08:36 +10:00
Luke Kanies d9aa5ab68f Fixing a cert test to pass on Darwin.
Darwin has a case-insensitive FS, so the test was failing
because it was specifically testing case sensitivity.

Signed-off-by: Luke Kanies <luke@madstop.com>
2008-07-21 13:16:08 -05:00
Andrew Shafer a47fed4156 'Fix' broken tests related to missing source raising
Issue 1437
In two cases, I removed the assertion that caused the failure.
In one case, I changed the assertion to expect an exception.
2008-07-20 14:23:11 +10:00
Luke Kanies d8937acb8c You can now select the encoding format when transferring the catalog,
with 'yaml' still being the default but 'marshal' being an option.
This is because testing has shown drastic performance differences
between the two, with up to 70% of compile time being spent
in YAML code.  Use the 'catalog_format' setting to choose your format,
and the setting must be set on the client.

Signed-off-by: Luke Kanies <luke@madstop.com>
2008-07-18 16:41:54 +10:00
Luke Kanies 8f8ce60819 Fixed #1431 - Provider confines must now specify similar tests in one call.
I.e., you can't do confine :operatingsystem => %w{a b} and then
confine :operatingsystem => %w{b c}; you'd need to do them in one command.
This now-obsolete behaviour does not seem to be used anywhere.
The fix for #1431 is actually just removing the tests that exposed
this change; the change happened when I refactored how confines work.

Signed-off-by: Luke Kanies <luke@madstop.com>
2008-07-17 12:30:33 -05:00
Luke Kanies 7fa7251e30 The mongrel-related tests now run without mongrel.
Here were the main changes necessary:
* Fixed the class loader so it only loads mongrel if it's available.
* Fixed the test runner to skip example groups contained in non-runnable
  example groups.
* Fixed the Mongrel tests to use quoted class names instead of constants,
  since the constants themselves would be absent.

Signed-off-by: Luke Kanies <luke@madstop.com>
2008-07-17 13:08:33 +10:00
Luke Kanies b0febd263c Merge branch '0.24.x'
Conflicts:

	lib/puppet/util/settings.rb
	spec/integration/defaults.rb
	spec/unit/node/catalog.rb
	spec/unit/type/interface.rb
	spec/unit/type/ssh_authorized_key.rb
2008-07-04 22:14:37 -05:00
James Turnbull 81be1c5c3f Merge branch 'refactor/0.24.x/transaction_changes' of git://github.com/lak/puppet into 0.24.x 2008-07-05 10:21:36 +10:00
Luke Kanies 2863df2881 Refactoring the Transaction::Event class.
The class had a 'transaction' accessor that was assigned
but never used, and it is simple enough that it needed
direct arguments rather than named arguments.

The rest of the code is changing the other classes that use
Events.

Signed-off-by: Luke Kanies <luke@madstop.com>
2008-07-04 15:35:18 -05:00
Luke Kanies 31ffeabad9 Adding tests to the Transaction::Change class.
There's a small amount of refactoring here, mostly
removing code that appears to not be used at all.

Signed-off-by: Luke Kanies <luke@madstop.com>
2008-07-04 15:05:29 -05:00
Luke Kanies 73c06c05ae Renaming Puppet::Event to Puppet::Transaction::Event
Signed-off-by: Luke Kanies <luke@madstop.com>
2008-07-03 18:50:56 -05:00
James Turnbull 84b566590f Updated test/ral/type/sshkey.rb test 2008-07-04 09:40:01 +10:00
Luke Kanies 6124c693c9 Renaming the Puppet::PropertyChange class to Puppet::Transaction::Change.
Signed-off-by: Luke Kanies <luke@madstop.com>
2008-07-03 17:53:07 -05:00
Luke Kanies 3795654323 Merge branch '0.24.x' 2008-07-02 18:36:05 -05:00
Luke Kanies e03c1be35c Fixing #1382 - existing uppercase certs, keys, et al will be renamed.
This correctly renames the files and they still get read in.
2008-07-02 18:12:26 -05:00
Luke Kanies 8e4312ed24 Merge branch '0.24.x'
Conflicts:

	CHANGELOG
	spec/unit/node/catalog.rb
	spec/unit/type/package.rb
	spec/unit/type/schedule.rb
	spec/unit/type/service.rb
	spec/unit/util/settings.rb
2008-07-02 00:32:52 -05:00
Luke Kanies ee9d0025ee Fixed #1114 - Facts in plugin directories should now be autoloaded,
as long as you're using Facter 1.5.
2008-07-01 12:57:56 -05:00
Luke Kanies 00182ff96f Fixed #707 - special '@reboot'-style cron jobs work again. 2008-06-17 19:40:39 +10:00
James Turnbull 955a8ff876 Removed test/util/loadedfile.rb tests which fixes #1370 2008-06-17 09:46:47 +10:00
Luke Kanies 6a61198f92 Merge branch '0.24.x'
Also added the fixes to make the certhandler tests pass
even when certs exist; I'll deal with the conflict later.

Conflicts:

	CHANGELOG
	bin/puppetd
	lib/puppet/network/http/handler.rb
	lib/puppet/network/http/mongrel/rest.rb
	spec/integration/indirector/rest.rb
	spec/integration/network/server/mongrel.rb
	spec/integration/network/server/webrick.rb
	spec/unit/network/http/webrick.rb
2008-06-14 13:53:56 -05:00
James Turnbull ad3803ff6f Fixes for install.rb running of tests that fixes #1267 2008-05-27 14:10:40 +10:00
James Turnbull d2eb1948ee Merge branch 'tickets/1265' of git://github.com/lak/puppet into 0.24.x 2008-05-27 11:53:10 +10:00
Luke Kanies 8a22b59c7d Fixing #1265 -- the ca/client tests now all pass again. 2008-05-26 18:06:50 -05:00
Luke Kanies 02411f5d74 Always using the cert name to store yaml files, which fixes #1178.
The Master handler previously provided the support for the :node_name
setting, and that functionality has now been moved into the Node
class.  At the same time, the names to search through have been
changed somewhat:  Previously, the certificate name and the
hostname were both used for searching, but now, the cert name
is always searched first (unless node_name == facter), but only
the Facter hostname, domain, and fqdn are used otherwise.  We no
longer split the cert name, only the hostname/domain/fqdn.

In the general case, this provides no behaviour change, because
people's hostname is the same as their certname.  This only
results in a change in behaviour if you specify a certificate
name that is a normal node name, and you want to look that node
up by something other than the full name in the certificate.

Signed-off-by: Luke Kanies <luke@madstop.com>
2008-05-26 17:41:38 -05:00
Luke Kanies 6f533d1127 Fixing #1247 -- no more clear_cache failures.
I had clearly only run spec/ since this work.
2008-05-25 16:01:26 -05:00
Luke Kanies 29f5f1b862 Merge branch '0.24.x'
Conflicts:

	CHANGELOG
	lib/puppet/transaction.rb
2008-05-25 16:00:48 -05:00
Luke Kanies bd51a53b08 Fixing transaction support for prefetching generated resources.
Previously, we prefetched then generated, which caused generated
resources that needed prefetching not to work.  This just reorders
the calls, so generated resources now get prefetched.
2008-05-21 00:46:25 -05:00
Luke Kanies fe157f239a Merge branch '0.24.x'
Conflicts:

	CHANGELOG
	spec/integration/defaults.rb
	spec/integration/node/catalog.rb
	spec/unit/rails.rb
	spec/unit/type/mount.rb
2008-05-20 10:19:10 -05:00
James Turnbull 38545d9a81 Crontab provider: fix a parse error when a line begins with a space character
Tests for Bug #1216

Updated CHANGELOG
2008-05-16 16:50:29 +10:00
Luke Kanies a1409d73b4 Moving all confine code out of the Provider class, and fixing #1197.
I created a Confiner module for the Provider class methods,
and then I enhanced the interface between it and the Confine
class to make sure binary paths are searched for fresh each time.

This fixes #1197, which was a result of binary paths being
searched for at startup, rather than at execution.
2008-05-15 23:09:58 -05:00
Luke Kanies 995991d874 Switching the Provider class to use the new Confiner class. 2008-05-15 22:21:50 -05:00
Luke Kanies ac79a79c8d Duh, fixing all of the paths being loaded for spec in the moved tests. 2008-05-15 19:34:21 -05:00
Francois Deppierraz db8a46c605 New native ssh_authorized_key type 2008-05-07 22:04:07 +02:00
Luke Kanies e936ef2426 Fixing some broken tests.
The HttpPool module now removes its cached ssl_host instance
when clearing its cache.  This is really only useful
for testing, but it correctly causes the pool to use
new certificates when they're available.
2008-05-07 14:45:13 -05:00
Luke Kanies 0365184aae Removing obsolete tests 2008-05-07 13:28:51 -05:00
Luke Kanies 3303590156 The master and client now successfully speak xmlrpc using the new system.
The server is actually serving REST, but the client can't use
it until we resolve the format and security issues that REST
hasn't yet tackled.
2008-05-07 12:29:58 -05:00
Luke Kanies ebdbe4880d Added an Interface class to the CA to model puppetca's usage.
This class provides all of the semantics from puppetca,
and appears to entirely duplicate the behaviour of the existing
executable, with basically all of the code in a library
file, instead of the executable.

As such, I've deleted the test for the executable.  We should have
one, but it's not nearly as important.
2008-04-19 19:08:36 -05:00
Luke Kanies bb87464f75 Fixing a couple of broken tests. 2008-04-15 21:34:03 -05:00
Luke Kanies fb05ef3c96 Merge branch '0.24.x' 2008-04-11 13:01:42 -05:00
Luke Kanies b49fd49562 Resources now return the 'should' value for properties from
the [] accessor method (they previously threw an exception when
this method was used with properties).  This shouldn't have any
affect functionally; it just makes the method equivalent to 'should'
for properties, but it works for all attribute types now.
2008-04-11 13:01:17 -05:00
Luke Kanies 4aaad26509 Modified the 'master' handler to use the Catalog class to
compile node configurations, rather than using the Configuration
handler, which was never used directly.  I removed the Configuration
handler as a result.

Modified the 'master' handler (responsible for sending configurations
to clients) to always return Time.now as its compile date, so
configurations will always get recompiled.
2008-04-11 11:34:51 -05:00
Luke Kanies 2925ad1cb9 Fixed #1184 -- definitions now autoload correctly all of the time. 2008-04-10 23:18:20 -05:00
Luke Kanies 376628d117 Removed the code from the client that tries to avoid recompiling
the catalog. The client will now always recompile, assuming it
can reach the server.  It will still use the cached config if
there's a failure.
2008-04-10 23:17:36 -05:00
Luke Kanies 80f8b80eac Adding validation to the user type to confirm that the
group list does not contain any commas. This seems to be
a common problem.
2008-04-08 11:19:15 -05:00
Luke Kanies b49fb68f76 Fixing the tests in test/ that were broken as
a result of the move to no global resources.
2008-04-01 00:45:45 -05:00
Luke Kanies 88dc49cb7b Merge branch 'master' into master_no_global_resources
Conflicts:

	lib/puppet/node/catalog.rb
	lib/puppet/type/pfile.rb
	lib/puppet/type/pfilebucket.rb
	lib/puppet/util/filetype.rb
	spec/unit/node/catalog.rb
	spec/unit/other/transbucket.rb
	spec/unit/ral/provider/mount/parsed.rb
	spec/unit/ral/types/file.rb
	spec/unit/ral/types/interface.rb
	spec/unit/ral/types/mount.rb
	spec/unit/ral/types/package.rb
	spec/unit/ral/types/schedule.rb
	spec/unit/ral/types/service.rb
	test/language/compile.rb
	test/language/lexer.rb
	test/language/snippets.rb
	test/lib/puppettest.rb
	test/ral/types/basic.rb
	test/ral/types/cron.rb
	test/ral/types/exec.rb
	test/ral/types/file.rb
	test/ral/types/file/target.rb
	test/ral/types/filebucket.rb
	test/ral/types/fileignoresource.rb
	test/ral/types/filesources.rb
	test/ral/types/group.rb
	test/ral/types/host.rb
	test/ral/types/parameter.rb
	test/ral/types/sshkey.rb
	test/ral/types/tidy.rb
	test/ral/types/user.rb
	test/ral/types/yumrepo.rb
2008-03-31 23:56:09 -05:00