Page Menu
Home
Software Heritage
Search
Configure Global Search
Log In
Files
F9123622
secrets_spec.rb
No One
Temporary
Actions
Download File
Edit File
Delete File
View Transforms
Subscribe
Mute Notifications
Award Token
Flag For Later
Size
1 KB
Subscribers
None
secrets_spec.rb
View Options
require
'spec_helper'
describe
'docker::secrets'
,
:type
=>
:define
do
let
(
:title
)
{
'test_secret'
}
let
(
:facts
)
{
{
:osfamily
=>
'Debian'
,
:operatingsystem
=>
'Debian'
,
:lsbdistid
=>
'Debian'
,
:lsbdistcodename
=>
'jessie'
,
:kernelrelease
=>
'3.2.0-4-amd64'
,
:operatingsystemmajrelease
=>
'8'
,
}
}
context
'with secret_name => test_secret and secret_path => /root/secret.txt and label => test'
do
let
(
:params
)
{
{
'secret_name'
=>
'test_secret'
,
'secret_path'
=>
'/root/secret.txt'
,
'label'
=>
[
'test'
]
,
}
}
it
{
should
contain_exec
(
'test_secret docker secret create'
)
.
with_command
(
/docker secret create/
)
}
context
'multiple secrets declaration'
do
let
(
:pre_condition
)
{
"
docker::secrets{'test_secret_2':
secret_name => 'test_secret_2',
secret_path => '/root/secret_2.txt',
}
"
}
it
{
should
contain_exec
(
'test_secret docker secret create'
)
.
with_command
(
/docker secret create/
)
}
it
{
should
contain_exec
(
'test_secret_2 docker secret create'
)
.
with_command
(
/docker secret create/
)
}
end
end
context
'with ensure => absent and secret_name => test_secret'
do
let
(
:params
)
{
{
'ensure'
=>
'absent'
,
'secret_name'
=>
'test_secret'
}
}
it
{
should
contain_exec
(
'test_secret docker secret rm'
)
.
with_command
(
/docker secret rm/
)
}
end
end
File Metadata
Details
Attached
Mime Type
text/x-ruby
Expires
Sat, Jun 21, 5:48 PM (1 w, 5 d ago)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
3401386
Attached To
R205 puppet-puppetlabs-docker
Event Timeline
Log In to Comment