Use the bond Chef InSpec audit resource to test a logical, bonded network interface (i.e. “two or more network interfaces aggregated into a single, logical network interface”). On Linux platforms, any value in the /proc/net/bonding directory may be tested.
This resource is distributed along with Chef InSpec itself. You can use it automatically.
This resource first became available in v1.0.0 of InSpec.
A bond resource block declares a bonded network interface, and then specifies the properties of that bonded network interface to be tested:
describe bond('name') do
it { should exist }
end
where
'name' is the name of the bonded network interface{ should exist } is a valid matcher for this resourceThe content property returns the contents in the file that defines the bonded network interface. The values of the content property are arbitrary.
its('content') { should match('value') }
The interfaces property tests if the named secondary interfaces are available.
its('interfaces') { should eq ['eth0', 'eth1', ...] }
The mode property returns the Bonding Mode.
its('mode') { should eq 'IEEE 802.3ad Dynamic link aggregation' }
The params property returns arbitrary parameters for the bonded network interface.
its('params') { should eq 'value' }
describe bond('bond0') do
it { should exist }
it { should have_interface 'eth0' }
end
describe bond('bond0') do
its('mode') { should eq 'IEEE 802.3ad Dynamic link aggregation' }
its('params') { should have_key 'Transmit Hash Policy' }
its('params') { should include 'Transmit Hash Policy' => 'layer3+4 (1)' }
its('params') { should have_key 'MII Status' }
its('params') { should include 'MII Status' => 'up' }
end
For a full list of available matchers, please visit our matchers page.
The exist matcher tests if the bonded network interface is available:
it { should exist }
The have_interface matcher tests if the bonded network interface has one (or more) secondary interfaces:
it { should have_interface }
© Chef Software, Inc.
Licensed under the Creative Commons Attribution 3.0 Unported License.
The Chef™ Mark and Chef Logo are either registered trademarks/service marks or trademarks/servicemarks of Chef, in the United States and other countries and are used with Chef Inc's permission.
We are not affiliated with, endorsed or sponsored by Chef Inc.
https://docs.chef.io/inspec/resources/bond/