{"id":22700249,"url":"https://github.com/simp/rubygem-simp-beaker-helpers","last_synced_at":"2025-08-07T08:32:07.306Z","repository":{"id":37559068,"uuid":"41893769","full_name":"simp/rubygem-simp-beaker-helpers","owner":"simp","description":"A collection of methods to help Beaker scaffold SIMP acceptance tests","archived":false,"fork":false,"pushed_at":"2023-11-29T16:07:35.000Z","size":592,"stargazers_count":4,"open_issues_count":2,"forks_count":20,"subscribers_count":18,"default_branch":"master","last_synced_at":"2024-05-09T15:13:03.469Z","etag":null,"topics":["beaker","simp"],"latest_commit_sha":null,"homepage":"","language":"Ruby","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"other","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/simp.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2015-09-04T02:18:44.000Z","updated_at":"2024-06-06T18:32:35.707Z","dependencies_parsed_at":"2024-06-06T18:32:28.738Z","dependency_job_id":"f93835da-c4c9-41bf-90aa-e1e976558813","html_url":"https://github.com/simp/rubygem-simp-beaker-helpers","commit_stats":null,"previous_names":[],"tags_count":93,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/simp%2Frubygem-simp-beaker-helpers","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/simp%2Frubygem-simp-beaker-helpers/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/simp%2Frubygem-simp-beaker-helpers/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/simp%2Frubygem-simp-beaker-helpers/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/simp","download_url":"https://codeload.github.com/simp/rubygem-simp-beaker-helpers/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":229013251,"owners_count":18006191,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["beaker","simp"],"created_at":"2024-12-10T06:10:41.125Z","updated_at":"2024-12-10T06:10:41.776Z","avatar_url":"https://github.com/simp.png","language":"Ruby","funding_links":[],"categories":[],"sub_categories":[],"readme":"# simp-beaker-helpers\n\nMethods to assist beaker acceptance tests for SIMP.\n\n#### Table of Contents\n\n\u003c!-- vim-markdown-toc GFM --\u003e\n\n* [Overview](#overview)\n* [Setup](#setup)\n  * [Beginning with simp-beaker-helpers](#beginning-with-simp-beaker-helpers)\n* [Rake Tasks](#rake-tasks)\n  * [`rake beaker:suites`](#rake-beakersuites)\n  * [Suite Execution](#suite-execution)\n    * [Environment Variables](#environment-variables)\n      * [Beaker Management](#beaker-management)\n      * [Beaker Helpers Adjustments](#beaker-helpers-adjustments)\n    * [Global Suite Configuration](#global-suite-configuration)\n      * [Supported Config:](#supported-config)\n    * [Individual Suite Configuration](#individual-suite-configuration)\n      * [Supported Config:](#supported-config-1)\n* [Nodeset Enhancements](#nodeset-enhancements)\n  * [YUM Repo Support](#yum-repo-support)\n* [Methods](#methods)\n    * [`copy_to`](#copy_to)\n    * [`copy_fixture_modules_to`](#copy_fixture_modules_to)\n    * [`fix_errata_on`](#fix_errata_on)\n    * [`run_fake_pki_ca_on`](#run_fake_pki_ca_on)\n    * [`copy_pki_to`](#copy_pki_to)\n    * [`copy_keydist_to`](#copy_keydist_to)\n    * [`pfact_on`](#pfact_on)\n    * [`pluginsync_on`](#pluginsync_on)\n    * [`write_hieradata_to`](#write_hieradata_to)\n    * [`set_hieradata_on`](#set_hieradata_on)\n    * [`clear_temp_hieradata`](#clear_temp_hieradata)\n    * [`latest_puppet_agent_version_for(puppet_version)`](#latest_puppet_agent_version_forpuppet_version)\n    * [`install_puppet`](#install_puppet)\n* [Environment variables](#environment-variables-1)\n    * [`BEAKER_fips`](#beaker_fips)\n    * [`BEAKER_fips_module_version`](#beaker_fips_module_version)\n    * [`BEAKER_spec_prep`](#beaker_spec_prep)\n    * [`BEAKER_SIMP_parallel`](#beaker_simp_parallel)\n    * [`BEAKER_stringify_facts`](#beaker_stringify_facts)\n    * [`BEAKER_use_fixtures_dir_for_modules`](#beaker_use_fixtures_dir_for_modules)\n    * [`BEAKER_no_fix_interfaces`](#beaker_no_fix_interfaces)\n    * [PUPPET_VERSION](#puppet_version)\n    * [BEAKER_RHSM_USER](#beaker_rhsm_user)\n    * [BEAKER_RHSM_PASS](#beaker_rhsm_pass)\n    * [BEAKER_inspec_version](#beaker_inspec_version)\n    * [BEAKER_RHSM_UNSUBSCRIBE](#beaker_rhsm_unsubscribe)\n* [Examples](#examples)\n  * [Prep OS, Generate and copy PKI certs to each SUT](#prep-os-generate-and-copy-pki-certs-to-each-sut)\n  * [Specify the version of Puppet to run in the SUTs](#specify-the-version-of-puppet-to-run-in-the-suts)\n* [Experimental Features](#experimental-features)\n  * [Snapshot Support](#snapshot-support)\n    * [Running Tests with Snapshots](#running-tests-with-snapshots)\n    * [Adding Snapshots to your Tests](#adding-snapshots-to-your-tests)\n      * [Taking a Snapshot](#taking-a-snapshot)\n      * [Base Snapshots](#base-snapshots)\n      * [Restoring a Snapshot](#restoring-a-snapshot)\n      * [Listing Snapshots](#listing-snapshots)\n* [License](#license)\n\n\u003c!-- vim-markdown-toc --\u003e\n\n## Overview\n\n## Setup\n\n### Beginning with simp-beaker-helpers\n\nAdd this to your project's `Gemfile`:\n\n```ruby\ngem 'simp-beaker-helpers'\n```\n\nAdd this to your project's `spec/spec_helper_acceptance.rb`:\n```ruby\nrequire 'simp/beaker_helpers'\ninclude Simp::BeakerHelpers\n```\n\n## Rake Tasks\n\nNew `rake` tasks are available to help you use `beaker` more effectively.\n\nThese can be included in your `Rakefile` by adding the following:\n\n```\nrequire 'simp/rake/beaker'\nSimp::Rake::Beaker.new(File.dirname(__FILE__))\n```\n\n### `rake beaker:suites`\n\nThe 'beaker:suites' rake task provides the ability to run isolated test sets\nwith a full reset of the Beaker environment.\n\nThese are entirely isolated runs of Beaker and have been designed to be used\nfor situations where you need to eliminate all of the cruft from your previous\nruns to perform a new type of test.\n\n### Suite Execution\n\nBy default the only suite that will be executed is `default`.  Since each suite\nis executed in a new environment, spin up can take a lot of time. Therefore,\nthe default is to only run the default suite.\n\nIf there is a suite where the metadata contains `default_run` set to the\nBoolean `true`, then that suite will be part of the default suite execution.\n\nYou can run all suites by setting the passed suite name to `ALL` (case\nsensitive).\n\n#### Environment Variables\n\n##### Beaker Management\n\n* BEAKER_suite_runall [yes|no]\n  * Run all Suites\n\n* BEAKER_suite_basedir [String]\n  * The base directory where suites will be defined\n  * Default: `spec/acceptance`\n\n##### Beaker Helpers Adjustments\n\n* BEAKER_SIMP_parallel [yes|no]\n  * `yes` =\u003e Run simp-beaker-helpers methods on SUTs in parallel if possible\n  * `no` =\u003e Do not run methods in parallel\n\n* BEAKER_docker_cmd [String]\n  * The specific command to use for performing `docker` operations\n\n* BEAKER_helpers_verbose [yes|no]\n  * `yes` =\u003e Enable verbose output\n  * `no` =\u003e Do not enable verbose output\n\n* BEAKER_copy_fixtures [yes|no]\n  * `yes` =\u003e Enable copying fixtures to the SUT\n  * `no` =\u003e Disable copying fixtures to the SUT\n\n* BEAKER_use_fixtures_dir_for_modules [yes|no]\n  * `yes` =\u003e Pull fixtures directly from `spec/fixtures/modules`\n  * `no` =\u003e Ignore `spec/fixtures/modules` content\n\n* BEAKER_stringify_facts [yes|no]\n  * `yes` =\u003e Enable fact stringification\n\n* BEAKER_fips_module_version [String]\n  * The specific version of the FIPS module to install from the puppet forge\n\n* BEAKER_RHSM_USER [String]\n  * The username for using with RHSM\n\n* BEAKER_RHSM_PASS [String]\n  * The password for using with RHSM\n\n* BEAKER_fips [yes|no]\n  * `yes` =\u003e Enable FIPS on the SUT\n  * `no` =\u003e Do not manage FIPS on the SUT (will not disable if enabled)\n\n* BEAKER_no_fix_interfaces [Boolean]\n  * If present, will not try to fix the interfaces on the SUT\n\n* BEAKER_SIMP_install_repos [yes|no]\n  * `yes` =\u003e Install the SIMP YUM repositories\n  * `no` =\u003e No not install the SIMP YUM repositories\n\n* BEAKER_SIMP_disable_repos [String]\n  * Comma delimited list of YUM repositories to disable on the SUT\n\n* BEAKER_SIMP_repo_release [String]\n  * The release of SIMP to target in the YUM repos (usually a number)\n\n* BEAKER_SIMP_repo_release_type [String]\n  * The release type of SIMP to target in the YUM repos\n    * Something like `stable`, `rolling`, or `unstable`\n\n#### Global Suite Configuration\n\nA file `config.yml` can be placed in the `suites` directory to control certain\naspects of the suite run.\n\n##### Supported Config:\n\n```yaml\n---\n# Fail the entire suite at the first failure\n'fail_fast' : \u003ctrue|false\u003e =\u003e Default: true\n```\n\n#### Individual Suite Configuration\n\nEach suite may contain a YAML file, metadata.yml, which will be used to provide\ninformation to the suite of tests.\n\n##### Supported Config:\n\n```yaml\n---\n'name' : '\u003cUser friendly name for the suite\u003e'\n\n# Run this suite by default\n'default_run' : \u003ctrue|false\u003e =\u003e Default: false\n```\n\n## Nodeset Enhancements\n\n### YUM Repo Support\n\nNodes in your nodesets will create YUM repository entries according to the\nfollowing Hash:\n\n```yaml\n---\nyum_repos:\n   \u003crepo_name\u003e:\n     \u003cyum_resource_parameter\u003e: \u003cvalue\u003e\n```\n\nThe `baseurl` and `gpgkey` parameters can also take an Array if you need to\npoint at more than one location.\n\nThis would look like the following:\n\n```yaml\n---\nyum_repos:\n   \u003crepo_name\u003e:\n     baseurl:\n       - http://some.random.host\n       - https://some.other.random.host\n     gpgkey:\n       - https://my.gpg.host\n       - https://my.other.gpg.host\n```\n\n## Methods\n\n#### `copy_to`\n\nAbstracts copying files and directories in the most efficient manner possible.\n\n* If your system is a ``docker`` container it uses ``docker cp``\n* If your system is anything else:\n  * Attempts to use ``rsync`` if it is present on both sides\n  * Falls back to ``scp``\n\nAll copy semantics are consistent with what you would expect from ``scp_to``\n\n#### `copy_fixture_modules_to`\n\nCopies the local fixture modules (under `spec/fixtures/modules`) onto a list of\nSUTs.\n\n```ruby\ncopy_fixture_modules_to( suts = hosts, opts = {} )\n```\n  - **`suts`**   = _(Array,String)_ list of SUTs to copy modules to\n  - **`opts`**   = _(Hash)_ Options passed on to `copy_module_to()` for each SUT\n\nBy default, this will copy modules to the first path listed in each SUT's\n`modulepath` and simulate a pluginsync so the Beaker DSL's `facter_on` will\nstill work.\n\nIf you need to use a non-default module path:\n```ruby\n# WARNING: this will use the same :target_module_dir for each SUT\ncopy_fixture_modules_to( hosts, {\n   :target_module_dir =\u003e '/path/to/my/modules',\n})\n```\n\nIf you want to disable pluginsync:\n```ruby\n# WARNING: `fact_on` will not see custom facts\ncopy_fixture_modules_to( hosts, {\n   :pluginsync =\u003e false\n})\n```\n\n#### `fix_errata_on`\n\nApply any OS fixes we need on each SUT\n`fix_errata_on( suts = hosts )`\n\n\n#### `run_fake_pki_ca_on`\n\nGenerate a fake openssl CA + certs for each host on a given SUT and copy the\nfiles back to a local directory.\n\n**NOTE:** this needs to generate everything inside an SUT.  It is assumed the\nSUT will have the appropriate openssl in its environment.\n\n`run_fake_pki_ca_on( ca_sut = master, suts = hosts, local_dir = '' )`\n\n - **`ca_sut`**    = the SUT to generate the CA \u0026 certs on\n - **`suts`**      = list of SUTs to generate certs for\n - **`local_dir`** = local path where the CA+cert directory tree should copied back to\n\n#### `copy_pki_to`\n\nCopy a single SUT's PKI certs (with cacerts) onto the SUT.  This simulates the result of `pki::copy` without requiring a full master and `simp-pki` module.\n\nThe directory structure copied to the SUT is:\n```\n  SUT_BASE_DIR/\n              pki/\n                  cacerts/cacerts.pem\n                  public/fdqn.pub\n                  private/fdqn.pem\n\n```\n\n`copy_pki_to(sut, local_pki_dir, sut_base_dir = '/etc/pki/simp-testing')`\n\n\n#### `copy_keydist_to`\n\nCopy a CA keydist/ directory of CA+host certs into an SUT.\n\nThis simulates the output of FakeCA's `gencerts_nopass.sh` into `keydist/` and is useful for constructing a Puppet master SUT that will distribute PKI keys via agent runs.\n\n`copy_keydist_to( ca_sut = master )`\n\n\n#### `pfact_on`\n\nLook up a fact on a given SUT using the `puppet fact` face.  This honors whatever facter-related settings the SUT's Puppet installation has been configured to use (i.e., `factpath`, `stringify_facts`, etc).\n\n`pfact_on( sut, fact_name )`\n\n\n#### `pluginsync_on`\n\nSimulates a `pluginsync` (useful for deploying custom facts) on given SUTs.\n\n`pluginsync_on( suts = hosts )`\n\n#### `write_hieradata_to`\n\nWrites a YAML file in the Hiera :datadir of a Beaker::Host.\n\n**NOTE**: This is useless unless Hiera is configured to use the data file.\n`Beaker::DSL::Helpers::Hiera#write_hiera_config_on` from [beaker-hiera](https://github.com/puppetlabs/beaker-hiera) may be used to configure Hiera.\n\n`write_hieradata_to(host, hieradata, terminus = 'default')`\n\n - **`host`**      = _(Array,String,Symbol)_ One or more hosts to act upon\n - **`hieradata`** = _(Hash)_ The full hiera data structure to write to the system\n - **`terminus`**  = _(String)_ The file basename minus the file extension in which to write the Hiera data\n\n#### `set_hieradata_on`\n\nWrites a YAML file in the Hiera :datdir of a Beaker::Host, then configures the host to use that file exclusively.\n\n**NOTE**: This is authoritative; you cannot mix this with other Hiera data sources.\n\n`set_hieradata_on(host, hieradata, terminus = 'default')`\n\n - **`host`**      = _(Array,String,Symbol)_ One or more hosts to act upon\n - **`hieradata`** = _(Hash)_ The full hiera data structure to write to the system\n - **`terminus`**  = _(String)_ The file basename minus the file extension in which to write the Hiera data\n\n####  `clear_temp_hieradata`\n\nClean up all temporary hiera data files; meant to be called from `after(:all)`\n\n`clear_temp_hieradata`\n\n#### `latest_puppet_agent_version_for(puppet_version)`\n\nFinds the latest `puppet-agent` version based on the passed gem version and can\naccept the usual Gem comparison syntax (e.g., '4.0', '=4.2', '~\u003e 4.3.1', '5')\n\nReturns the `puppet-agent` package version or `nil` if not found.\n\n#### `install_puppet`\n\nPerforms an assessment of all set parameters and installs the correct\n`puppet-agent` based on those parameters based on the following logic.\n\nIf the environment variable `BEAKER_PUPPET_AGENT_VERSION` or\n`PUPPET_INSTALL_VERSION` or `PUPPET_VERSION` is set, it will use that value\nto determine the `puppet-agent` version to install.\n\nIf it is unable to determine the `puppet-agent` version from any `*VERSION`\nenvironment variables and the environment variable `BEAKER_PUPPET_COLLECTION`\nis set, it will use this to determine which puppet collection to install from.\n(Presently, this only works with Puppet 5.x and is set as `puppet5`.)\n\nIf it cannot determinte the `puppet-agent` version from any environment\nvariables, it will default the version to the value of\nSimp::BeakerHelpers::DEFAULT_PUPPET_AGENT_VERSION, which is currently '1.10.4'.\n\n## Environment variables\n\n#### `BEAKER_fips`\n\n_(Default: `no`)_ When set to `yes`, Beaker will enable [FIPS mode](https://access.redhat.com/documentation/en-US/Red_Hat_Enterprise_Linux/6/html/Security_Guide/sect-Security_Guide-Federal_Standards_And_Regulations-Federal_Information_Processing_Standard.html) on all SUTs before running tests.\n\n**NOTE:** FIPS mode is only enabled on RedHat family hosts.\n\n#### `BEAKER_fips_module_version`\n\n_(Default: unset)_ Set to a version of the simp-fips Puppet module released\nto Puppet Forge, when you want to specify the version of that module used to\nimplement enable FIPS. When unset, the latest version is used.\n\n**NOTE:** This has no effect if the `simp-fips` module is already included in your fixtures.yml\n\n#### `BEAKER_spec_prep`\n\n_(Default: `yes`)_  Ensures that each fixture module is present under\n`spec/fixtures/modules`.  If any fixture modules are missing, it will run `rake\nspec_prep` to populate the missing modules using `.fixtures.yml`.  Note that\nthis will _not_ update modules that are already present under\n`spec/fixtures/modules`.\n\n#### `BEAKER_SIMP_parallel`\n\n_(Default: `no`)_  Execute each SIMP host setup method such as\n`Simp::BeakerHelpers::copy_fixure_modules_to` and `Simp::BeakerHelpers::fix_errata_on`\non all hosts in a node set in parallel. Uses parallelization provided by Beaker.\n\n**NOTE:** Beaker's parallelization capability does not always work, so a word\nto the wise is sufficient.\n\n#### `BEAKER_stringify_facts`\n#### `BEAKER_use_fixtures_dir_for_modules`\n\n#### `BEAKER_no_fix_interfaces`\n\nSet to skip code that makes sure all interfaces are up\n\n#### PUPPET_VERSION\n\nThe `PUPPET_VERSION` environment variable will install the latest\n`puppet-agent` package that provides that version of Puppet.  This honors\n`Gemfile`-style expressions like `\"~\u003e 4.8.0\"`\n\n`BEAKER_PUPPET_AGENT_VERSION` and `PUPPET_INSTALL_VERSION` are synonyms of\n`PUPPET_VERSION`.\n\n#### BEAKER_RHSM_USER\n\nThe username to use with Red Hat Subscription Manager when dealing with a RHEL host.\n\nWill not be output to the screen.\n\n#### BEAKER_RHSM_PASS\n\nThe password to use with Red Hat Subscription Manager when dealing with a RHEL host.\n\nWill not be output to the screen.\n\nNote:  When using Subscription Manager, make sure your nodeset has the setting validation: false.   Otherwise Beaker:Rspec\nmight try to install packages before subscription manager is configured.\n\n#### BEAKER_inspec_version\n\nThe version of InSpec to use when running inspec tests. Currently hard-coded to\n`4.16.14` due to a bug introduced in `4.16.15`.\n\nSet to 'latest' to use the latest available in the upstream repos.\n\n#### BEAKER_RHSM_UNSUBSCRIBE\n\nBy default the system is unsubscribed from RHSM.\n\nSet to 'False' to disable this behavior.\n\n## Examples\n\n### Prep OS, Generate and copy PKI certs to each SUT\nThis pattern serves to prepare component modules that use PKI\n\n```ruby\n# spec/spec_acceptance_helpers.rb\nrequire 'beaker-rspec'\nrequire 'tmpdir'\nrequire 'simp/beaker_helpers'\ninclude Simp::BeakerHelpers\n\nunless ENV['BEAKER_provision'] == 'no'\n  hosts.each do |host|\n    # Install Puppet\n    if host.is_pe?\n      install_pe\n    else\n      install_puppet\n    end\n  end\nend\n\n\nRSpec.configure do |c|\n  # ensure that environment OS is ready on each host\n  fix_errata_on hosts\n\n  # Readable test descriptions\n  c.formatter = :documentation\n\n  # Configure all nodes in nodeset\n  c.before :suite do\n    begin\n      # Install modules and dependencies from spec/fixtures/modules\n      copy_fixture_modules_to( hosts )\n      Dir.mktmpdir do |cert_dir|\n        run_fake_pki_ca_on( default, hosts, cert_dir )\n        hosts.each{ |host| copy_pki_to( host, cert_dir, '/etc/pki/simp-testing' )}\n      end\n    rescue StandardError, ScriptError =\u003e e\n      require 'pry'; binding.pry if ENV['PRY']\n    end\n  end\nend\n```\n\n### Specify the version of Puppet to run in the SUTs\n\n```bash\n# puppet-agent 1.8.3 will be installed in VMs\nPUPPET_VERSION=\"~\u003e 4.8.0\" bundle exec rake beaker:suites\n\n# puppet-agent 1.9.2 will be installed in VMs\nPUPPET_INSTALL_VERSION=1.9.2 bundle exec rake beaker:suites\n\n# The latest puppet 5 will be installed in VMs\nPUPPET_VERSION=\"5\" bundle exec rake beaker:suites\n\n# puppet-agent 1.10.4 will be installed in VMs\nbundle exec rake beaker:suites\n```\n\n## Experimental Features\n\n### Snapshot Support\n\nRudimentary support for snapshotting VMs has been added. This currently only\nworks for local `vagrant` systems and relies on the underlying `vagrant\nsnapshot` command working for the underlying hypervisor. VirtualBox is highly\nrecommended and `libvirt` is known to not work due to limitiations in\n`vagrant`.\n\nThis was added to attempt to be able to restart tests from given checkpoints\nthat encompass extremely long running test segments. This is particularly\nrelevant when you are trying to set up a large support infrastructure but need\nto debug later stages of your tests over time.\n\n#### Running Tests with Snapshots\n\nTo enable snapshots during your initial test runs, run your test as follows:\n\n```bash\nBEAKER_destroy=no BEAKER_simp_snapshot=yes rake beaker:suites\n```\n\nThen, on subsequent runs, run your test as follows:\n\n```bash\nBEAKER_provision=no BEAKER_destroy=no BEAKER_simp_snapshot=yes rake beaker:suites\n```\n#### Adding Snapshots to your Tests\n\nThe following demonstrates the general idea behind using snapshots. Note, the\ndecision to directly call the module methods was made to ensure that people\nknew explicitly when this capability was being called since it affects the\nunderlying OS configuration.\n\n##### Taking a Snapshot\n\n`Simp::BeakerHelpers::Snapshot.save(sut, '\u003cname of snapshot\u003e')` will save a\nsnapshot with the given name. If the snapshot already exists, it will be\nforcibly overwritten.\n\n\n##### Base Snapshots\n\nAny time a snapshot is saved, if an initial base snapshot doesn't exist, one\nwill be created. You can restore back to the base snapshot using\n`Simp::BeakerHelpers::Snapshot.restore_to_base(sut)`.\n\nThese are specifically created to ensure that we don't run into issues with\ntrying to remove the parent of all snapshots since some hypervisors do not\nallow this.\n\n##### Restoring a Snapshot\n\n`Simp::BeakerHelpers::Snapshot.restore(sut, '\u003cname of snapshot\u003e)` will restore\nto the named snapshot.\n\nAttempting to restore to a snapshot that doesn't exist is an error.\n\n##### Listing Snapshots\n\n`Simp::BeakerHelpers::Snapshot.list(sut)` will return an Array of all snapshot\nnames for that system.\n\n`Simp::BeakerHelpers::Snapshot.exist?(sut, '\u003cname of snapshot\u003e')` will return a\nBoolean based on whether or not the snapshot with the given name is present on\nthe system.\n\n## License\nSee [LICENSE](LICENSE)\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fsimp%2Frubygem-simp-beaker-helpers","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fsimp%2Frubygem-simp-beaker-helpers","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fsimp%2Frubygem-simp-beaker-helpers/lists"}