Skip to content

Latest commit

 

History

History
68 lines (50 loc) · 1.89 KB

TESTING.md

File metadata and controls

68 lines (50 loc) · 1.89 KB

Style and integration testing

Any new functionality added to centos2.ol.sh should include an update to the test framework for that functionality.

Prerequisites

The following tools must be installed before running any tests:

The following command needs to be run once to ensure all the required RubyGems are installed into the vendor/bundle directory:

bundle install

Style tests

Run shellcheck and rubocop over the centos2.ol script and the test framework files, including Gemfile and Rakefile:

bundle exec rake style

Just check the centos2ol.sh shell script using shellcheck:

bundle exec rake style:shell

Just check the Ruby test framework using rubocop:

bundle exec rake style:ruby

Integration tests

Check that the centos2ol.sh script can successfully switch each major version of CentOS to Oracle Linux and that each parameter works as expected. This test uses Oracle VM VirtualBox, Vagrant and Kitchen and can take a long time to complete. It requires virtualization support on the host on which it runs.

bundle exec rake integration:vagrant:test

A successful run should finish with output similar to this:

Profile Summary: 1 successful control, 0 control failures, 0 controls skipped
Test Summary: 3 successful, 0 failures, 0 skipped
       Finished verifying <uek-centos-83> (0m1.97s).
       Finished testing <uek-centos-83> (6m3.67s).
-----> Destroying <uek-centos-83>...
       ==> default: Forcing shutdown of VM...
       ==> default: Destroying VM and associated drives...
       Vagrant instance <uek-centos-83> destroyed.
       Finished destroying <uek-centos-83> (0m4.61s).
-----> Test Kitchen is finished. (19m7.22s)