summaryrefslogtreecommitdiff
path: root/spec/unit/provider/service
AgeCommit message (Collapse)AuthorFilesLines
2014-09-09(PUP-3222) Rescue StandardError instead of non-existent exceptionJosh Cooper1-0/+48
Previously, the windows service provider rescued exceptions of type Win32::Service::Error. However, FFI-based versions of win32-service (v0.8.x) no longer raise that type of error. Instead they raise SystemCallError. So previously, if puppet failed to manage a service, e.g. service didn't exist, puppet would try to rescue the exception specifying a class that was not defined: puppet resource service foo ensure=stopped Error: /Service[foo]: Could not evaluate: uninitialized constant Win32::Service::Error This regression was introduced as part of PUP-1283 when we migrated from win32-service version 0.7.x to 0.8.x. This commit modifies the various provider methods to more broadly rescue StandardErrors and updates the spec tests to handle the negative cases. Paired-with: Ethan J Brown <ethan@puppetlabs.com>
2014-08-11(PUP-2879) Add two nfsd-related upstart services to the blacklistKylo Ginsberg1-0/+2
2014-08-08(PUP-2879) Add cryptdisks-udev to the services blacklistKylo Ginsberg1-1/+5
Also this patch splits out the long line in upstart_spec.rb to be one line per service, so more diff-friendly.
2014-07-23(maint) Add test to ensure upstart is default init daemon in UbuntuWill Hopper1-0/+5
2014-06-19Merge pull request #2557 from jasperla/serviceAdrien Thebo1-2/+26
(PUP-2578) Adjustments for new OpenBSD service provider
2014-06-19(PUP-2578) Adjust spec tests to recent changes:Jasper Lievisse Adriaanse1-2/+26
- Ensure strict ordering of the result of #pkg_scripts_append - Add test for #in_base? - Ensure package scripts don't end up with empty flags
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-04-18Merge branch 'pull-2495'Adrien Thebo1-22/+129
2014-04-18(PUP-2143) Implement :enableable for OpenBSD service providerZach Leslie1-22/+129
Before now, Puppet has been unable to enable services on OpenBSD. This work implements a flags property that is manages the content of the rc.conf.local file, used by OpenBSD to define service runtime options and enable services. The flags property may also be used by other platforms, such as FreeBSD.
2014-04-14Merge pull request #2507 from ↵Adrien Thebo1-9/+6
kylog/issue/pup-1932/systemd-reports-transient-services (PUP-1932) Restrict systemd provider to manage file-based services
2014-03-26(PUP-1332) Add instantiated upstart services to exclude listMatthaus Owens1-1/+1
Previously puppet would fail when trying to list all services because some services require parameters for status queries to succeed. These include idmapd-mounting and startpar-bridge. This commit adds those services to the exclude list so that they are ignored when querying upstart for their status.
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-03-18(PUP-1751) Add service provider examples for Suse special casing.Peter Huene1-4/+18
Add spec examples for when a service is enabled, disabled, or non-existent on a Suse OS. Remove example that expected the '--check' flag for Suse, as it is no longer passed.
2014-03-05Merge pull request #2391 from kylog/issue/rhel7-systemd-defaultproviderJosh Partlow1-0/+12
pup-1766 make systemd the defaultprovider for service on rhel7
2014-02-28(PUP-876) Enable upstart service provider on RedhatAdrien Thebo1-0/+8
This commit allows the upstart service provider to function on Redhat systems. Redhat 6 included support for upstart and while it wasn't widely embraced it is available for use. The 'serial' and 'tty' services on Redhat 6 systems have instances which the service type/provider cannot handle, so we have to ignore them for the upstart provider to work out of the box.
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 Huene6-68/+68
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.
2014-01-06(PUP-716) Change back to stubs from mocksAndrew Parker1-6/+3
During changes a few calls had been inadvertently changed from stubs (any number of calls allowed, including 0) to mocks (at least one call required). In the case of the file_set this caused a problem for when there was no expectaiton of the methods being called. In the daemontools case, this exposed a mistake that was originally in the tests where the stub was not even needed.
2014-01-06(PUP-716) Fix up tests after FileSystem API changeHenrik Lindberg8-52/+47
One fixed test still failing on expectations
2013-11-14(#19447) check Puppet.features.manages_symlinks?Ethan J. Brown3-3/+3
- Replace calls to the specific :file provider with the global Puppet.features call
2013-11-13(#19447) Puppet::FileSystem::File.unlinkEthan J. Brown3-4/+4
- All previous File.unlink calls go through the new FileSystem::File abstraction so that the implementation can later be swapped for a Windows specific one to support symlinks
2013-11-08(#19447) Puppet::FileSystem::File.exist?Ethan J. Brown5-21/+21
- All previous File and FileTest calls to exist? or exists? go through the new FileSystem::File abstraction so that the implementation can later be swapped for a Windows specific one to support symlinks
2013-11-08(#19447) Puppet::FileSystem::File#stat / lstatEthan J. Brown1-1/+5
- All calls to File class stat / lstat go through the new FileSystem::File abstraction so that the implementation can later be swapped for a Windows specific one to support symlinks
2013-11-08(#19447) Puppet::FileSystem::File#readlinkEthan J. Brown1-2/+1
- All calls to File readlink go through the new FileSystem::File abstraction so that the implementation can later be swapped for a Windows specific one to support symlinks
2013-11-08(#19447) Puppet::FileSystem::File#symlink(?)Ethan J. Brown4-18/+35
- All calls to File / FileTest class methods symlink and symlink? go through instance methods on the new FileSystem::File abstraction so that the implementation can later be swapped for a Windows specific one to support symlinks
2013-09-26(#21069) refresh the cache of launchd plists on a missDustin J. Mitchell1-38/+71
2013-09-24Merge branch 'pull-1883'Adrien Thebo1-0/+20
This closes GH-1883
2013-09-24(#22458) Always store the path for launchd service providerThomas Bartelmess1-0/+20
Otherwise the path won't be found next time the provider is asked for it
2013-09-17(#22579) Add service provider for OpenBSD's rc.dJasper Lievisse Adriaanse1-0/+125
2013-06-13Merge branch 'stable'Patrick Carlisle1-1/+2
* stable: (maint) Fix Facter stubs in redhat service spec (#20383) Provide location of duplicate resource in error clean up docs for new parser functions
2013-06-10(maint) Fix Facter stubs in redhat service specPatrick Carlisle1-1/+2
The underlying OS was leaking into this test causing issues. This makes sure operatingsystem is stubbed, and also corrects the casing on stubbed osfamily values.
2013-05-29(Maint) Simplify search for init scriptsErik Dalén2-11/+11
2013-05-15(maint) stub out Puppet::Util.which for openrcAdrien Thebo1-0/+3
Puppet::Util is both mixed in to Puppet::Provider and is also invoked directly by Puppet::Util::CommandDefiner. We have to stub out the #which method on the Provider class and the Util module because we don't know how the method will be invoked.
2013-05-15Ensure that openrc service provider wipes RC_SVCNAME variableAdrien Thebo1-0/+13
2013-05-02Merge branch 'stable'Jeff McCune1-1/+1
* stable: (#14615) Exclude solaris from service name acceptance test Revert "Revert "Merge branch 'nicklewis-fix-puppet-resource-service-test' into stable""
2013-05-02Revert "Revert "Merge branch 'nicklewis-fix-puppet-resource-service-test' ↵Jeff McCune1-1/+1
into stable"" This reverts commit bbb1ee2418ff04dafa91534e1c3dad41c8c27bbd.
2013-05-01Merge branch 'stable'Jeff McCune1-1/+1
* stable: Revert "Merge branch 'nicklewis-fix-puppet-resource-service-test' into stable"
2013-04-30Revert "Merge branch 'nicklewis-fix-puppet-resource-service-test' into stable"Jeff McCune1-1/+1
This reverts commit f81c157f23ee637781c7bb1e384c7cb6395bcb27, reversing changes made to 38d085c697a530192b02c2badcc4e9a73813e62d. This change set is being reverted a second time because the acceptance test is failing on Solaris 10 which has very different service names. I'm reverting it because the failure represents work in progress that is interrupting other work, even though it is a small regexp. Based on discussion, we might simply need to open the regexp up to: [10:21 AM] Nick Lewis: @jmccune /.*ssh.*/ perhaps, but that's getting a little silly.
2013-04-29Merge branch 'stable'Jeff McCune1-1/+1
* stable: (maint) Handle different ssh service names in `puppet resource service` test Revert "Revert "Merge branch 'nicklewis-rcS-is-a-jerk' into stable"" closes #1620
2013-04-26Revert "Revert "Merge branch 'nicklewis-rcS-is-a-jerk' into stable""Nick Lewis1-1/+1
This reverts commit dd4d41e97fe21c9bd9f628fb4f982aead04cc213.
2013-04-26Merge branch 'stable'Jeff McCune1-1/+1
* stable: Revert "Merge branch 'nicklewis-rcS-is-a-jerk' into stable" (#20308) Try again to fix fileset tests on Windows (#20308) Fix fileset spec for Windows
2013-04-26Revert "Merge branch 'nicklewis-rcS-is-a-jerk' into stable"Jeff McCune1-1/+1
This reverts commit ea548f68bac581d1d0a2e2e95738d73f658b3896, reversing changes made to d6e6e9d51a92cba2e5dcace4b48949d1f77663b9. Reverting because the acceptance tests is failing :( https://jenkins.puppetlabs.com/view/Puppet%20FOSS/view/Master/job/Puppet%20Acceptance%20(master)/label=acceptance,platform=centos/767/console
2013-04-25Merge branch 'stable'Jeff McCune1-1/+1
* stable: (#14615) Don't run dangerous init scripts on Debian
2013-04-25(#14615) Don't run dangerous init scripts on DebianNick Lewis1-1/+1
The init service provider has an exclude list of init scripts which shouldn't be executed because they don't actually have a status subcommand. However, this list was missing a couple of scripts on Debian which also shouldn't be run: rcS and module-init-tools. This also adds an acceptance test verifying that `puppet resource service` doesn't change the state of the system. It does this by running it twice and making sure the output is the same. In certain cases, this may actually fail to identify a problem (if the init script which causes trouble runs first, for instance), so we also verify that a known service (ssh) is unaffected by running the command.
2013-04-25Merge branch 'stable'Adrien Thebo1-0/+10
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-04-16(#20121) Invoke chkconfig with --check on SuSECharlie Sharpsteen1-0/+7
On SuSE the `chkconfig` command needs to be passed the `--check` flag in order to get exit codes that indicate if a service is enabled or not. Previously, we were applying a regex to stderr but this was missing the case where the service did not exist. Ref: [#20121](https://projects.puppetlabs.com/issues/20121)