aboutsummaryrefslogtreecommitdiffstats
path: root/spec
diff options
context:
space:
mode:
Diffstat (limited to 'spec')
-rw-r--r--spec/acceptance/fdio_spec.rb7
-rw-r--r--spec/classes/fdio_spec.rb15
2 files changed, 22 insertions, 0 deletions
diff --git a/spec/acceptance/fdio_spec.rb b/spec/acceptance/fdio_spec.rb
index 4be1865..250de9a 100644
--- a/spec/acceptance/fdio_spec.rb
+++ b/spec/acceptance/fdio_spec.rb
@@ -44,6 +44,8 @@ describe 'fdio' do
vpp_tuntap_enable => true,
vpp_tuntap_mtu => 9000,
vpp_tapcli_mtu => 8000,
+ vpp_exec_commands => 'test line 1',
+ vpp_exec_file => '/etc/vpp/vpp-exec'
}
EOS
@@ -60,6 +62,11 @@ describe 'fdio' do
its(:content) { should match /enable/ }
its(:content) { should match /mtu 9000/ }
its(:content) { should match /mtu 8000/ }
+ its(:content) { should match /\/etc\/vpp\/vpp-exec/ }
+ end
+
+ describe file('/etc/vpp/vpp-exec') do
+ its(:content) { should match /test line 1/ }
end
end
end
diff --git a/spec/classes/fdio_spec.rb b/spec/classes/fdio_spec.rb
index 3b260ca..b543246 100644
--- a/spec/classes/fdio_spec.rb
+++ b/spec/classes/fdio_spec.rb
@@ -101,6 +101,21 @@ describe 'fdio' do
is_expected.to contain_vpp_config('tapcli/mtu').with_value('9000')
end
end
+
+ context 'with exec commands' do
+ before :each do
+ params.merge!(
+ :vpp_exec_commands => ['test line 1', 'test line 2'],
+ :vpp_exec_file => '/etc/vpp/test_exec_file'
+ )
+ end
+ it 'should configure exec lines' do
+ is_expected.to contain_file('/etc/vpp/test_exec_file').with_ensure('present')
+ is_expected.to contain_vpp_config('unix/exec').with_value('/etc/vpp/test_exec_file')
+ is_expected.to contain_fdio__config__vpp_exec_line('test line 1')
+ is_expected.to contain_fdio__config__vpp_exec_line('test line 2')
+ end
+ end
end
shared_examples_for 'fdio - service' do