Page Menu
Home
Software Heritage
Search
Configure Global Search
Log In
Files
F9125267
spec_helper_acceptance.rb
No One
Temporary
Actions
Download File
Edit File
Delete File
View Transforms
Subscribe
Mute Notifications
Award Token
Flag For Later
Size
2 KB
Subscribers
None
spec_helper_acceptance.rb
View Options
require
'beaker-rspec/spec_helper'
require
'beaker-rspec/helpers/serverspec'
require
'beaker/puppet_install_helper'
require
'rspec/retry'
begin
require
'pry'
rescue
LoadError
# rubocop:disable Lint/HandleExceptions for optional loading
end
run_puppet_install_helper
unless
ENV
[
'BEAKER_provision'
]
==
'no'
RSpec
.
configure
do
|
c
|
# Project root
proj_root
=
File
.
expand_path
(
File
.
join
(
File
.
dirname
(
__FILE__
),
'..'
))
# Readable test descriptions
c
.
formatter
=
:documentation
# show retry status in spec process
c
.
verbose_retry
=
true
# show exception that triggers a retry if verbose_retry is set to true
c
.
display_try_failure_messages
=
true
# Configure all nodes in nodeset
c
.
before
:suite
do
# Install module and dependencies
hosts
.
each
do
|
host
|
copy_module_to
(
host
,
:source
=>
proj_root
,
:module_name
=>
'docker'
)
# Due to RE-6764, running yum update renders the machine unable to install
# other software. Thus this workaround.
if
fact_on
(
host
,
'operatingsystem'
)
==
'RedHat'
on
(
host
,
'mv /etc/yum.repos.d/redhat.repo /etc/yum.repos.d/internal-mirror.repo'
)
end
on
(
host
,
'yum update -y -q'
)
if
fact_on
(
host
,
'osfamily'
)
==
'RedHat'
on
host
,
puppet
(
'module'
,
'install'
,
'puppetlabs-stdlib'
,
'--version'
,
'4.24.0'
),
{
:acceptable_exit_codes
=>
[
0
,
1
]
}
on
host
,
puppet
(
'module'
,
'install'
,
'puppetlabs-apt'
,
'--version'
,
'4.4.1'
),
{
:acceptable_exit_codes
=>
[
0
,
1
]
}
on
host
,
puppet
(
'module'
,
'install'
,
'puppetlabs-translate'
,
'--version'
,
'1.0.0'
),
{
:acceptable_exit_codes
=>
[
0
,
1
]
}
# net-tools required for netstat utility being used by some tests
if
fact_on
(
host
,
'osfamily'
)
==
'RedHat'
&&
fact_on
(
host
,
'operatingsystemmajrelease'
)
==
'7'
on
(
host
,
'yum install -y net-tools device-mapper'
)
end
docker_compose_content
=
<<-
EOS
compose_test:
image: ubuntu:14.04
command: /bin/sh -c "while true; do echo hello world; sleep 1; done"
EOS
docker_compose_content_v2
=
<<-
EOS
version: "2"
services:
compose_test:
image: ubuntu:14.04
command: /bin/sh -c "while true; do echo hello world; sleep 1; done"
EOS
create_remote_file
(
host
,
"/tmp/docker-compose.yml"
,
docker_compose_content
)
create_remote_file
(
host
,
"/tmp/docker-compose-v2.yml"
,
docker_compose_content_v2
)
end
end
end
File Metadata
Details
Attached
Mime Type
text/x-ruby
Expires
Sat, Jun 21, 8:23 PM (3 w, 5 d ago)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
3370253
Attached To
R205 puppet-puppetlabs-docker
Event Timeline
Log In to Comment