Commit c24e113b authored by Christopher Huhn's avatar Christopher Huhn
Browse files

Add some chefspec and fix package installation error

parent 13559db2
......@@ -4,7 +4,7 @@ maintainer_email "hpc@gsi.de"
license "Apache 2.0"
description "Deploy and configure CernVM-FS clients and servers."
long_description IO.read(File.join(File.dirname(__FILE__), 'README.md'))
version "0.1.7"
version "0.1.8"
depends "sys"
depends "apache2"
supports "debian", ">= 7.0"
......@@ -16,11 +16,10 @@
# limitations under the License.
# Install from source if a specific version is defined
if node[:cvmfs][:version]
unless node[:cvmfs][:version].empty?
include_recipe 'cernvm-fs::install'
# Otherwise it is assumed a package can be installed
else
# Otherwise it is assumed a package can be installed
case node[:platform_version]
when /^7/
if node[:cvmfs][:server][:repos].empty?
......
require 'chefspec'
describe 'cernvm-fs::default' do
context 'with version attribute' do
let(:chef_run) do
ChefSpec::SoloRunner.new do |node|
node.set['cvmfs']['version' ] = '1.2.3'
end.converge(described_recipe)
end
it 'includes cernvm-fs::install' do
expect(chef_run).to include_recipe('cernvm-fs::install')
end
end
context 'client on Debian' do
let(:chef_run) do
ChefSpec::SoloRunner.new(
platform: 'debian',
version: '8.0').converge(described_recipe)
end
it 'installs cvmfs-client' do
expect(chef_run).to install_package('cvmfs-client')
end
end
context 'client on Debian' do
let(:chef_run) do
ChefSpec::SoloRunner.new(
platform: 'debian',
version: '8.0').converge(described_recipe)
end
it 'includes cernvm-fs::client' do
expect(chef_run).to include_recipe('cernvm-fs::client')
end
end
context 'server on Debian Wheezy' do
let(:chef_run) do
ChefSpec::SoloRunner.new(platform: 'debian', version: '7.0') do |node|
node.set['cvmfs']['server']['repos'] = [ 'test.example.com' ]
end.converge(described_recipe)
end
it 'installs cvmfs-client' do
expect(chef_run).to install_package('cvmfs')
end
it 'includes cernvm-fs::server' do
expect(chef_run).to include_recipe('cernvm-fs::server')
end
end
end
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment