summaryrefslogtreecommitdiff
path: root/spec/unit/provider/service/systemd_spec.rb
AgeCommit message (Collapse)AuthorFilesLines
2014-04-28(pup-1932) Don't report static servicesKylo Ginsberg1-1/+0
The initial fix for pup-1932 inadvertently included 'static' services, which are services which can't be enabled/disabled. Since such services aren't manageable, it doesn't make sense to include them in instances, so this commit removes them.
2014-03-18(PUP-1932) Restrict systemd provider to manage file-based servicesKylo Ginsberg1-9/+6
Prior to this commit, the systemd provider returned in-memory services. This had a couple odd consequences, e.g. with 'puppet resource service': 1) short-lived services would come and go, though they are not actually managed directly 2) disabled and stopped services wouldn't be reported at all This commit changes the systemd provider to return file-backed services.
2014-02-26(pup-1766) Set systemd as a default provider for the service type on rhel7Kylo Ginsberg1-0/+12
2014-02-21(maint) Remove a pending test which isn't pending on anything planned or ↵Kylo Ginsberg1-17/+0
asked for
2014-02-21(pup-1732) Remove the fixture and stub for what *not* to doKylo Ginsberg1-4/+1
2014-02-20(pup-1732) Report only services from systemdKylo Ginsberg1-4/+22
Prior to this change the systemd service provider would return all systemd-managed types (including sockets, devices, swap, etc). This produced a huge list of instances, many of which were not in fact services. This change simply adds the '--type service' option to the 'systemctl' invocation in .instances. It also updates the spec tests with fixtures for the old (without that option) and new (with that option) way of invoking 'systemctl'. I purposefully did not touch the existing fixture which is tied to a test which is pending on a what-to-do about failed services. If/when we tackle that, we may want to collapse some of these fixtures.
2014-01-27(PUP-1318) Fixing expected parameters in service provider specs now that ↵Peter Huene1-7/+7
service output is no longer squelched by default. Redmine 565, a seven year old issue referenced in a comment in lib/puppet/provider/service/service.rb, is no longer applicable to `Puppet::Util::Execution#execute`. It was squelching service output because of a bug in ruby where `#read` on a pipe never returned when the spawned process is SIGTERM'd by one of its children. The current implementation of `Puppet::Util::Execution#execute` redirects to a temporary file instead of reading from a pipe. We should no longer be squelching service output so that users can easily diagnose service failures.
2013-04-25(#20421) Use systemd as default service on archNiels Abspoel1-0/+10
Per https://www.archlinux.org/news/end-of-initscripts-support/ Arch Linux has migrated to systemd and as of January 2013 has dropped support for sysv style init scripts. GH-1468 updated the systemctl binary location which made the systemd service provider functional on Arch, but since there was no clear default between init and systemd, init won out which effectively broke systemd init scripts. This commit sets systemd as the default for Arch Linux, and makes the sysvinit scripts available as a fallback option. Since the init provider is still functional and can be delegated to if there is no systemd service for a given system service. Squashed into a single commit and commit message update by Adrien Thebo <adrien@puppetlabs.com>
2013-02-14(maint) Improve systemd provider test coverageStefan Schulte1-6/+113
2013-02-14(maint) Simplify systemd spec testsStefan Schulte1-15/+11
It seems to be easier to deal with real object instances instead of fake objects.
2013-02-13(#16451) Use PATH to find systemctl for systemd service providerNiels Abspoel1-0/+5
Without this patch Puppet has a difficult time locating the systemctl executable in recent versions of Archlinux. This problem is caused by the executable moving from /bin/systemctl to /usr/bin/systemctl. This patch addresses the problem by eliminating the fully qualified path and instead relying on the PATH environment variable to locate the command. Unit test systemd_spec updated to test for this new behavior
2012-11-01(Maint) Remove unimplemented testsAndrew Parker1-8/+0
These tests were waiting for redhat to change something about their service systems, but there was no work in progress to make these changes. At the time the work is done, these tests can come back.
2012-09-26(Maint) Remove rspec from shebang lineJeff McCune1-1/+1
Without this patch Ruby 1.9 is still complaining loudly about trying to parse the spec files. The previous attempt to clean up this problem in edc3ddf works for Ruby 1.8 but not 1.9. I'd prefer to remove the shebang lines entirely, but doing so will cause encoding errors in Ruby 1.9. This patch strives for a happy middle ground of convincing Ruby it is actually working with Ruby while not confusing it to think it should exec() to rspec. This patch is the result of the following command run against the source tree: find spec -type f -print0 | \ xargs -0 perl -pl -i -e 's,^\#\!\s?/(.*)rspec,\#! /usr/bin/env ruby,'
2012-07-02(maint) Standardize on /usr/bin/env ruby -S rspecJeff McCune1-1/+1
Without this patch some spec files are using `ruby -S rspec` and others are using `rspec`. We should standardize on a single form of the interpreter used for spec files. `ruby -S rspec` is the best choice because it correctly informs editors such as Vim with Syntastic that the file is a Ruby file rather than an Rspec file.
2012-04-11(#13888) Fix self.instances for systemd service providerDan Bode1-0/+9
Previously, attempting to run puppet resource service on Fedora 16 resulted in a stack trace. This commit resolves the issue so that self.instances should work for systemd providers. The issue was that the instances method was returning an Array of strings. This commit updates the method to correctly return an Array of Provider instances.
2012-01-18Fixed #11888 - Changed providers to use osfamily fact.James Turnbull1-0/+8
Previously the up2date, redhat and systemd providers used the operatingsystem fact to select defaults and constraints. This often meant that new operating systems using the same providers had to be manually added to the list of supported operating systems This commit replaces the use of operatingsystem with osfamily meaning addition of new operating systems is now centralised in one place in Facter rather than requiring multiple updates. Tests supporting this have been added to prevent regressions.
2012-01-17(#11888) Revert 483a1d9 for 2.7.x onlyJeff McCune1-8/+0
This reverts commit 483a1d93a5e5c78f8f41f905d7aae896081c98f1, reversing changes made to c6667c50d3b49195685311575b46de1978c4dfd9. This revert is necessary because the change set includes API breaking changes in a patch version release of the product. The API breaking changes are that Puppet 2.7.x > 2.7.9 would require a different version of Facter than 2.7.x <= 2.7.9 if this change set were to be released. This commit should be reverted after 2.7.x merges up into master. That is to say, the revert itself should be reverted.
2012-01-11(#11888) Switch up2date,systemd,redhat providers to osfamily factJames Turnbull1-0/+8
Previously the up2date, redhat and systemd providers used the operatingsystem fact to select defaults and constraints. This often meant that new operating systems using the same providers had to be manually added to the list of supported operating systems. This commit replaces the use of operatingsystem with osfamily meaning addition of new operating systems is now centralised in one place in Facter rather than requiring multiple updates. Tests supporting this have been added to prevent regressions.
2011-06-20(#7999) Add some basic tests of the systemd providerJeffrey C. Ollie1-0/+25