forked from ytti/oxidized
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathcumulus_spec.rb
44 lines (35 loc) · 1.58 KB
/
cumulus_spec.rb
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
require_relative 'model_helper'
describe 'Model Cumulus' do
before(:each) do
init_model_helper
end
it 'runs on MSN2010 with Cumulus Linux 5.9.2 (nvue mode)' do
# Reload node with vars cumulus_use_nvue set
@node = Oxidized::Node.new(name: 'example.com',
input: 'ssh',
model: 'cumulus',
vars: { cumulus_use_nvue: true })
model = YAML.load_file('spec/model/data/cumulus:MSN2010_5.9.2_nvue:custom_simulation.yaml')
mockmodel = MockSsh.new(model)
Net::SSH.stubs(:start).returns mockmodel
status, result = @node.run
_(status).must_equal :success
_(result.to_cfg).must_equal mockmodel.interpolate_yaml(model['oxidized_output'])
end
it 'runs on VX with Cumulus Linux 5.4.0 (frr mode)' do
# Reload node with vars cumulus_use_nvue set
@node = Oxidized::Node.new(name: 'example.com',
input: 'ssh',
model: 'cumulus',
username: 'alma',
password: 'armud',
vars: { cumulus_routing_daemon: 'frr',
enable: true })
model = YAML.load_file('spec/model/data/cumulus:VX_5.4.0_frr:custom_simulation.yaml')
mockmodel = MockSsh.new(model)
Net::SSH.stubs(:start).returns mockmodel
status, result = @node.run
_(status).must_equal :success
_(result.to_cfg).must_equal mockmodel.interpolate_yaml(model['oxidized_output'])
end
end