HomePhorge

(#12412) Refactor puppet_resource('user') tests
85fd6901cd80Unpublished

Unpublished Commit · Learn More

Repository Importing: This repository is still importing.

Description

(#12412) Refactor puppet_resource('user') tests

Previously the Linux-specific logic for validating
puppet_resource('user') was contained within each 'user' test case. In
order to support executing resource acceptance tests on non-Linux
agents, I could have added if-then-else statements to each test case,
though that would lead to logic-sprawl.

This commit refactors the existing set of 'user' acceptance tests to
use native commands to validate that the tests work on any supported
agent platform. Specifically, that puppet_resource('user') can create,
modify, delete, query, and query_all, and that it doesn't try to
delete a non-existent user, or add a user that already exists.

The goal of these tests is to validate that puppet_resource "works"
with user resources, and can therefore be trusted to validate the
results of subsequence acceptance tests.

The commit also preserves tests that exercise unique behaviors,
e.g. should_create_with_gid.

Details

Provenance
Josh Cooper <josh@puppetlabs.com>Authored on
vanmeeuwenPushed on Jun 2 2015, 2:22 PM
Parents
rPU5cc2cf7cb060: Merge branch 'ticket/2.7.x/12349-order_module_list_stderr_output' of https…
Branches
Unknown
Tags
Unknown

Event Timeline

Josh Cooper <josh@puppetlabs.com> committed rPU85fd6901cd80: (#12412) Refactor puppet_resource('user') tests (authored by Josh Cooper <josh@puppetlabs.com>).Feb 6 2012, 6:41 PM