Sha256: 0d3e5eea3dd71eb039e0fa352f4e33737477a20851f11fad3ff7ee847247c0ae

Contents?: true

Size: 1.45 KB

Versions: 6

Compression:

Stored size: 1.45 KB

Contents

# Integration Testing with InSpec

## Introduction

Inspec uses Test Kitchen for its integration testing. Our current testing uses Docker as our backend. You should install and have Docker running befor you run any tests.

### How to run specific integrations

To run a specific integration test use the following:

```bash
bundle exec rake test:integration[OS_NAME]
```

Example:
```bash
bundle exec rake test:integration[default-ubuntu-1604]
```

# Inspec Integrations

### Test Kitchen

We run the test/integration/default profile at the end of each integration test in the verify stage. This confirms that our current code is compatible with test kitchen.

### Audit Testing

For Audit cookbook testing InSpec sets up some special hooks. The integration rake command will bundle up the current checkout into a gem which is passed along to test kitchen in the os_prepare cookbook. When this cookbook is ran it will install the local inspec gem. Audit will then use this gem accordingly when running in the post chef-client validators. The .kitchen.yml is setup to export the audit report to a json file which we look for and confirm the structure in the test/integration/default/controls/audit_spec.rb file.

In the validation file we confirm that the file was created from audit and that the structure looks correct. We also validate that the inspec ran with audit is the same that the current branch is using. This validates that audit did not use a older version for some reason.

Version data entries

6 entries across 6 versions & 2 rubygems

Version Path
inspec-core-2.3.10 docs/dev/integration-testing.md
inspec-2.3.10 docs/dev/integration-testing.md
inspec-core-2.3.5 docs/dev/integration-testing.md
inspec-2.3.5 docs/dev/integration-testing.md
inspec-core-2.3.4 docs/dev/integration-testing.md
inspec-2.3.4 docs/dev/integration-testing.md