Update specs to be rubocop compliant
- Update rubocop config to include specs/** - Update specs to comply with rubocop Change-Id: I50734daada5c8fb3a40e8e9e02b0732843dc1d9b Implements: blueprint rubocop-for-object-storage
This commit is contained in:
@@ -6,9 +6,9 @@ AllCops:
|
|||||||
- providers/**
|
- providers/**
|
||||||
- recipes/**
|
- recipes/**
|
||||||
- resources/**
|
- resources/**
|
||||||
|
- spec/**
|
||||||
Excludes:
|
Excludes:
|
||||||
- libraries/**
|
- libraries/**
|
||||||
- spec/**
|
|
||||||
|
|
||||||
Encoding:
|
Encoding:
|
||||||
Exclude:
|
Exclude:
|
||||||
|
|||||||
@@ -1,3 +1,4 @@
|
|||||||
|
# encoding: UTF-8
|
||||||
require_relative 'spec_helper'
|
require_relative 'spec_helper'
|
||||||
|
|
||||||
describe 'openstack-object-storage::account-server' do
|
describe 'openstack-object-storage::account-server' do
|
||||||
@@ -6,7 +7,7 @@ describe 'openstack-object-storage::account-server' do
|
|||||||
# UBUNTU
|
# UBUNTU
|
||||||
#-------------------
|
#-------------------
|
||||||
|
|
||||||
describe "ubuntu" do
|
describe 'ubuntu' do
|
||||||
|
|
||||||
before do
|
before do
|
||||||
swift_stubs
|
swift_stubs
|
||||||
@@ -17,48 +18,48 @@ describe 'openstack-object-storage::account-server' do
|
|||||||
@node.set['swift']['network']['account-bind-ip'] = '10.0.0.1'
|
@node.set['swift']['network']['account-bind-ip'] = '10.0.0.1'
|
||||||
@node.set['swift']['network']['account-bind-port'] = '8080'
|
@node.set['swift']['network']['account-bind-port'] = '8080'
|
||||||
@node.set['swift']['disk_enum_expr'] = "[{ 'sda' => {}}]"
|
@node.set['swift']['disk_enum_expr'] = "[{ 'sda' => {}}]"
|
||||||
@node.set['swift']['disk_test_filter'] = [ "candidate =~ /sd[^a]/ or candidate =~ /hd[^a]/ or candidate =~ /vd[^a]/ or candidate =~ /xvd[^a]/",
|
@node.set['swift']['disk_test_filter'] = ['candidate =~ /sd[^a]/ or candidate =~ /hd[^a]/ or candidate =~ /vd[^a]/ or candidate =~ /xvd[^a]/',
|
||||||
"File.exist?('/dev/' + candidate)",
|
"File.exist?('/dev/' + candidate)",
|
||||||
"not system('/sbin/parted /dev/' + candidate + ' -s print | grep linux-swap')",
|
"not system('/sbin/parted /dev/' + candidate + ' -s print | grep linux-swap')",
|
||||||
"not info.has_key?('removable') or info['removable'] == 0.to_s"]
|
"not info.has_key?('removable') or info['removable'] == 0.to_s"]
|
||||||
|
|
||||||
# mock out an interface on the storage node
|
# mock out an interface on the storage node
|
||||||
@node.set["network"] = MOCK_NODE_NETWORK_DATA['network']
|
@node.set['network'] = MOCK_NODE_NETWORK_DATA['network']
|
||||||
|
|
||||||
@chef_run.converge "openstack-object-storage::account-server"
|
@chef_run.converge 'openstack-object-storage::account-server'
|
||||||
end
|
end
|
||||||
|
|
||||||
it "installs swift account packages" do
|
it 'installs swift account packages' do
|
||||||
expect(@chef_run).to install_package "swift-account"
|
expect(@chef_run).to install_package 'swift-account'
|
||||||
end
|
end
|
||||||
|
|
||||||
it "installs swiftclient package" do
|
it 'installs swiftclient package' do
|
||||||
expect(@chef_run).to install_package "python-swiftclient"
|
expect(@chef_run).to install_package 'python-swiftclient'
|
||||||
end
|
end
|
||||||
|
|
||||||
it "starts swift account services on boot" do
|
it 'starts swift account services on boot' do
|
||||||
%w{swift-account swift-account-auditor swift-account-reaper swift-account-replicator}.each do |svc|
|
%w{swift-account swift-account-auditor swift-account-reaper swift-account-replicator}.each do |svc|
|
||||||
expect(@chef_run).to enable_service(svc)
|
expect(@chef_run).to enable_service(svc)
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
describe "/etc/swift/account-server.conf" do
|
describe '/etc/swift/account-server.conf' do
|
||||||
|
|
||||||
before do
|
before do
|
||||||
@file = @chef_run.template "/etc/swift/account-server.conf"
|
@file = @chef_run.template '/etc/swift/account-server.conf'
|
||||||
end
|
end
|
||||||
|
|
||||||
it "has proper owner" do
|
it 'has proper owner' do
|
||||||
expect(@file.owner).to eq("swift")
|
expect(@file.owner).to eq('swift')
|
||||||
expect(@file.group).to eq("swift")
|
expect(@file.group).to eq('swift')
|
||||||
end
|
end
|
||||||
|
|
||||||
it "has proper modes" do
|
it 'has proper modes' do
|
||||||
expect(sprintf("%o", @file.mode)).to eq "600"
|
expect(sprintf('%o', @file.mode)).to eq '600'
|
||||||
end
|
end
|
||||||
|
|
||||||
it "template contents" do
|
it 'template contents' do
|
||||||
pending "TODO: implement"
|
pending 'TODO: implement'
|
||||||
end
|
end
|
||||||
|
|
||||||
end
|
end
|
||||||
|
|||||||
@@ -1,3 +1,4 @@
|
|||||||
|
# encoding: UTF-8
|
||||||
require_relative 'spec_helper'
|
require_relative 'spec_helper'
|
||||||
|
|
||||||
describe 'openstack-object-storage::common' do
|
describe 'openstack-object-storage::common' do
|
||||||
@@ -6,90 +7,88 @@ describe 'openstack-object-storage::common' do
|
|||||||
# UBUNTU
|
# UBUNTU
|
||||||
#-------------------
|
#-------------------
|
||||||
|
|
||||||
describe "ubuntu" do
|
describe 'ubuntu' do
|
||||||
|
|
||||||
before do
|
before do
|
||||||
swift_stubs
|
swift_stubs
|
||||||
@chef_run = ::ChefSpec::Runner.new ::UBUNTU_OPTS
|
@chef_run = ::ChefSpec::Runner.new ::UBUNTU_OPTS
|
||||||
@node = @chef_run.node
|
@node = @chef_run.node
|
||||||
@node.set['platform_family'] = "debian"
|
@node.set['platform_family'] = 'debian'
|
||||||
@node.set['lsb']['codename'] = "precise"
|
@node.set['lsb']['codename'] = 'precise'
|
||||||
@node.set['swift']['release'] = "havana"
|
@node.set['swift']['release'] = 'havana'
|
||||||
@node.set['swift']['authmode'] = 'swauth'
|
@node.set['swift']['authmode'] = 'swauth'
|
||||||
@node.set['swift']['git_builder_ip'] = '10.0.0.10'
|
@node.set['swift']['git_builder_ip'] = '10.0.0.10'
|
||||||
|
|
||||||
# TODO: this does not work
|
# TODO: this does not work
|
||||||
# ::Chef::Log.should_receive(:info).with("chefspec: precise-updates/havana")
|
# ::Chef::Log.should_receive(:info).with('chefspec: precise-updates/havana')
|
||||||
|
|
||||||
@chef_run.converge "openstack-object-storage::common"
|
@chef_run.converge 'openstack-object-storage::common'
|
||||||
end
|
end
|
||||||
|
|
||||||
|
|
||||||
it 'should set syctl paramaters' do
|
it 'should set syctl paramaters' do
|
||||||
# N.B. we could examine chef log
|
# N.B. we could examine chef log
|
||||||
pending "TODO: right now theres no way to do lwrp and test for this"
|
pending 'TODO: right now theres no way to do lwrp and test for this'
|
||||||
end
|
end
|
||||||
|
|
||||||
it 'installs git package for ring management' do
|
it 'installs git package for ring management' do
|
||||||
expect(@chef_run).to install_package "git"
|
expect(@chef_run).to install_package 'git'
|
||||||
end
|
end
|
||||||
|
|
||||||
describe "/etc/swift" do
|
describe '/etc/swift' do
|
||||||
|
|
||||||
before do
|
before do
|
||||||
@file = @chef_run.directory "/etc/swift"
|
@file = @chef_run.directory '/etc/swift'
|
||||||
end
|
end
|
||||||
|
|
||||||
it "has proper owner" do
|
it 'has proper owner' do
|
||||||
expect(@file.owner).to eq("swift")
|
expect(@file.owner).to eq('swift')
|
||||||
expect(@file.group).to eq("swift")
|
expect(@file.group).to eq('swift')
|
||||||
end
|
end
|
||||||
|
|
||||||
it "has proper modes" do
|
it 'has proper modes' do
|
||||||
expect(sprintf("%o", @file.mode)).to eq "700"
|
expect(sprintf('%o', @file.mode)).to eq '700'
|
||||||
end
|
end
|
||||||
|
|
||||||
end
|
end
|
||||||
|
|
||||||
describe "/etc/swift/swift.conf" do
|
describe '/etc/swift/swift.conf' do
|
||||||
|
|
||||||
before do
|
before do
|
||||||
@file = @chef_run.file "/etc/swift/swift.conf"
|
@file = @chef_run.file '/etc/swift/swift.conf'
|
||||||
end
|
end
|
||||||
|
|
||||||
it "has proper owner" do
|
it 'has proper owner' do
|
||||||
expect(@file.owner).to eq("swift")
|
expect(@file.owner).to eq('swift')
|
||||||
expect(@file.group).to eq("swift")
|
expect(@file.group).to eq('swift')
|
||||||
end
|
end
|
||||||
|
|
||||||
it "has proper modes" do
|
it 'has proper modes' do
|
||||||
expect(sprintf("%o", @file.mode)).to eq "700"
|
expect(sprintf('%o', @file.mode)).to eq '700'
|
||||||
end
|
end
|
||||||
|
|
||||||
end
|
end
|
||||||
|
|
||||||
describe "/etc/swift/pull-rings.sh" do
|
describe '/etc/swift/pull-rings.sh' do
|
||||||
|
|
||||||
before do
|
before do
|
||||||
@file = @chef_run.template "/etc/swift/pull-rings.sh"
|
@file = @chef_run.template '/etc/swift/pull-rings.sh'
|
||||||
end
|
end
|
||||||
|
|
||||||
it "has proper owner" do
|
it 'has proper owner' do
|
||||||
expect(@file.owner).to eq("swift")
|
expect(@file.owner).to eq('swift')
|
||||||
expect(@file.group).to eq("swift")
|
expect(@file.group).to eq('swift')
|
||||||
end
|
end
|
||||||
|
|
||||||
it "has proper modes" do
|
it 'has proper modes' do
|
||||||
expect(sprintf("%o", @file.mode)).to eq "700"
|
expect(sprintf('%o', @file.mode)).to eq '700'
|
||||||
end
|
end
|
||||||
|
|
||||||
it "template contents" do
|
it 'template contents' do
|
||||||
pending "TODO: implement"
|
pending 'TODO: implement'
|
||||||
end
|
end
|
||||||
|
|
||||||
end
|
end
|
||||||
|
|
||||||
end
|
end
|
||||||
|
|
||||||
|
|
||||||
end
|
end
|
||||||
|
|||||||
@@ -1,3 +1,4 @@
|
|||||||
|
# encoding: UTF-8
|
||||||
require_relative 'spec_helper'
|
require_relative 'spec_helper'
|
||||||
|
|
||||||
describe 'openstack-object-storage::container-server' do
|
describe 'openstack-object-storage::container-server' do
|
||||||
@@ -6,7 +7,7 @@ describe 'openstack-object-storage::container-server' do
|
|||||||
# UBUNTU
|
# UBUNTU
|
||||||
#-------------------
|
#-------------------
|
||||||
|
|
||||||
describe "ubuntu" do
|
describe 'ubuntu' do
|
||||||
|
|
||||||
before do
|
before do
|
||||||
swift_stubs
|
swift_stubs
|
||||||
@@ -19,66 +20,66 @@ describe 'openstack-object-storage::container-server' do
|
|||||||
@node.set['swift']['container-server']['allowed_sync_hosts'] = ['host1', 'host2', 'host3']
|
@node.set['swift']['container-server']['allowed_sync_hosts'] = ['host1', 'host2', 'host3']
|
||||||
@node.set['swift']['container-bind-port'] = '8080'
|
@node.set['swift']['container-bind-port'] = '8080'
|
||||||
@node.set['swift']['disk_enum_expr'] = "[{ 'sda' => {}}]"
|
@node.set['swift']['disk_enum_expr'] = "[{ 'sda' => {}}]"
|
||||||
@node.set['swift']['disk_test_filter'] = [ "candidate =~ /sd[^a]/ or candidate =~ /hd[^a]/ or candidate =~ /vd[^a]/ or candidate =~ /xvd[^a]/",
|
@node.set['swift']['disk_test_filter'] = ['candidate =~ /sd[^a]/ or candidate =~ /hd[^a]/ or candidate =~ /vd[^a]/ or candidate =~ /xvd[^a]/',
|
||||||
"File.exist?('/dev/' + candidate)",
|
"File.exist?('/dev/' + candidate)",
|
||||||
"not system('/sbin/parted /dev/' + candidate + ' -s print | grep linux-swap')",
|
"not system('/sbin/parted /dev/' + candidate + ' -s print | grep linux-swap')",
|
||||||
"not info.has_key?('removable') or info['removable'] == 0.to_s"]
|
"not info.has_key?('removable') or info['removable'] == 0.to_s"]
|
||||||
|
|
||||||
# mock out an interface on the storage node
|
# mock out an interface on the storage node
|
||||||
@node.set["network"] = MOCK_NODE_NETWORK_DATA['network']
|
@node.set['network'] = MOCK_NODE_NETWORK_DATA['network']
|
||||||
|
|
||||||
@chef_run.converge "openstack-object-storage::container-server"
|
@chef_run.converge 'openstack-object-storage::container-server'
|
||||||
end
|
end
|
||||||
|
|
||||||
it "installs swift container packages" do
|
it 'installs swift container packages' do
|
||||||
expect(@chef_run).to install_package "swift-container"
|
expect(@chef_run).to install_package 'swift-container'
|
||||||
end
|
end
|
||||||
|
|
||||||
it "starts swift container services on boot" do
|
it 'starts swift container services on boot' do
|
||||||
%w{swift-container swift-container-auditor swift-container-replicator swift-container-updater swift-container-sync}.each do |svc|
|
%w{swift-container swift-container-auditor swift-container-replicator swift-container-updater swift-container-sync}.each do |svc|
|
||||||
expect(@chef_run).to enable_service(svc)
|
expect(@chef_run).to enable_service(svc)
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
describe "/etc/swift/container-server.conf" do
|
describe '/etc/swift/container-server.conf' do
|
||||||
|
|
||||||
before do
|
before do
|
||||||
@file = @chef_run.template "/etc/swift/container-server.conf"
|
@file = @chef_run.template '/etc/swift/container-server.conf'
|
||||||
end
|
end
|
||||||
|
|
||||||
it "has proper owner" do
|
it 'has proper owner' do
|
||||||
expect(@file.owner).to eq("swift")
|
expect(@file.owner).to eq('swift')
|
||||||
expect(@file.group).to eq("swift")
|
expect(@file.group).to eq('swift')
|
||||||
end
|
end
|
||||||
|
|
||||||
it "has proper modes" do
|
it 'has proper modes' do
|
||||||
expect(sprintf("%o", @file.mode)).to eq "600"
|
expect(sprintf('%o', @file.mode)).to eq '600'
|
||||||
end
|
end
|
||||||
|
|
||||||
it "has allowed sync hosts" do
|
it 'has allowed sync hosts' do
|
||||||
expect(@chef_run).to render_file(@file.name).with_content("allowed_sync_hosts = host1,host2,host3")
|
expect(@chef_run).to render_file(@file.name).with_content('allowed_sync_hosts = host1,host2,host3')
|
||||||
end
|
end
|
||||||
|
|
||||||
end
|
end
|
||||||
|
|
||||||
it "should create container sync upstart conf for ubuntu" do
|
it 'should create container sync upstart conf for ubuntu' do
|
||||||
expect(@chef_run).to create_cookbook_file "/etc/init/swift-container-sync.conf"
|
expect(@chef_run).to create_cookbook_file '/etc/init/swift-container-sync.conf'
|
||||||
end
|
end
|
||||||
|
|
||||||
it "should create container sync init script for ubuntu" do
|
it 'should create container sync init script for ubuntu' do
|
||||||
expect(@chef_run).to create_link "/etc/init.d/swift-container-sync"
|
expect(@chef_run).to create_link '/etc/init.d/swift-container-sync'
|
||||||
end
|
end
|
||||||
|
|
||||||
describe "/etc/swift/container-server.conf" do
|
describe '/etc/swift/container-server.conf' do
|
||||||
|
|
||||||
before do
|
before do
|
||||||
@node = @chef_run.node
|
@node = @chef_run.node
|
||||||
@node.set["swift"]["container-server"]["allowed_sync_hosts"] = []
|
@node.set['swift']['container-server']['allowed_sync_hosts'] = []
|
||||||
@chef_run.converge "openstack-object-storage::container-server"
|
@chef_run.converge 'openstack-object-storage::container-server'
|
||||||
@file = @chef_run.template "/etc/swift/container-server.conf"
|
@file = @chef_run.template '/etc/swift/container-server.conf'
|
||||||
end
|
end
|
||||||
|
|
||||||
it "has no allowed_sync_hosts on empty lists" do
|
it 'has no allowed_sync_hosts on empty lists' do
|
||||||
expect(@chef_run).not_to render_file(@file.name).with_content(/^allowed_sync_hots =/)
|
expect(@chef_run).not_to render_file(@file.name).with_content(/^allowed_sync_hots =/)
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|||||||
@@ -1,3 +1,4 @@
|
|||||||
|
# encoding: UTF-8
|
||||||
require_relative 'spec_helper'
|
require_relative 'spec_helper'
|
||||||
|
|
||||||
describe 'openstack-object-storage::disks' do
|
describe 'openstack-object-storage::disks' do
|
||||||
@@ -6,35 +7,35 @@ describe 'openstack-object-storage::disks' do
|
|||||||
# UBUNTU
|
# UBUNTU
|
||||||
#-------------------
|
#-------------------
|
||||||
|
|
||||||
describe "ubuntu" do
|
describe 'ubuntu' do
|
||||||
|
|
||||||
before do
|
before do
|
||||||
swift_stubs
|
swift_stubs
|
||||||
@chef_run = ::ChefSpec::Runner.new ::UBUNTU_OPTS
|
@chef_run = ::ChefSpec::Runner.new ::UBUNTU_OPTS
|
||||||
@node = @chef_run.node
|
@node = @chef_run.node
|
||||||
@node.set['platform_family'] = "debian"
|
@node.set['platform_family'] = 'debian'
|
||||||
@node.set['lsb']['codename'] = "precise"
|
@node.set['lsb']['codename'] = 'precise'
|
||||||
@node.set['swift']['release'] = "havana"
|
@node.set['swift']['release'] = 'havana'
|
||||||
@node.set['swift']['authmode'] = 'swauth'
|
@node.set['swift']['authmode'] = 'swauth'
|
||||||
@node.set['swift']['git_builder_ip'] = '10.0.0.10'
|
@node.set['swift']['git_builder_ip'] = '10.0.0.10'
|
||||||
@node.set['swift']['disk_enum_expr'] = "[{ 'sda' => {}}]"
|
@node.set['swift']['disk_enum_expr'] = "[{ 'sda' => {}}]"
|
||||||
@node.set['swift']['disk_test_filter'] = [ "candidate =~ /sd[^a]/ or candidate =~ /hd[^a]/ or candidate =~ /vd[^a]/ or candidate =~ /xvd[^a]/",
|
@node.set['swift']['disk_test_filter'] = ['candidate =~ /sd[^a]/ or candidate =~ /hd[^a]/ or candidate =~ /vd[^a]/ or candidate =~ /xvd[^a]/',
|
||||||
"File.exist?('/dev/' + candidate)",
|
"File.exist?('/dev/' + candidate)",
|
||||||
"not system('/sbin/parted /dev/' + candidate + ' -s print | grep linux-swap')",
|
"not system('/sbin/parted /dev/' + candidate + ' -s print | grep linux-swap')",
|
||||||
"not info.has_key?('removable') or info['removable'] == 0.to_s"]
|
"not info.has_key?('removable') or info['removable'] == 0.to_s"]
|
||||||
|
|
||||||
# mock out an interface on the storage node
|
# mock out an interface on the storage node
|
||||||
@node.set["network"] = MOCK_NODE_NETWORK_DATA['network']
|
@node.set['network'] = MOCK_NODE_NETWORK_DATA['network']
|
||||||
|
|
||||||
@chef_run.converge "openstack-object-storage::disks"
|
@chef_run.converge 'openstack-object-storage::disks'
|
||||||
end
|
end
|
||||||
|
|
||||||
it 'installs xfs progs package' do
|
it 'installs xfs progs package' do
|
||||||
expect(@chef_run).to install_package "xfsprogs"
|
expect(@chef_run).to install_package 'xfsprogs'
|
||||||
end
|
end
|
||||||
|
|
||||||
it 'installs parted package' do
|
it 'installs parted package' do
|
||||||
expect(@chef_run).to install_package "parted"
|
expect(@chef_run).to install_package 'parted'
|
||||||
end
|
end
|
||||||
|
|
||||||
end
|
end
|
||||||
|
|||||||
@@ -1,3 +1,4 @@
|
|||||||
|
# encoding: UTF-8
|
||||||
require_relative 'spec_helper'
|
require_relative 'spec_helper'
|
||||||
|
|
||||||
describe 'openstack-object-storage::management-server' do
|
describe 'openstack-object-storage::management-server' do
|
||||||
@@ -6,7 +7,7 @@ describe 'openstack-object-storage::management-server' do
|
|||||||
# UBUNTU
|
# UBUNTU
|
||||||
#-------------------
|
#-------------------
|
||||||
|
|
||||||
describe "ubuntu" do
|
describe 'ubuntu' do
|
||||||
|
|
||||||
before do
|
before do
|
||||||
swift_stubs
|
swift_stubs
|
||||||
@@ -18,50 +19,50 @@ describe 'openstack-object-storage::management-server' do
|
|||||||
@node.set['swift']['swauth_source'] = 'package'
|
@node.set['swift']['swauth_source'] = 'package'
|
||||||
@node.set['swift']['platform']['swauth_packages'] = ['swauth']
|
@node.set['swift']['platform']['swauth_packages'] = ['swauth']
|
||||||
|
|
||||||
@chef_run.converge "openstack-object-storage::management-server"
|
@chef_run.converge 'openstack-object-storage::management-server'
|
||||||
end
|
end
|
||||||
|
|
||||||
it "installs swift swauth package" do
|
it 'installs swift swauth package' do
|
||||||
expect(@chef_run).to install_package "swauth"
|
expect(@chef_run).to install_package 'swauth'
|
||||||
end
|
end
|
||||||
|
|
||||||
describe "/etc/swift/dispersion.conf" do
|
describe '/etc/swift/dispersion.conf' do
|
||||||
|
|
||||||
before do
|
before do
|
||||||
@file = @chef_run.template "/etc/swift/dispersion.conf"
|
@file = @chef_run.template '/etc/swift/dispersion.conf'
|
||||||
end
|
end
|
||||||
|
|
||||||
it "has proper owner" do
|
it 'has proper owner' do
|
||||||
expect(@file.owner).to eq("swift")
|
expect(@file.owner).to eq('swift')
|
||||||
expect(@file.group).to eq("swift")
|
expect(@file.group).to eq('swift')
|
||||||
end
|
end
|
||||||
|
|
||||||
it "has proper modes" do
|
it 'has proper modes' do
|
||||||
expect(sprintf("%o", @file.mode)).to eq "600"
|
expect(sprintf('%o', @file.mode)).to eq '600'
|
||||||
end
|
end
|
||||||
|
|
||||||
it "template contents" do
|
it 'template contents' do
|
||||||
pending "TODO: implement"
|
pending 'TODO: implement'
|
||||||
end
|
end
|
||||||
|
|
||||||
end
|
end
|
||||||
|
|
||||||
describe "/usr/local/bin/swift-statsd-publish.py" do
|
describe '/usr/local/bin/swift-statsd-publish.py' do
|
||||||
|
|
||||||
before do
|
before do
|
||||||
@file = @chef_run.template "/usr/local/bin/swift-statsd-publish.py"
|
@file = @chef_run.template '/usr/local/bin/swift-statsd-publish.py'
|
||||||
end
|
end
|
||||||
|
|
||||||
it "has proper owner" do
|
it 'has proper owner' do
|
||||||
expect(@file.owner).to eq("root")
|
expect(@file.owner).to eq('root')
|
||||||
expect(@file.group).to eq("root")
|
expect(@file.group).to eq('root')
|
||||||
end
|
end
|
||||||
|
|
||||||
it "has proper modes" do
|
it 'has proper modes' do
|
||||||
expect(sprintf("%o", @file.mode)).to eq "755"
|
expect(sprintf('%o', @file.mode)).to eq '755'
|
||||||
end
|
end
|
||||||
|
|
||||||
it "has expected statsd host" do
|
it 'has expected statsd host' do
|
||||||
expect(@chef_run).to render_file(@file.name).with_content("self.statsd_host = '127.0.0.1'")
|
expect(@chef_run).to render_file(@file.name).with_content("self.statsd_host = '127.0.0.1'")
|
||||||
end
|
end
|
||||||
|
|
||||||
|
|||||||
@@ -1,3 +1,4 @@
|
|||||||
|
# encoding: UTF-8
|
||||||
require_relative 'spec_helper'
|
require_relative 'spec_helper'
|
||||||
|
|
||||||
describe 'openstack-object-storage::object-server' do
|
describe 'openstack-object-storage::object-server' do
|
||||||
@@ -6,7 +7,7 @@ describe 'openstack-object-storage::object-server' do
|
|||||||
# UBUNTU
|
# UBUNTU
|
||||||
#-------------------
|
#-------------------
|
||||||
|
|
||||||
describe "ubuntu" do
|
describe 'ubuntu' do
|
||||||
|
|
||||||
before do
|
before do
|
||||||
swift_stubs
|
swift_stubs
|
||||||
@@ -17,52 +18,52 @@ describe 'openstack-object-storage::object-server' do
|
|||||||
@node.set['swift']['network']['object-bind-ip'] = '10.0.0.1'
|
@node.set['swift']['network']['object-bind-ip'] = '10.0.0.1'
|
||||||
@node.set['swift']['network']['object-bind-port'] = '8080'
|
@node.set['swift']['network']['object-bind-port'] = '8080'
|
||||||
@node.set['swift']['disk_enum_expr'] = "[{ 'sda' => {}}]"
|
@node.set['swift']['disk_enum_expr'] = "[{ 'sda' => {}}]"
|
||||||
@node.set['swift']['disk_test_filter'] = [ "candidate =~ /sd[^a]/ or candidate =~ /hd[^a]/ or candidate =~ /vd[^a]/ or candidate =~ /xvd[^a]/",
|
@node.set['swift']['disk_test_filter'] = ['candidate =~ /sd[^a]/ or candidate =~ /hd[^a]/ or candidate =~ /vd[^a]/ or candidate =~ /xvd[^a]/',
|
||||||
"File.exist?('/dev/' + candidate)",
|
"File.exist?('/dev/' + candidate)",
|
||||||
"not system('/sbin/parted /dev/' + candidate + ' -s print | grep linux-swap')",
|
"not system('/sbin/parted /dev/' + candidate + ' -s print | grep linux-swap')",
|
||||||
"not info.has_key?('removable') or info['removable'] == 0.to_s"]
|
"not info.has_key?('removable') or info['removable'] == 0.to_s"]
|
||||||
|
|
||||||
# mock out an interface on the storage node
|
# mock out an interface on the storage node
|
||||||
@node.set["network"] = MOCK_NODE_NETWORK_DATA['network']
|
@node.set['network'] = MOCK_NODE_NETWORK_DATA['network']
|
||||||
|
|
||||||
@chef_run.converge "openstack-object-storage::object-server"
|
@chef_run.converge 'openstack-object-storage::object-server'
|
||||||
end
|
end
|
||||||
|
|
||||||
it "installs swift packages" do
|
it 'installs swift packages' do
|
||||||
expect(@chef_run).to install_package "swift-object"
|
expect(@chef_run).to install_package 'swift-object'
|
||||||
end
|
end
|
||||||
|
|
||||||
it "starts swift object services on boot" do
|
it 'starts swift object services on boot' do
|
||||||
%w{swift-object swift-object-replicator swift-object-auditor swift-object-updater}.each do |svc|
|
%w{swift-object swift-object-replicator swift-object-auditor swift-object-updater}.each do |svc|
|
||||||
expect(@chef_run).to enable_service(svc)
|
expect(@chef_run).to enable_service(svc)
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
describe "/var/spool/crontab/root" do
|
describe '/var/spool/crontab/root' do
|
||||||
|
|
||||||
it "template contents" do
|
it 'template contents' do
|
||||||
pending "TODO: check for recon script"
|
pending 'TODO: check for recon script'
|
||||||
end
|
end
|
||||||
|
|
||||||
end
|
end
|
||||||
|
|
||||||
describe "/etc/swift/object-server.conf" do
|
describe '/etc/swift/object-server.conf' do
|
||||||
|
|
||||||
before do
|
before do
|
||||||
@file = @chef_run.template "/etc/swift/object-server.conf"
|
@file = @chef_run.template '/etc/swift/object-server.conf'
|
||||||
end
|
end
|
||||||
|
|
||||||
it "has proper owner" do
|
it 'has proper owner' do
|
||||||
expect(@file.owner).to eq("swift")
|
expect(@file.owner).to eq('swift')
|
||||||
expect(@file.group).to eq("swift")
|
expect(@file.group).to eq('swift')
|
||||||
end
|
end
|
||||||
|
|
||||||
it "has proper modes" do
|
it 'has proper modes' do
|
||||||
expect(sprintf("%o", @file.mode)).to eq "600"
|
expect(sprintf('%o', @file.mode)).to eq '600'
|
||||||
end
|
end
|
||||||
|
|
||||||
it "template contents" do
|
it 'template contents' do
|
||||||
pending "TODO: implement"
|
pending 'TODO: implement'
|
||||||
end
|
end
|
||||||
|
|
||||||
end
|
end
|
||||||
|
|||||||
@@ -1,3 +1,4 @@
|
|||||||
|
# encoding: UTF-8
|
||||||
require_relative 'spec_helper'
|
require_relative 'spec_helper'
|
||||||
|
|
||||||
describe 'openstack-object-storage::proxy-server' do
|
describe 'openstack-object-storage::proxy-server' do
|
||||||
@@ -6,7 +7,7 @@ describe 'openstack-object-storage::proxy-server' do
|
|||||||
# UBUNTU
|
# UBUNTU
|
||||||
#--------------
|
#--------------
|
||||||
|
|
||||||
describe "ubuntu" do
|
describe 'ubuntu' do
|
||||||
|
|
||||||
before do
|
before do
|
||||||
swift_stubs
|
swift_stubs
|
||||||
@@ -18,42 +19,42 @@ describe 'openstack-object-storage::proxy-server' do
|
|||||||
@node.set['swift']['swauth_source'] = 'package'
|
@node.set['swift']['swauth_source'] = 'package'
|
||||||
@node.set['swift']['network']['proxy-bind-ip'] = '10.0.0.1'
|
@node.set['swift']['network']['proxy-bind-ip'] = '10.0.0.1'
|
||||||
@node.set['swift']['network']['proxy-bind-port'] = '8080'
|
@node.set['swift']['network']['proxy-bind-port'] = '8080'
|
||||||
@chef_run.converge "openstack-object-storage::proxy-server"
|
@chef_run.converge 'openstack-object-storage::proxy-server'
|
||||||
end
|
end
|
||||||
|
|
||||||
it "installs memcache python packages" do
|
it 'installs memcache python packages' do
|
||||||
expect(@chef_run).to install_package "python-memcache"
|
expect(@chef_run).to install_package 'python-memcache'
|
||||||
end
|
end
|
||||||
|
|
||||||
it "installs swift packages" do
|
it 'installs swift packages' do
|
||||||
expect(@chef_run).to install_package "swift-proxy"
|
expect(@chef_run).to install_package 'swift-proxy'
|
||||||
end
|
end
|
||||||
|
|
||||||
it "installs swauth package if swauth is selected" do
|
it 'installs swauth package if swauth is selected' do
|
||||||
expect(@chef_run).to install_package "swauth"
|
expect(@chef_run).to install_package 'swauth'
|
||||||
end
|
end
|
||||||
|
|
||||||
it "starts swift-proxy on boot" do
|
it 'starts swift-proxy on boot' do
|
||||||
expect(@chef_run).to enable_service("swift-proxy")
|
expect(@chef_run).to enable_service('swift-proxy')
|
||||||
end
|
end
|
||||||
|
|
||||||
describe "/etc/swift/proxy-server.conf" do
|
describe '/etc/swift/proxy-server.conf' do
|
||||||
|
|
||||||
before do
|
before do
|
||||||
@file = @chef_run.template "/etc/swift/proxy-server.conf"
|
@file = @chef_run.template '/etc/swift/proxy-server.conf'
|
||||||
end
|
end
|
||||||
|
|
||||||
it "has proper owner" do
|
it 'has proper owner' do
|
||||||
expect(@file.owner).to eq("swift")
|
expect(@file.owner).to eq('swift')
|
||||||
expect(@file.group).to eq("swift")
|
expect(@file.group).to eq('swift')
|
||||||
end
|
end
|
||||||
|
|
||||||
it "has proper modes" do
|
it 'has proper modes' do
|
||||||
expect(sprintf("%o", @file.mode)).to eq "600"
|
expect(sprintf('%o', @file.mode)).to eq '600'
|
||||||
end
|
end
|
||||||
|
|
||||||
it "template contents" do
|
it 'template contents' do
|
||||||
pending "TODO: implement"
|
pending 'TODO: implement'
|
||||||
end
|
end
|
||||||
|
|
||||||
end
|
end
|
||||||
|
|||||||
@@ -1,3 +1,4 @@
|
|||||||
|
# encoding: UTF-8
|
||||||
require_relative 'spec_helper'
|
require_relative 'spec_helper'
|
||||||
|
|
||||||
describe 'openstack-object-storage::ring-repo' do
|
describe 'openstack-object-storage::ring-repo' do
|
||||||
@@ -6,34 +7,34 @@ describe 'openstack-object-storage::ring-repo' do
|
|||||||
# UBUNTU
|
# UBUNTU
|
||||||
#-------------------
|
#-------------------
|
||||||
|
|
||||||
describe "ubuntu" do
|
describe 'ubuntu' do
|
||||||
|
|
||||||
before do
|
before do
|
||||||
swift_stubs
|
swift_stubs
|
||||||
@chef_run = ::ChefSpec::Runner.new ::UBUNTU_OPTS
|
@chef_run = ::ChefSpec::Runner.new ::UBUNTU_OPTS
|
||||||
@node = @chef_run.node
|
@node = @chef_run.node
|
||||||
@node.set['platform_family'] = "debian"
|
@node.set['platform_family'] = 'debian'
|
||||||
@node.set['lsb']['codename'] = "precise"
|
@node.set['lsb']['codename'] = 'precise'
|
||||||
@node.set['swift']['release'] = "havana"
|
@node.set['swift']['release'] = 'havana'
|
||||||
@node.set['swift']['authmode'] = 'swauth'
|
@node.set['swift']['authmode'] = 'swauth'
|
||||||
@node.set['swift']['git_builder_ip'] = '10.0.0.10'
|
@node.set['swift']['git_builder_ip'] = '10.0.0.10'
|
||||||
@chef_run.converge "openstack-object-storage::ring-repo"
|
@chef_run.converge 'openstack-object-storage::ring-repo'
|
||||||
end
|
end
|
||||||
|
|
||||||
it 'installs git package for ring management' do
|
it 'installs git package for ring management' do
|
||||||
expect(@chef_run).to install_package "git-daemon-sysvinit"
|
expect(@chef_run).to install_package 'git-daemon-sysvinit'
|
||||||
end
|
end
|
||||||
|
|
||||||
it "should not start xinetd services on boot" do
|
it 'should not start xinetd services on boot' do
|
||||||
%w{xinetd}.each do |svc|
|
%w{xinetd}.each do |svc|
|
||||||
expect(@chef_run).not_to enable_service(svc)
|
expect(@chef_run).not_to enable_service(svc)
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
describe "/etc/swift/ring-workspace/generate-rings.sh" do
|
describe '/etc/swift/ring-workspace/generate-rings.sh' do
|
||||||
|
|
||||||
it "gets installed" do
|
it 'gets installed' do
|
||||||
pending "TODO: determine some way to ensure this LWRP script gets created"
|
pending 'TODO: determine some way to ensure this LWRP script gets created'
|
||||||
end
|
end
|
||||||
|
|
||||||
end
|
end
|
||||||
|
|||||||
@@ -1,3 +1,4 @@
|
|||||||
|
# encoding: UTF-8
|
||||||
require_relative 'spec_helper'
|
require_relative 'spec_helper'
|
||||||
|
|
||||||
describe 'openstack-object-storage::rsync' do
|
describe 'openstack-object-storage::rsync' do
|
||||||
@@ -6,42 +7,42 @@ describe 'openstack-object-storage::rsync' do
|
|||||||
# UBUNTU
|
# UBUNTU
|
||||||
#-------------------
|
#-------------------
|
||||||
|
|
||||||
describe "ubuntu" do
|
describe 'ubuntu' do
|
||||||
|
|
||||||
before do
|
before do
|
||||||
swift_stubs
|
swift_stubs
|
||||||
@chef_run = ::ChefSpec::Runner.new ::UBUNTU_OPTS
|
@chef_run = ::ChefSpec::Runner.new ::UBUNTU_OPTS
|
||||||
@node = @chef_run.node
|
@node = @chef_run.node
|
||||||
@node.set['platform_family'] = "debian"
|
@node.set['platform_family'] = 'debian'
|
||||||
@node.set['lsb']['codename'] = "precise"
|
@node.set['lsb']['codename'] = 'precise'
|
||||||
@node.set['swift']['release'] = "havana"
|
@node.set['swift']['release'] = 'havana'
|
||||||
@node.set['swift']['authmode'] = 'swauth'
|
@node.set['swift']['authmode'] = 'swauth'
|
||||||
@node.set['swift']['git_builder_ip'] = '10.0.0.10'
|
@node.set['swift']['git_builder_ip'] = '10.0.0.10'
|
||||||
@chef_run.converge "openstack-object-storage::rsync"
|
@chef_run.converge 'openstack-object-storage::rsync'
|
||||||
end
|
end
|
||||||
|
|
||||||
it 'installs git package for ring management' do
|
it 'installs git package for ring management' do
|
||||||
expect(@chef_run).to install_package "rsync"
|
expect(@chef_run).to install_package 'rsync'
|
||||||
end
|
end
|
||||||
|
|
||||||
it "starts rsync service on boot" do
|
it 'starts rsync service on boot' do
|
||||||
%w{rsync}.each do |svc|
|
%w{rsync}.each do |svc|
|
||||||
expect(@chef_run).to enable_service(svc)
|
expect(@chef_run).to enable_service(svc)
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
describe "/etc/rsyncd.conf" do
|
describe '/etc/rsyncd.conf' do
|
||||||
|
|
||||||
before do
|
before do
|
||||||
@file = @chef_run.template "/etc/rsyncd.conf"
|
@file = @chef_run.template '/etc/rsyncd.conf'
|
||||||
end
|
end
|
||||||
|
|
||||||
it "has proper modes" do
|
it 'has proper modes' do
|
||||||
expect(sprintf("%o", @file.mode)).to eq "644"
|
expect(sprintf('%o', @file.mode)).to eq '644'
|
||||||
end
|
end
|
||||||
|
|
||||||
it "template contents" do
|
it 'template contents' do
|
||||||
pending "TODO: implement"
|
pending 'TODO: implement'
|
||||||
end
|
end
|
||||||
|
|
||||||
end
|
end
|
||||||
|
|||||||
@@ -1,62 +1,63 @@
|
|||||||
require "chefspec"
|
# encoding: UTF-8
|
||||||
require "chefspec/berkshelf"
|
require 'chefspec'
|
||||||
|
require 'chefspec/berkshelf'
|
||||||
|
|
||||||
::LOG_LEVEL = :fatal
|
::LOG_LEVEL = :fatal
|
||||||
::REDHAT_OPTS = {
|
::REDHAT_OPTS = {
|
||||||
:platform => "redhat",
|
platform: 'redhat',
|
||||||
:log_level => ::LOG_LEVEL
|
log_level: ::LOG_LEVEL
|
||||||
}
|
}
|
||||||
::UBUNTU_OPTS = {
|
::UBUNTU_OPTS = {
|
||||||
:platform => "ubuntu",
|
platform: 'ubuntu',
|
||||||
:version => "12.04",
|
version: '12.04',
|
||||||
:log_level => ::LOG_LEVEL
|
log_level: ::LOG_LEVEL
|
||||||
}
|
}
|
||||||
|
|
||||||
MOCK_NODE_NETWORK_DATA =
|
MOCK_NODE_NETWORK_DATA =
|
||||||
{
|
{
|
||||||
"ipaddress" => '10.0.0.2',
|
'ipaddress' => '10.0.0.2',
|
||||||
"fqdn" => 'localhost.localdomain',
|
'fqdn' => 'localhost.localdomain',
|
||||||
"hostname" => 'localhost',
|
'hostname' => 'localhost',
|
||||||
"network" => {
|
'network' => {
|
||||||
"default_interface" => "eth0",
|
'default_interface' => 'eth0',
|
||||||
"interfaces" => {
|
'interfaces' => {
|
||||||
"eth0" => {
|
'eth0' => {
|
||||||
"addresses" => {
|
'addresses' => {
|
||||||
"fe80::a00:27ff:feca:ab08" => {"scope" => "Link", "prefixlen" => "64", "family" => "inet6"},
|
'fe80::a00:27ff:feca:ab08' => { 'scope' => 'Link', 'prefixlen' => '64', 'family' => 'inet6' },
|
||||||
"10.0.0.2" => {"netmask" => "255.255.255.0", "broadcast" => "10.0.0.255", "family" => "inet"},
|
'10.0.0.2' => { 'netmask' => '255.255.255.0', 'broadcast' => '10.0.0.255', 'family' => 'inet' },
|
||||||
"08:00:27:CA:AB:08" => {"family" => "lladdr"}
|
'08:00:27:CA:AB:08' => { 'family' => 'lladdr' }
|
||||||
},
|
}
|
||||||
},
|
},
|
||||||
"lo" => {
|
'lo' => {
|
||||||
"addresses" => {
|
'addresses' => {
|
||||||
"::1" => {"scope" => "Node", "prefixlen" => "128", "family" => "inet6"},
|
'::1' => { 'scope' => 'Node', 'prefixlen' => '128', 'family' => 'inet6' },
|
||||||
"127.0.0.1" => {"netmask" => "255.0.0.0", "family" => "inet"}
|
'127.0.0.1' => { 'netmask' => '255.0.0.0', 'family' => 'inet' }
|
||||||
},
|
}
|
||||||
},
|
}
|
||||||
},
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
def swift_stubs
|
# TODO(chrislaco) Fixed in spec refactor
|
||||||
|
def swift_stubs # rubocop:disable MethodLength
|
||||||
stub_command("/usr/bin/id swift").and_return(true)
|
stub_command('/usr/bin/id swift').and_return(true)
|
||||||
stub_command("[ -x /etc/swift/pull-rings.sh ]").and_return(true)
|
stub_command('[ -x /etc/swift/pull-rings.sh ]').and_return(true)
|
||||||
stub_command("[ -f /etc/rsyncd.conf ]").and_return(true)
|
stub_command('[ -f /etc/rsyncd.conf ]').and_return(true)
|
||||||
stub_command("grep -q 'RSYNC_ENABLE=false' /etc/default/rsync").and_return(true)
|
stub_command("grep -q 'RSYNC_ENABLE=false' /etc/default/rsync").and_return(true)
|
||||||
stub_command("[ -e /etc/swift/account-server.conf ] && [ -e /etc/swift/account.ring.gz ]").and_return(true)
|
stub_command('[ -e /etc/swift/account-server.conf ] && [ -e /etc/swift/account.ring.gz ]').and_return(true)
|
||||||
stub_command("[ -e /etc/swift/container-server.conf ] && [ -e /etc/swift/container.ring.gz ]").and_return(true)
|
stub_command('[ -e /etc/swift/container-server.conf ] && [ -e /etc/swift/container.ring.gz ]').and_return(true)
|
||||||
stub_command("[ -e /etc/init/swift-container-sync.conf ]").and_return(false)
|
stub_command('[ -e /etc/init/swift-container-sync.conf ]').and_return(false)
|
||||||
stub_command("[ -e /etc/init.d/swift-container-sync ]").and_return(false)
|
stub_command('[ -e /etc/init.d/swift-container-sync ]').and_return(false)
|
||||||
stub_command("[ -e /etc/swift/object-server.conf ] && [ -e /etc/swift/object.ring.gz ]").and_return(true)
|
stub_command('[ -e /etc/swift/object-server.conf ] && [ -e /etc/swift/object.ring.gz ]').and_return(true)
|
||||||
stub_command("[ -e /etc/swift/proxy-server.conf ] && [ -e /etc/swift/object.ring.gz ]").and_return(true)
|
stub_command('[ -e /etc/swift/proxy-server.conf ] && [ -e /etc/swift/object.ring.gz ]').and_return(true)
|
||||||
|
|
||||||
# create mock cluster
|
# create mock cluster
|
||||||
n = Chef::Node.new()
|
n = Chef::Node.new
|
||||||
n.name('manager')
|
n.name('manager')
|
||||||
n.default_attrs = {
|
n.default_attrs = {
|
||||||
"swift" => {
|
'swift' => {
|
||||||
"service_pass" => "foobar"
|
'service_pass' => 'foobar'
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
Chef::Recipe.any_instance.stub(:search).with(:node, 'chef_environment:_default AND roles:swift-setup').and_return([n])
|
Chef::Recipe.any_instance.stub(:search).with(:node, 'chef_environment:_default AND roles:swift-setup').and_return([n])
|
||||||
end
|
end
|
||||||
|
|||||||
@@ -1,3 +1,4 @@
|
|||||||
|
# encoding: UTF-8
|
||||||
require_relative 'spec_helper'
|
require_relative 'spec_helper'
|
||||||
|
|
||||||
describe 'openstack-object-storage::storage-common' do
|
describe 'openstack-object-storage::storage-common' do
|
||||||
@@ -6,7 +7,7 @@ describe 'openstack-object-storage::storage-common' do
|
|||||||
# UBUNTU
|
# UBUNTU
|
||||||
#-------------------
|
#-------------------
|
||||||
|
|
||||||
describe "ubuntu" do
|
describe 'ubuntu' do
|
||||||
|
|
||||||
before do
|
before do
|
||||||
swift_stubs
|
swift_stubs
|
||||||
@@ -14,43 +15,43 @@ describe 'openstack-object-storage::storage-common' do
|
|||||||
@node = @chef_run.node
|
@node = @chef_run.node
|
||||||
@node.set['lsb']['code'] = 'precise'
|
@node.set['lsb']['code'] = 'precise'
|
||||||
@node.set['swift']['authmode'] = 'swauth'
|
@node.set['swift']['authmode'] = 'swauth'
|
||||||
@chef_run.converge "openstack-object-storage::storage-common"
|
@chef_run.converge 'openstack-object-storage::storage-common'
|
||||||
end
|
end
|
||||||
|
|
||||||
describe "/var/cache/swift" do
|
describe '/var/cache/swift' do
|
||||||
|
|
||||||
before do
|
before do
|
||||||
@file = @chef_run.directory "/var/cache/swift"
|
@file = @chef_run.directory '/var/cache/swift'
|
||||||
end
|
end
|
||||||
|
|
||||||
it "has proper owner" do
|
it 'has proper owner' do
|
||||||
expect(@file.owner).to eq("swift")
|
expect(@file.owner).to eq('swift')
|
||||||
expect(@file.group).to eq("swift")
|
expect(@file.group).to eq('swift')
|
||||||
end
|
end
|
||||||
|
|
||||||
it "has proper modes" do
|
it 'has proper modes' do
|
||||||
expect(sprintf("%o", @file.mode)).to eq "700"
|
expect(sprintf('%o', @file.mode)).to eq '700'
|
||||||
end
|
end
|
||||||
|
|
||||||
end
|
end
|
||||||
|
|
||||||
describe "/etc/swift/drive-audit.conf" do
|
describe '/etc/swift/drive-audit.conf' do
|
||||||
|
|
||||||
before do
|
before do
|
||||||
@file = @chef_run.template "/etc/swift/drive-audit.conf"
|
@file = @chef_run.template '/etc/swift/drive-audit.conf'
|
||||||
end
|
end
|
||||||
|
|
||||||
it "has proper owner" do
|
it 'has proper owner' do
|
||||||
expect(@file.owner).to eq("swift")
|
expect(@file.owner).to eq('swift')
|
||||||
expect(@file.group).to eq("swift")
|
expect(@file.group).to eq('swift')
|
||||||
end
|
end
|
||||||
|
|
||||||
it "has proper modes" do
|
it 'has proper modes' do
|
||||||
expect(sprintf("%o", @file.mode)).to eq "600"
|
expect(sprintf('%o', @file.mode)).to eq '600'
|
||||||
end
|
end
|
||||||
|
|
||||||
it "template contents" do
|
it 'template contents' do
|
||||||
pending "TODO: implement"
|
pending 'TODO: implement'
|
||||||
end
|
end
|
||||||
|
|
||||||
end
|
end
|
||||||
|
|||||||
Reference in New Issue
Block a user