HomePhorge

(PUP-3850) Stub methods when executing as root
b5f10cdfd2e7Unpublished

Unpublished Commit ยท Learn More

Repository Importing: This repository is still importing.

Description

(PUP-3850) Stub methods when executing as root

Previously, the inspect_spec test would fail when running as root,
because it would try to set the file mode to 0, assuming puppet
wouldn't be able to read it. But of course, that doesn't stop root.
This commit skips the test when running as root.

When running the master_spec test as root, it would attempt to chuser
to the puppet user and group, and would fail if those accounts didn't
exist. This commit stubs the call to chuser to ensure we don't
actually try to switch user.

When running the file_spec test, it attempted to stub
Puppet.features.root? assuming SUIDManager.root? would call it. But
that was backwards, the feature calls the SUIDManager. This commit
moves the stub onto the method that is actually called.

Details

Provenance
Josh Cooper <josh@puppetlabs.com>Authored on
vanmeeuwenPushed on Jun 2 2015, 2:22 PM
Parents
rPU733b3a5c7cc7: (PUP-3850) Only execute inner group on windows AND with elevated privileges
Branches
Unknown
Tags
Unknown

Event Timeline

Josh Cooper <josh@puppetlabs.com> committed rPUb5f10cdfd2e7: (PUP-3850) Stub methods when executing as root (authored by Josh Cooper <josh@puppetlabs.com>).Jan 16 2015, 7:45 AM