Skip to content

Commit

Permalink
Add more OS platforms for wazuh-chef Kitchen tests (#456)
Browse files Browse the repository at this point in the history
Add more OS platforms for wazuh-chef Kitchen tests.
  • Loading branch information
rshad authored Feb 10, 2020
1 parent a205741 commit abc3cee
Show file tree
Hide file tree
Showing 59 changed files with 2,895 additions and 448 deletions.
File renamed without changes.
33 changes: 33 additions & 0 deletions kitchen/kitchen-docker/.kitchen.windows.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
<% # Make sure the local copy of the driver is loaded %>
<% lib = File.expand_path('../lib', __FILE__) %>
<% $LOAD_PATH.unshift(lib) unless $LOAD_PATH.include?(lib) %>
---
driver:
name: docker
provision_command:
- powershell -ExecutionPolicy Bypass -NoLogo -Command . { iwr -useb https://omnitruck.chef.io/install.ps1 } ^| iex; install
- powershell -Command $path=$env:Path + ';c:\opscode\chef\embedded\bin'; Set-ItemProperty -Path 'HKLM:\SYSTEM\CurrentControlSet\Control\Session Manager\Environment\' -Name Path -Value $path

transport:
name: docker
socket: tcp://localhost:2375

provisioner:
name: dummy

platforms:
- name: windows
driver_config:
image: mcr.microsoft.com/windows/servercore:1803
platform: windows

suites:
- name: default
- name: context
driver:
build_context: false
- name: inspec
driver:
provision_command: echo 1
verifier:
name: inspec
68 changes: 68 additions & 0 deletions kitchen/kitchen-docker/.kitchen.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,68 @@
<% # Make sure the local copy of the driver is loaded %>
<% lib = File.expand_path('../lib', __FILE__) %>
<% $LOAD_PATH.unshift(lib) unless $LOAD_PATH.include?(lib) %>
---
driver:
name: docker
provision_command: curl -L https://www.chef.io/chef/install.sh | bash

transport:
name: docker

provisioner:
name: dummy

platforms:
- name: amazonlinux-2
- name: ubuntu-16.04
- name: ubuntu-18.04
- name: fedora-latest
driver:
provision_command:
- yum install libxcrypt-compat.x86_64 -y
- curl -L https://www.chef.io/chef/install.sh | bash
- name: centos-6
- name: centos-7
- name: oraclelinux-6
- name: oraclelinux-7
- name: debian-8
- name: debian-9
- name: opensuse-42.3
driver:
image: opensuse/leap:42.3
- name: opensuse/leap-42
# - name: arch
# driver:
# image: base/archlinux
# provision_command: true
- name: unknown
driver:
image: ubuntu:16.04
platform: ubuntu
- name: dockerfile
driver:
username: dockerfile
password: dockerfile
dockerfile: test/Dockerfile
run_command: /sbin/init

suites:
- name: default
excludes: [arch]
- name: context
excludes: [arch]
driver:
build_context: false
- name: capabilities
includes: [debian-8,debian-9,ubuntu-16.04,ubuntu-18.04]
driver:
provision_command:
- curl -L https://www.chef.io/chef/install.sh | bash
- apt-get install -y net-tools
cap_drop:
- NET_ADMIN
- name: inspec
driver:
provision_command: true
verifier:
name: inspec
4 changes: 4 additions & 0 deletions kitchen/kitchen-docker/.tailor
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
Tailor.config do |config|
config.formatters "text"
config.file_set 'lib/**/*.rb'
end
52 changes: 52 additions & 0 deletions kitchen/kitchen-docker/.travis.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,52 @@
matrix:
include:
- os: linux
rvm: 2.4.5
dist: xenial
language: ruby
cache: bundler
script:
- bundle exec docker version
- bundle exec kitchen --version
- bundle exec rake spec
- bundle exec kitchen test -d always
- os: linux
rvm: 2.5.4
dist: xenial
language: ruby
cache: bundler
script:
- bundle exec docker version
- bundle exec kitchen --version
- bundle exec rake spec
- bundle exec kitchen test -d always
- os: linux
rvm: 2.6.2
dist: xenial
language: ruby
cache: bundler
script:
- bundle exec docker version
- bundle exec kitchen --version
- bundle exec rake spec
- bundle exec kitchen test -d always
- os: windows
language: bash
install:
- choco install mingw
- choco install msys2
- ridk.cmd exec pacman -S --noconfirm --needed base-devel mingw-w64-x86_64-toolchain
script:
- taskkill -IM "gpg-agent.exe" -F
- powershell -ExecutionPolicy Bypass -NoLogo -File docker.ps1
- export KITCHEN_YAML=.kitchen.windows.yml
- ruby -v
- gem install bundler
- bundle install
- bundle exec docker version
- bundle exec kitchen --version
- bundle exec rake spec
- bundle exec kitchen test -d always

services:
- docker
104 changes: 104 additions & 0 deletions kitchen/kitchen-docker/CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,104 @@
# Kitchen-Docker Changelog

## 2.9.0 - Mar 15, 2019

* Add automatic OS detection for amazonlinux, opensuse/leap, and opensuse/tumbleweed
* On Fedora containers uses dnf to setup the OS not yum

## 2.8.0 - Jan 18, 2019

* Add new config option `use_internal_docker_network`, which allows running Docker within Docker. See readme for usage details.
* Resolve errors while loading libraries on archlinux
* Fix failures on Ubuntu 18.04
* Check if image exists before attempting to remove it so we don't fail
* Add oraclelinux platform support
* Prevent `uninitialized constant Kitchen::Driver::Docker::Base64` error by requiring `base64`

## 2.7.0

* Support for SUSE-based container images.
* Improved support for build context shipping.
* Changed `use_sudo` to default to `false` in keeping with modern Docker usage.

## 2.6.0

* Set container name with information from the run so you can identify them
later on.
* Upgrade to new driver base class structure.

## 2.5.0

* [#209](https://github.com/portertech/kitchen-docker/pulls/209) Fix usage with Kitchen rake tasks.
* Add `run_options` and `build_options` configuration.
* [#195](https://github.com/portertech/kitchen-docker/pulls/195) Fix Arch Linux support.
* Fix shell escaping for build paths and SSH keys.

## 2.4.0

* [#148](https://github.com/portertech/kitchen-docker/issues/148) Restored support for older versions of Ruby.
* [#149](https://github.com/portertech/kitchen-docker/pulls/149) Handle connecting to a container directly as root.
* [#154](https://github.com/portertech/kitchen-docker/pulls/154) Improve container caching by reordering the build steps.
* [#176](https://github.com/portertech/kitchen-docker/pulls/176) Expose proxy environment variables to the container automatically.
* [#192](https://github.com/portertech/kitchen-docker/pulls/192) Set `$container=docker` for CentOS images.
* [#196](https://github.com/portertech/kitchen-docker/pulls/196) Mutex SSH key generation for use with `kitchen -c`.
* [#192](https://github.com/portertech/kitchen-docker/pulls/192) Don't wait when stopping a container.

## 2.3.0

* `build_context` option (boolean) to enable/disable sending the build
context to Docker.

## 2.2.0

* Use a temporary file for each suite instance Docker container
Dockerfile, instead of passing their contents via STDIN. This allows for
the use of commands like ADD and COPY. **Users must now use Docker >= 1.5.0**

* Passwordless suite instance Docker container login (SSH), using a
generated key pair.

* Support for sharing a host device with suite instance Docker containers.

* README YAML highlighting.

## 2.1.0

* Use `NUL` instead of `/dev/null` on Windows for output redirection

## 2.0.0

* Use Docker `top` and `port` instead of `inspect`

* Don't create the kitchen user if it already exists

* Docker container capabilities options: cap_add, cap_drop

* Docker security profile option (SELinux/AppArmor): security_opt

* wait_for_sshd option (boolean)

* Create `/etc/sudoers.d` if missing

* Fixed option deprecation warnings, require Docker >= 1.2

## 1.7.0

* Ensure a container id is set before attempting to inspect a container

## 1.6.0

* `publish_all` option to publish all ports to the host interface

* `instance_name` option to name the Docker container

* `links` option to link suite instance Docker containers

* `socket` option will now default to ENV `DOCKER_HOST` if set

* Fixed verify dependencies output redirection

* Added `fedora` to platform names

* Support for `gentoo` and `gentoo-paludis` platforms

* Adding sudo rule to `/etc/sudoers.d/#{username}` in addition to `/etc/sudoers`
3 changes: 3 additions & 0 deletions kitchen/kitchen-docker/Gemfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
source 'https://rubygems.org'

gemspec
Loading

0 comments on commit abc3cee

Please sign in to comment.