puppet-vswitch/spec/acceptance/basic_vswitch_spec.rb
Takashi Kajinami 8fcd7596e4 vs_bridge: Fix missing external_ids after initial creation
It turned out the external_ids property is not reflected on the ovs
bridge after initial creation. This change fixes it and ensures that
the property is applied to the bridge.

Closes-Bug: #1958905
Change-Id: I7c1c2384b8d70b568caffe8d3cc82002cf2502f6
2022-01-25 08:51:54 +09:00

60 lines
1.4 KiB
Ruby

require 'spec_helper_acceptance'
describe 'basic vswitch' do
context 'default parameters' do
it 'should work with no errors' do
pp= <<-EOS
include openstack_integration
include openstack_integration::repos
include vswitch::ovs
vs_bridge { 'br-ci1':
ensure => present,
}
vs_bridge { 'br-ci2':
ensure => present,
external_ids => 'bridge-id=br-ci2'
}
vs_config { 'external_ids:ovn-remote':
ensure => present,
value => 'tcp:127.0.0.1:2300',
}
EOS
# Run it twice and test for idempotency
apply_manifest(pp, :catch_failures => true)
apply_manifest(pp, :catch_changes => true)
end
it 'should have br-ci1 bridge' do
command('ovs-vsctl show') do |r|
expect(r.stdout).to match(/br-ci1/)
end
end
it 'should have br-ci2 bridge' do
command('ovs-vsctl show') do |r|
expect(r.stdout).to match(/br-ci2/)
end
end
it 'should have external_ids on br-ci2 bridge' do
command('ovs-vsctl br-get-external-id br-ci2') do |r|
expect(r.stdout).to match(/bridge-id=br-ci2/)
end
end
it 'should get remote addr' do
command('ovs-vsctl get Open_vSwitch . external_ids:ovn-remote') do |r|
expect(r.stdout).to match(/\"tcp:127.0.0.1:2300\"/)
end
end
end
end