Shell mock automation tool
Switch branches/tags
Clone or download
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Permalink
Type Name Latest commit message Commit time
Failed to load latest commit information.
LICENSE.txt
README.md
shellmock.rb
shellmock.spec

README.md

ShellMock

This tool provides shellmock functionality mainly for ( but not limited to ) test kitchen scenario.

Kitchen uses it as wrapper around yum to setup mock dynamically as part of yum install invocation during puppet run.

Defining common mock

In shellmock.yaml add new entry in format of

package:
  /path/to/executable: contents

If you need no special functionality in mock then just leave contents empty

package:
  /path/to/executable:

It will set up a mock in form of I'm a fake /path/to/executable under /path/to/executable path. Mock will return 0 exit status.

The mock will keep original binary at /path/to/executable.real

Puppet type specific mocks

If you need to define a mock specific only to some type create yaml file with following name schema

${EC2DATA_TYPE}.yaml

For example to mock varnishadm exclusively for webfrontend type you can create webfrontend.yaml file and put there

varnish:
  /usr/bin/varnishadm:

Core mocks

In some special cases the bootstrap puppet manifests rely on the things included into the OS image, thus no yum install happens for such packages. This situation was workarounded by creating special type of core mocks and setting them duringyum clean all` which happens at the very beginning of puppet run.

The core_mocks array controlled via core_mocks.yaml which consists of simple sequence of package list.

The core_mocks are not intended to modify frequently, but in some special cases it is required thing to perform.

Keep in mind that core mocks will be set up only during first converge as yum clean is not getting invoked on subsequent converge run.

In other words if you need to introduce new core_mock - test it with recreation of instance - kitchen destroy, kitchen coverge.

Maintenance level

This project is in the maintenance mode.

The patches are going to be provided by engineers at GoodData Inc. in reactive manner.