Disable TSO on all systems
Even on RHEL7 + OSP5, there is an issue on TSO/GSO. So we need to ensure that it's disable also on RHEL7/CentOS7 systems. Signed-off-by: Emilien Macchi <emilien.macchi@enovance.com>
This commit is contained in:
@@ -141,22 +141,28 @@ Host *
|
|||||||
if $has_ceph or $vm_rbd {
|
if $has_ceph or $vm_rbd {
|
||||||
fail('Red Hat does not support RBD backend for VMs.')
|
fail('Red Hat does not support RBD backend for VMs.')
|
||||||
}
|
}
|
||||||
} else {
|
}
|
||||||
# Disabling or not TSO/GSO/GRO on Debian systems
|
|
||||||
if $::kernelmajversion >= '3.14' {
|
# Disabling TSO/GSO/GRO
|
||||||
|
if $::osfamily == 'Debian' {
|
||||||
ensure_resource ('exec','enable-tso-script', {
|
ensure_resource ('exec','enable-tso-script', {
|
||||||
'command' => '/usr/sbin/update-rc.d disable-tso defaults',
|
'command' => '/usr/sbin/update-rc.d disable-tso defaults',
|
||||||
'unless' => '/bin/ls /etc/rc*.d | /bin/grep disable-tso',
|
'unless' => '/bin/ls /etc/rc*.d | /bin/grep disable-tso',
|
||||||
'onlyif' => 'test -f /etc/init.d/disable-tso'
|
'onlyif' => '/usr/bin/test -f /etc/init.d/disable-tso'
|
||||||
})
|
})
|
||||||
|
} elsif $::osfamily == 'RedHat' {
|
||||||
|
ensure_resource ('exec','enable-tso-script', {
|
||||||
|
'command' => '/usr/sbin/chkconfig disable-tso on',
|
||||||
|
'unless' => '/bin/ls /etc/rc*.d | /bin/grep disable-tso',
|
||||||
|
'onlyif' => '/usr/bin/test -f /etc/init.d/disable-tso'
|
||||||
|
})
|
||||||
|
}
|
||||||
ensure_resource ('exec','start-tso-script', {
|
ensure_resource ('exec','start-tso-script', {
|
||||||
'command' => '/etc/init.d/disable-tso start',
|
'command' => '/etc/init.d/disable-tso start',
|
||||||
'unless' => 'test -f /tmp/disable-tso-lock',
|
'unless' => '/usr/bin/test -f /tmp/disable-tso-lock',
|
||||||
'onlyif' => 'test -f /etc/init.d/disable-tso'
|
'onlyif' => '/usr/bin/test -f /etc/init.d/disable-tso'
|
||||||
})
|
})
|
||||||
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
if $::operatingsystem == 'Ubuntu' {
|
if $::operatingsystem == 'Ubuntu' {
|
||||||
service { 'dbus':
|
service { 'dbus':
|
||||||
|
|||||||
@@ -46,18 +46,24 @@ class cloud::network::l3(
|
|||||||
debug => $debug,
|
debug => $debug,
|
||||||
}
|
}
|
||||||
|
|
||||||
# Disabling or not TSO/GSO/GRO on Debian systems
|
# Disabling TSO/GSO/GRO
|
||||||
if $::osfamily == 'Debian' and $::kernelmajversion >= '3.14' {
|
if $::osfamily == 'Debian' {
|
||||||
ensure_resource ('exec','enable-tso-script', {
|
ensure_resource ('exec','enable-tso-script', {
|
||||||
'command' => '/usr/sbin/update-rc.d disable-tso defaults',
|
'command' => '/usr/sbin/update-rc.d disable-tso defaults',
|
||||||
'unless' => '/bin/ls /etc/rc*.d | /bin/grep disable-tso',
|
'unless' => '/bin/ls /etc/rc*.d | /bin/grep disable-tso',
|
||||||
'onlyif' => 'test -f /etc/init.d/disable-tso'
|
'onlyif' => '/usr/bin/test -f /etc/init.d/disable-tso'
|
||||||
})
|
})
|
||||||
ensure_resource ('exec','start-tso-script', {
|
} elsif $::osfamily == 'RedHat' {
|
||||||
'command' => '/etc/init.d/disable-tso start',
|
ensure_resource ('exec','enable-tso-script', {
|
||||||
'unless' => 'test -f /tmp/disable-tso-lock',
|
'command' => '/usr/sbin/chkconfig disable-tso on',
|
||||||
'onlyif' => 'test -f /etc/init.d/disable-tso'
|
'unless' => '/bin/ls /etc/rc*.d | /bin/grep disable-tso',
|
||||||
|
'onlyif' => '/usr/bin/test -f /etc/init.d/disable-tso'
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
|
ensure_resource ('exec','start-tso-script', {
|
||||||
|
'command' => '/etc/init.d/disable-tso start',
|
||||||
|
'unless' => '/usr/bin/test -f /tmp/disable-tso-lock',
|
||||||
|
'onlyif' => '/usr/bin/test -f /etc/init.d/disable-tso'
|
||||||
|
})
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -276,37 +276,43 @@ describe 'cloud::compute::hypervisor' do
|
|||||||
facts.merge!( :osfamily => 'Debian',
|
facts.merge!( :osfamily => 'Debian',
|
||||||
:operatingsystem => 'Debian',
|
:operatingsystem => 'Debian',
|
||||||
:vtx => true,
|
:vtx => true,
|
||||||
:kernelmajversion => '3.14',
|
|
||||||
:concat_basedir => '/var/lib/puppet/concat' )
|
:concat_basedir => '/var/lib/puppet/concat' )
|
||||||
end
|
end
|
||||||
it 'ensure TSO script is enabled at boot' do
|
it 'ensure TSO script is enabled at boot' do
|
||||||
should contain_exec('enable-tso-script').with(
|
should contain_exec('enable-tso-script').with(
|
||||||
:command => '/usr/sbin/update-rc.d disable-tso defaults',
|
:command => '/usr/sbin/update-rc.d disable-tso defaults',
|
||||||
:unless => '/bin/ls /etc/rc*.d | /bin/grep disable-tso',
|
:unless => '/bin/ls /etc/rc*.d | /bin/grep disable-tso',
|
||||||
:onlyif => 'test -f /etc/init.d/disable-tso'
|
:onlyif => '/usr/bin/test -f /etc/init.d/disable-tso'
|
||||||
)
|
)
|
||||||
end
|
end
|
||||||
it 'start TSO script' do
|
it 'start TSO script' do
|
||||||
should contain_exec('start-tso-script').with(
|
should contain_exec('start-tso-script').with(
|
||||||
:command => '/etc/init.d/disable-tso start',
|
:command => '/etc/init.d/disable-tso start',
|
||||||
:unless => 'test -f /tmp/disable-tso-lock',
|
:unless => '/usr/bin/test -f /tmp/disable-tso-lock',
|
||||||
:onlyif => 'test -f /etc/init.d/disable-tso'
|
:onlyif => '/usr/bin/test -f /etc/init.d/disable-tso'
|
||||||
)
|
)
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
context 'ensure TSO/GSO/GRO is not managed on Debian systems with kernel < 3.14' do
|
context 'without TSO/GSO/GRO on Red Hat systems' do
|
||||||
before :each do
|
before :each do
|
||||||
facts.merge!( :osfamily => 'Debian',
|
facts.merge!( :osfamily => 'RedHat',
|
||||||
:vtx => true,
|
:vtx => true,
|
||||||
:kernelmajversion => '3.12' )
|
:concat_basedir => '/var/lib/puppet/concat' )
|
||||||
end
|
end
|
||||||
|
it 'ensure TSO script is enabled at boot' do
|
||||||
it 'ensure TSO script is not enabled at boot' do
|
should contain_exec('enable-tso-script').with(
|
||||||
should_not contain_exec('enable-tso-script')
|
:command => '/usr/sbin/chkconfig disable-tso on',
|
||||||
|
:unless => '/bin/ls /etc/rc*.d | /bin/grep disable-tso',
|
||||||
|
:onlyif => '/usr/bin/test -f /etc/init.d/disable-tso'
|
||||||
|
)
|
||||||
end
|
end
|
||||||
it 'do no tstart TSO script' do
|
it 'start TSO script' do
|
||||||
should_not contain_exec('start-tso-script')
|
should contain_exec('start-tso-script').with(
|
||||||
|
:command => '/etc/init.d/disable-tso start',
|
||||||
|
:unless => '/usr/bin/test -f /tmp/disable-tso-lock',
|
||||||
|
:onlyif => '/usr/bin/test -f /etc/init.d/disable-tso'
|
||||||
|
)
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
|
|||||||
@@ -152,41 +152,47 @@ describe 'cloud::network::l3' do
|
|||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
context 'without TSO/GSO/GRO on Debian systems with 3.14 kernel' do
|
context 'without TSO/GSO/GRO on Red Hat systems' do
|
||||||
before :each do
|
before :each do
|
||||||
facts.merge!( :osfamily => 'Debian',
|
facts.merge!( :osfamily => 'RedHat')
|
||||||
:kernelmajversion => '3.14' )
|
end
|
||||||
|
|
||||||
|
it 'ensure TSO script is enabled at boot' do
|
||||||
|
should contain_exec('enable-tso-script').with(
|
||||||
|
:command => '/usr/sbin/chkconfig disable-tso on',
|
||||||
|
:unless => '/bin/ls /etc/rc*.d | /bin/grep disable-tso',
|
||||||
|
:onlyif => '/usr/bin/test -f /etc/init.d/disable-tso'
|
||||||
|
)
|
||||||
|
end
|
||||||
|
it 'start TSO script' do
|
||||||
|
should contain_exec('start-tso-script').with(
|
||||||
|
:command => '/etc/init.d/disable-tso start',
|
||||||
|
:unless => '/usr/bin/test -f /tmp/disable-tso-lock',
|
||||||
|
:onlyif => '/usr/bin/test -f /etc/init.d/disable-tso'
|
||||||
|
)
|
||||||
|
end
|
||||||
|
end
|
||||||
|
|
||||||
|
context 'without TSO/GSO/GRO on Debian systems' do
|
||||||
|
before :each do
|
||||||
|
facts.merge!( :osfamily => 'Debian')
|
||||||
end
|
end
|
||||||
|
|
||||||
it 'ensure TSO script is enabled at boot' do
|
it 'ensure TSO script is enabled at boot' do
|
||||||
should contain_exec('enable-tso-script').with(
|
should contain_exec('enable-tso-script').with(
|
||||||
:command => '/usr/sbin/update-rc.d disable-tso defaults',
|
:command => '/usr/sbin/update-rc.d disable-tso defaults',
|
||||||
:unless => '/bin/ls /etc/rc*.d | /bin/grep disable-tso',
|
:unless => '/bin/ls /etc/rc*.d | /bin/grep disable-tso',
|
||||||
:onlyif => 'test -f /etc/init.d/disable-tso'
|
:onlyif => '/usr/bin/test -f /etc/init.d/disable-tso'
|
||||||
)
|
)
|
||||||
end
|
end
|
||||||
it 'start TSO script' do
|
it 'start TSO script' do
|
||||||
should contain_exec('start-tso-script').with(
|
should contain_exec('start-tso-script').with(
|
||||||
:command => '/etc/init.d/disable-tso start',
|
:command => '/etc/init.d/disable-tso start',
|
||||||
:unless => 'test -f /tmp/disable-tso-lock',
|
:unless => '/usr/bin/test -f /tmp/disable-tso-lock',
|
||||||
:onlyif => 'test -f /etc/init.d/disable-tso'
|
:onlyif => '/usr/bin/test -f /etc/init.d/disable-tso'
|
||||||
)
|
)
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
context 'ensure TSO/GSO/GRO is not managed on Debian systems with kernel < 3.14' do
|
|
||||||
before :each do
|
|
||||||
facts.merge!( :osfamily => 'Debian',
|
|
||||||
:kernelmajversion => '3.12' )
|
|
||||||
end
|
|
||||||
|
|
||||||
it 'ensure TSO script is not enabled at boot' do
|
|
||||||
should_not contain_exec('enable-tso-script')
|
|
||||||
end
|
|
||||||
it 'do no tstart TSO script' do
|
|
||||||
should_not contain_exec('start-tso-script')
|
|
||||||
end
|
|
||||||
end
|
|
||||||
end
|
end
|
||||||
|
|
||||||
context 'on Debian platforms' do
|
context 'on Debian platforms' do
|
||||||
|
|||||||
Reference in New Issue
Block a user