This project contains acceptance tests for servers in TechEd PE Labs.
This project requires Puppet Bolt in order to run, and PDK for development.
Execution requires a Ruby installation, which the bolt plan pe_lab_tests::run_server_spec
will create for you on the target node.
SSH access to servers is required to be configured beforehand, including SSH keys.
This project includes a Bolt plan that automates the setup and execution of server specs on remote targets.
Run a server spec on target servers:
# Run a specific spec file on all targets in your inventory
bolt plan run pe_lab_tests::run_server_spec spec_file=puppet_server_spec.rb --targets linux_servers
# Run with a specific Ruby version
bolt plan run pe_lab_tests::run_server_spec \
spec_file=puppet_server_spec.rb \
ruby_version=3.1.4 \
--targets rocky8-server
# Run as a specific user
bolt plan run pe_lab_tests::run_server_spec \
spec_file=puppet_server_spec.rb \
user=puppet \
--targets production_servers
Parameter | Type | Default | Description |
---|---|---|---|
spec_file |
String | required | Name of the spec file to run (e.g., 'puppet_server_spec.rb') |
ruby_version |
String | 3.2.5 |
Ruby version to install using rbenv |
user |
String | sysadmin |
User account to own the project files |
- Installs Ruby - Uses rbenv to install the specified Ruby version
- Copies Project - Uploads the entire project to the target server
- Installs Dependencies - Runs
bundle install
to install required gems - Runs Specs - Executes the specified spec file using RSpec
- Reports Results - Shows test output and exit status
In the special case that you are running the dev environment tests from the dev environment itself, this project will delete itself. To get around this problem, just clone to a directory other than the home directory.
All specs run by this project are in spec/localhost
. This is to separate serverspec tests from unit tests run with pdk test unit
.