Skip to content

Commit

Permalink
(SIMP-9718) Update nc timeout in tests (#90)
Browse files Browse the repository at this point in the history
* (SIMP-9718) Update nc timeout in tests

* For some reason, nc in EL8 now hangs so you have to pass a timeout
* Added an 'allowed to fail' docker test to gitlab

SIMP-9178 #close

* enable EPEL using the beaker_helpers function

* fix GHA

* add resources to nodesets for tests

* add haveged

* pull_request_target -> pull_request

We can't let PRs submitted by potentially untrusted forks from running any code (including Gemfiles and Rakefiles) inside the context of our org/repository.

* removed GHA beaker tests until they can be fully evaluated

Co-authored-by: op-ct <chris.tessmer@onyxpoint.com>
  • Loading branch information
trevor-vaughan and op-ct authored Jun 3, 2021
1 parent 37a0445 commit 603ae47
Show file tree
Hide file tree
Showing 7 changed files with 43 additions and 29 deletions.
2 changes: 1 addition & 1 deletion Gemfile
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ end
group :system_tests do
gem 'beaker'
gem 'beaker-rspec'
gem 'simp-beaker-helpers', ENV['SIMP_BEAKER_HELPERS_VERSION'] || ['>= 1.21.4', '< 2']
gem 'simp-beaker-helpers', ENV['SIMP_BEAKER_HELPERS_VERSION'] || ['>= 1.23.2', '< 2']
end

# Evaluate extra gemfiles if they exist
Expand Down
17 changes: 4 additions & 13 deletions spec/acceptance/nodesets/default.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,35 +6,26 @@
end
-%>
HOSTS:
el7:
el7.beaker.test:
roles:
- server-el7
- default
platform: el-7-x86_64
box: centos/7
hypervisor: <%= hypervisor %>
yum_repos:
epel:
mirrorlist: 'https://mirrors.fedoraproject.org/metalink?repo=epel-7&arch=$basearch'
gpgkeys:
- https://dl.fedoraproject.org/pub/epel/RPM-GPG-KEY-EPEL-$releasever

el8:
el8.beaker.test:
roles:
- server-el8
platform: el-8-x86_64
box: generic/centos8
hypervisor: <%= hypervisor %>
yum_repos:
epel:
mirrorlist: 'https://mirrors.fedoraproject.org/metalink?repo=epel-8&arch=$basearch'
gpgkeys:
- https://dl.fedoraproject.org/pub/epel/RPM-GPG-KEY-EPEL-$releasever

CONFIG:
log_level: verbose
type: aio
vagrant_memsize: 256
vagrant_cpus: 2
vagrant_memsize: 512
synced_folder: disabled
<% if ENV['BEAKER_PUPPET_ENVIRONMENT'] -%>
puppet_environment: <%= ENV['BEAKER_PUPPET_ENVIRONMENT'] %>
Expand Down
28 changes: 28 additions & 0 deletions spec/acceptance/nodesets/docker.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
HOSTS:
el7.test.net:
roles:
- server-el7
- default
platform: el-7-x86_64
hypervisor: docker
image: simpproject/simp_beaker_el7
docker_cmd: '["/sbin/init"]'

el8.test.net:
roles:
- server-el8
platform: el-8-x86_64
hypervisor: docker
image: simpproject/simp_beaker_el8
docker_cmd: '["/sbin/init"]'

CONFIG:
log_level: verbose
type: aio
<% if ENV['BEAKER_PUPPET_ENVIRONMENT'] -%>
puppet_environment: <%= ENV['BEAKER_PUPPET_ENVIRONMENT'] %>
<% end -%>
ssh:
password: root
auth_methods:
- password
17 changes: 4 additions & 13 deletions spec/acceptance/nodesets/oel.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,35 +6,26 @@
end
-%>
HOSTS:
oel7:
oel7.beaker.test:
roles:
- server-el7
- default
platform: el-7-x86_64
box: onyxpoint/oel-7-x86_64
hypervisor: <%= hypervisor %>
yum_repos:
epel:
mirrorlist: 'https://mirrors.fedoraproject.org/metalink?repo=epel-7&arch=$basearch'
gpgkeys:
- https://dl.fedoraproject.org/pub/epel/RPM-GPG-KEY-EPEL-$releasever

oel8:
oel8.beaker.test:
roles:
- server-el8
platform: el-8-x86_64
box: generic/oracle8
hypervisor: <%= hypervisor %>
yum_repos:
epel:
mirrorlist: 'https://mirrors.fedoraproject.org/metalink?repo=epel-8&arch=$basearch'
gpgkeys:
- https://dl.fedoraproject.org/pub/epel/RPM-GPG-KEY-EPEL-$releasever

CONFIG:
log_level: verbose
type: aio
vagrant_memsize: 256
vagrant_cpus: 2
vagrant_memsize: 512
synced_folder: disabled
<% if ENV['BEAKER_PUPPET_ENVIRONMENT'] -%>
puppet_environment: <%= ENV['BEAKER_PUPPET_ENVIRONMENT'] %>
Expand Down
1 change: 1 addition & 0 deletions spec/acceptance/suites/default/00_instances_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,7 @@
}
let(:hieradata) {{
'iptables::ports' => { 22 => { 'proto' => 'tcp', 'trusted_nets' => ['ALL'] } },
'simp_options::haveged' => true,
'simp_options::firewall' => true,
'simp_options::pki' => true,
'simp_options::pki::source' => '/etc/pki/simp-testing/pki/',
Expand Down
4 changes: 3 additions & 1 deletion spec/acceptance/suites/default/01_connection_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@

let(:hieradata) {{
'iptables::ports' => { 22 => { 'proto' => 'tcp', 'trusted_nets' => ['ALL'] } },
'simp_options::haveged' => true,
'simp_options::firewall' => true,
'simp_options::pki' => true,
'simp_options::pki::source' => '/etc/pki/simp-testing/pki/',
Expand Down Expand Up @@ -79,7 +80,8 @@
# does not test stunnel itself.
context 'with selinux on' do
it 'should apply with no errors' do
install_package(host, 'epel-release')
enable_epel_on(host)

set_hieradata_on(host,hieradata)
apply_manifest_on(host,base_manifest, catch_failures: true)
end
Expand Down
3 changes: 2 additions & 1 deletion spec/acceptance/suites/default/20_connectivity_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,7 @@
hieradata = {
'iptables::ports' => { 22 => { 'proto' => 'tcp', 'trusted_nets' => ['ALL'] } },
'iptables::precise_match' => true,
'simp_options::haveged' => true,
'simp_options::firewall' => true,
'simp_options::pki' => true,
'simp_options::pki::source' => '/etc/pki/simp-testing/pki/',
Expand Down Expand Up @@ -66,7 +67,7 @@
end

it "should send successfully from #{client}" do
on(client, %(/bin/echo "#{client.ip}" | nc localhost 1235))
on(client, %(/bin/echo "#{client.ip}" | nc -w1 localhost 1235))
end

it "should be received successfully on #{server}" do
Expand Down

0 comments on commit 603ae47

Please sign in to comment.