- Move to use a single .rubocop.yml file - Adjust Strainerfile to use single .rubocop.yml file - Ensure all spec files are rubocop compliant Addresses: blueprint rubocop-for-common Change-Id: I550c50c55edd4725782385de2c0f66bedff3004e
		
			
				
	
	
		
			38 lines
		
	
	
		
			964 B
		
	
	
	
		
			Ruby
		
	
	
	
	
	
			
		
		
	
	
			38 lines
		
	
	
		
			964 B
		
	
	
	
		
			Ruby
		
	
	
	
	
	
# encoding: UTF-8
 | 
						|
 | 
						|
require_relative 'spec_helper'
 | 
						|
 | 
						|
describe 'openstack-common::sysctl' do
 | 
						|
  describe 'ubuntu' do
 | 
						|
    before do
 | 
						|
      @chef_run = ::ChefSpec::Runner.new ::UBUNTU_OPTS
 | 
						|
      @chef_run.converge 'openstack-common::sysctl'
 | 
						|
    end
 | 
						|
 | 
						|
    describe '60-openstack.conf' do
 | 
						|
      before do
 | 
						|
        @file = @chef_run.template '/etc/sysctl.d/60-openstack.conf'
 | 
						|
      end
 | 
						|
 | 
						|
      it 'has proper owner' do
 | 
						|
        expect(@file.owner).to eq('root')
 | 
						|
        expect(@file.group).to eq('root')
 | 
						|
      end
 | 
						|
 | 
						|
      it 'has proper modes' do
 | 
						|
        expect(sprintf('%o', @file.mode)).to eq '644'
 | 
						|
      end
 | 
						|
 | 
						|
      it 'sets the all.rp_filter' do
 | 
						|
        match = 'net.ipv4.conf.all.rp_filter = 0'
 | 
						|
        expect(@chef_run).to render_file(@file.name).with_content(match)
 | 
						|
      end
 | 
						|
 | 
						|
      it 'sets the default.rp_filter' do
 | 
						|
        match = 'net.ipv4.conf.default.rp_filter = 0'
 | 
						|
        expect(@chef_run).to render_file(@file.name).with_content(match)
 | 
						|
      end
 | 
						|
    end
 | 
						|
  end
 | 
						|
end
 |