Page Menu
Home
Software Heritage
Search
Configure Global Search
Log In
Files
F8396274
instance_spec.rb
No One
Temporary
Actions
Download File
Edit File
Delete File
View Transforms
Subscribe
Mute Notifications
Award Token
Flag For Later
Size
4 KB
Subscribers
None
instance_spec.rb
View Options
require
'spec_helper'
describe
'redis::instance'
,
type
:
:define
do
let
:pre_condition
do
'class { "redis":
default_install => false,
}'
end
let
:title
do
'app2'
end
describe
'os-dependent items'
do
context
"on Ubuntu systems"
do
context
'14.04'
do
let
(
:facts
)
{
ubuntu_1404_facts
}
it
{
should
contain_file
(
'/etc/redis/redis-server-app2.conf.puppet'
)
.
with
(
'content'
=>
/^bind 127.0.0.1/
)
}
it
{
should
contain_file
(
'/etc/redis/redis-server-app2.conf.puppet'
)
.
with
(
'content'
=>
/^logfile \/var\/log\/redis\/redis-server-app2.log/
)
}
it
{
should
contain_file
(
'/etc/redis/redis-server-app2.conf.puppet'
)
.
with
(
'content'
=>
/^dir \/var\/lib\/redis\/redis-server-app2/
)
}
it
{
should
contain_file
(
'/etc/redis/redis-server-app2.conf.puppet'
)
.
with
(
'content'
=>
/^unixsocket \/var\/run\/redis\/redis-server-app2.sock/
)
}
it
{
should
contain_file
(
'/var/lib/redis/redis-server-app2'
)
}
it
{
should
contain_service
(
'redis-server-app2'
)
.
with_ensure
(
'running'
)
}
it
{
should
contain_service
(
'redis-server-app2'
)
.
with_enable
(
'true'
)
}
it
{
should
contain_file
(
'/etc/init.d/redis-server-app2'
)
.
with_content
(
/DAEMON_ARGS=\/etc\/redis\/redis-server-app2.conf/
)
}
it
{
should
contain_file
(
'/etc/init.d/redis-server-app2'
)
.
with_content
(
/PIDFILE=\/var\/run\/redis\/redis-server-app2.pid/
)
}
end
context
'16.04'
do
let
(
:facts
)
{
ubuntu_1604_facts
.
merge
(
service_provider
:
'systemd'
)
}
it
{
should
contain_file
(
'/etc/redis/redis-server-app2.conf.puppet'
)
.
with
(
'content'
=>
/^bind 127.0.0.1/
)
}
it
{
should
contain_file
(
'/etc/redis/redis-server-app2.conf.puppet'
)
.
with
(
'content'
=>
/^logfile \/var\/log\/redis\/redis-server-app2.log/
)
}
it
{
should
contain_file
(
'/etc/redis/redis-server-app2.conf.puppet'
)
.
with
(
'content'
=>
/^dir \/var\/lib\/redis\/redis-server-app2/
)
}
it
{
should
contain_file
(
'/etc/redis/redis-server-app2.conf.puppet'
)
.
with
(
'content'
=>
/^unixsocket \/var\/run\/redis\/redis-server-app2.sock/
)
}
it
{
should
contain_file
(
'/var/lib/redis/redis-server-app2'
)
}
it
{
should
contain_service
(
'redis-server-app2'
)
.
with_ensure
(
'running'
)
}
it
{
should
contain_service
(
'redis-server-app2'
)
.
with_enable
(
'true'
)
}
it
{
should
contain_file
(
'/etc/systemd/system/redis-server-app2.service'
)
.
with_content
(
/ExecStart=\/usr\/bin\/redis-server \/etc\/redis\/redis-server-app2.conf/
)
}
end
end
context
"on CentOS systems"
do
context
'6'
do
let
(
:facts
)
{
centos_6_facts
}
it
{
should
contain_file
(
'/etc/redis-server-app2.conf.puppet'
)
.
with
(
'content'
=>
/^bind 127.0.0.1/
)
}
it
{
should
contain_file
(
'/etc/redis-server-app2.conf.puppet'
)
.
with
(
'content'
=>
/^logfile \/var\/log\/redis\/redis-server-app2.log/
)
}
it
{
should
contain_file
(
'/etc/redis-server-app2.conf.puppet'
)
.
with
(
'content'
=>
/^dir \/var\/lib\/redis\/redis-server-app2/
)
}
it
{
should
contain_file
(
'/etc/redis-server-app2.conf.puppet'
)
.
with
(
'content'
=>
/^unixsocket \/var\/run\/redis\/redis-server-app2.sock/
)
}
it
{
should
contain_file
(
'/var/lib/redis/redis-server-app2'
)
}
it
{
should
contain_service
(
'redis-server-app2'
)
.
with_ensure
(
'running'
)
}
it
{
should
contain_service
(
'redis-server-app2'
)
.
with_enable
(
'true'
)
}
it
{
should
contain_file
(
'/etc/init.d/redis-server-app2'
)
.
with_content
(
/REDIS_CONFIG="\/etc\/redis-server-app2.conf"/
)
}
it
{
should
contain_file
(
'/etc/init.d/redis-server-app2'
)
.
with_content
(
/pidfile="\/var\/run\/redis\/redis-server-app2.pid"/
)
}
end
context
'7'
do
let
(
:facts
)
{
centos_7_facts
.
merge
(
service_provider
:
'systemd'
)
}
it
{
should
contain_file
(
'/etc/redis-server-app2.conf.puppet'
)
.
with
(
'content'
=>
/^bind 127.0.0.1/
)
}
it
{
should
contain_file
(
'/etc/redis-server-app2.conf.puppet'
)
.
with
(
'content'
=>
/^logfile \/var\/log\/redis\/redis-server-app2.log/
)
}
it
{
should
contain_file
(
'/etc/redis-server-app2.conf.puppet'
)
.
with
(
'content'
=>
/^dir \/var\/lib\/redis\/redis-server-app2/
)
}
it
{
should
contain_file
(
'/etc/redis-server-app2.conf.puppet'
)
.
with
(
'content'
=>
/^unixsocket \/var\/run\/redis\/redis-server-app2.sock/
)
}
it
{
should
contain_file
(
'/var/lib/redis/redis-server-app2'
)
}
it
{
should
contain_service
(
'redis-server-app2'
)
.
with_ensure
(
'running'
)
}
it
{
should
contain_service
(
'redis-server-app2'
)
.
with_enable
(
'true'
)
}
it
{
should
contain_file
(
'/etc/systemd/system/redis-server-app2.service'
)
.
with_content
(
/ExecStart=\/usr\/bin\/redis-server \/etc\/redis-server-app2.conf/
)
}
end
end
end
end
File Metadata
Details
Attached
Mime Type
text/x-ruby
Expires
Jun 4 2025, 7:51 PM (12 w, 1 d ago)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
3399398
Attached To
R226 puppet-puppet-redis
Event Timeline
Log In to Comment