In order to be able to use the tests, you need to have some software packages installed. You may need sudo privileges for some of these operations.
There are two ways to accomplish this.
### Option 1: use `molecule-skel` (SLUB staff only)
1. Clone the project at [molecule-skel](https://git.slub-dresden.de/slub-referat-2-3/molecule-skel): `git clone https://git.slub-dresden.de/slub-referat-2-3/molecule-skel.git`
2. Switch to the `molecule-skel` repository directory and run `./install_testenv.sh`.
3. PROFIT!
Check the `README.md` over at [molecule-skel](https://git.slub-dresden.de/slub-referat-2-3/molecule-skel) for details on how to use that. It's easy, I promise.
### Option 2: manual installation
Run these steps on your terminal.
```bash
### install VirtualBox
# do NOT use distribution packages, as they may be too old!
# process documented at https://www.virtualbox.org/wiki/Linux_Downloads
If you need any help with the options, please use:
```bash
molecule init role --help
```
## Running Tests
Molecule helps with creating a test infrastructure, running tests against it and removing the test infrastructure afterwards.
Various test environments are separated into so-called "scenarios" that can be based on different OSses, drivers, verifiers or might just differ in a minor detail.
In the simplest configuration, the `molecule/` directory only contains one `default/` directory that contains the default scenario. This scenario is run if no other scenario is chosen using the `-s` CLI option.
This is the basic usage of Molecule:
```bash
# create test infrastructure
cd <role_directory>
molecule create
# run playbooks against test infrastructure
molecule converge
# run idempotence tests
molecule idempotence
# run tests, if they exist
molecule verify
# remove test infrastructure
molecule destroy
# run all steps at once:
molecule test
```
It has proven helpful to use Vagrant to create a snapshot of the VM after the creation phase has completed. Just like this: