1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
|
require 'spec_helper_acceptance'
describe 'fdio' do
context 'default parameters' do
it 'should work with no errors' do
pp= <<-EOS
class { '::fdio':
repo_branch => 'stable.1707'
}
EOS
apply_manifest(pp, :catch_failures => true)
apply_manifest(pp, :catch_changes => true)
end
describe package('vpp') do
it { should be_installed }
end
describe file('/etc/vpp/startup.conf') do
it { is_expected.to exist }
its(:content) { should match /uio-driver\s+uio_pci_generic/ }
end
describe service('vpp') do
it { should be_running }
it { should be_enabled }
end
end
context 'with options' do
it 'should work with no errors' do
pp= <<-EOS
class { '::fdio':
repo_branch => 'stable.1707',
vpp_cpu_main_core => '1',
vpp_cpu_corelist_workers => '2',
vpp_vhostuser_coalesce_frames => 32,
vpp_vhostuser_coalesce_time => 0.05,
vpp_vhostuser_dont_dump_memory => true,
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
apply_manifest(pp, :catch_failures => true)
apply_manifest(pp, :catch_changes => true)
end
describe file('/etc/vpp/startup.conf') do
its(:content) { should match /main-core\s+1/ }
its(:content) { should match /corelist-workers\s+2/ }
its(:content) { should match /coalesce-frames\s+32/ }
its(:content) { should match /coalesce-time\s+0.05/ }
its(:content) { should match /dont-dump-memory/ }
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
|