Skip to content

Commit 273e73c

Browse files
author
Michael Chmielewski
committed
Update test-kitchen provisioning so all tests run (and pass!) in containers for all supported platforms.
1 parent fa1dac8 commit 273e73c

File tree

2 files changed

+17
-9
lines changed

2 files changed

+17
-9
lines changed

.kitchen.yml

Lines changed: 16 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -19,8 +19,12 @@ provisioner:
1919
# to grab pillar data from environment variables
2020
threatstack.sls:
2121
deploy_key: <%= ENV['TS_DEPLOY_KEY'] != nil ? ENV['TS_DEPLOY_KEY'] : 'ts_deploy_key' %>
22+
<% if ENV['TS_PACKAGE_VERSION'] %>
2223
ts_agent_version: <%= ENV['TS_PACKAGE_VERSION'] %>
24+
<% end %>
25+
<% if ENV['TS_CONFIGURE_AGENT'] %>
2326
ts_configure_agent: <%= ENV['TS_CONFIGURE_AGENT'] %>
27+
<% end %>
2428
<% if ENV['TS_SETUP_ARGS'] %>
2529
ts_agent_extra_args: <%= ENV['TS_SETUP_ARGS'] %>
2630
<% end %>
@@ -78,18 +82,16 @@ platforms:
7882
provision_command:
7983
- yum install -y ruby ruby-devel git
8084
- yum install -y centos-release-scl-rh
81-
- yum install -y rh-ruby24
82-
# - source /opt/rh/rh-ruby24/enable
85+
- yum install -y rh-ruby26
86+
- mkdir -p /opt/chef/embedded/bin
87+
- ln -s "/opt/rh/rh-ruby26/root/usr/bin/gem" /opt/chef/embedded/bin/
88+
- ln -s "/opt/rh/rh-ruby26/root/usr/bin/ruby" /opt/chef/embedded/bin/
8389
- |
84-
printf "\n\
85-
\n\
86-
source /opt/rh/rh-ruby24/enable \n\
87-
export X_SCLS=\"`scl enable rh-ruby24 'echo $X_SCLS'`\"\n"\
88-
>> /etc/bashrc
90+
printf "LD_LIBRARY_PATH=/opt/rh/rh-ruby26/root/usr/local/lib64:/opt/rh/rh-ruby26/root/usr/lib64\n"\
91+
>> /etc/environment
8992
- yum install -y audit initscripts
9093
- sed -i 's/local_events = yes/local_events = no/g' /etc/audit/auditd.conf
9194
- systemctl enable auditd.service
92-
- scl enable rh-ruby24 bash
9395
- name: centos-8
9496
image: centos:8
9597
driver_config:
@@ -114,6 +116,12 @@ platforms:
114116
volume:
115117
- /sys/fs/cgroup:/sys/fs/cgroup
116118
provision_command:
119+
- |
120+
apt-get install -y checkinstall build-essential zlib1g-dev libssl-dev libreadline6-dev libyaml-dev wget && \
121+
wget https://cache.ruby-lang.org/pub/ruby/2.6/ruby-2.6.6.tar.gz && \
122+
tar xfz ruby-2.6.6.tar.gz && \
123+
echo "364b143def360bac1b74eb56ed60b1a0dca6439b00157ae11ff77d5cd2e92291 ruby-2.6.6.tar.gz" | sha256sum -c && \
124+
cd ruby-2.6.6 && ./configure && make && make install && rm ../ruby-2.6.6.tar.gz
117125
- sed -i 's/UsePAM yes/UsePAM no/g' /etc/ssh/sshd_config
118126
- systemctl enable ssh.service
119127
- name: debian-9

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,7 @@ Integration testing can be configured two different ways.
3737
This method requires the following:
3838
* Uncommenting the section for `threatstack.sls` in `.kitchen.yml`
3939
* Commenting out the `pillars_from_files` section in `.kitchen.yml`
40-
* Setting `TS_DEPLOY_KEY` in the environment to a valid key value for tests to succeed.
40+
* Setting `TS_DEPLOY_KEY`, `TS_CONFIGURE_AGENT`, `TS_PACKAGE_VERSION` in the environment to a valid key value for tests to succeed.
4141
```
4242
export TS_DEPLOY_KEY='<deploy_key>'
4343
bundle exec kitchen test

0 commit comments

Comments
 (0)