rbeapi 0.3.0 → 0.4.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (39) hide show
  1. data/CHANGELOG.md +16 -0
  2. data/Gemfile +3 -1
  3. data/Guardfile +2 -2
  4. data/README.md +35 -24
  5. data/Rakefile +48 -18
  6. data/gems/inifile/inifile.spec.tmpl +50 -14
  7. data/gems/net_http_unix/net_http_unix.spec.tmpl +48 -15
  8. data/gems/netaddr/netaddr.spec.tmpl +47 -14
  9. data/lib/rbeapi/api/bgp.rb +100 -4
  10. data/lib/rbeapi/api/interfaces.rb +4 -5
  11. data/lib/rbeapi/api/radius.rb +1 -1
  12. data/lib/rbeapi/api/routemaps.rb +405 -37
  13. data/lib/rbeapi/api/system.rb +21 -0
  14. data/lib/rbeapi/api/users.rb +361 -0
  15. data/lib/rbeapi/api/varp.rb +50 -22
  16. data/lib/rbeapi/api/vrrp.rb +1072 -0
  17. data/lib/rbeapi/client.rb +12 -4
  18. data/lib/rbeapi/eapilib.rb +1 -1
  19. data/lib/rbeapi/version.rb +1 -1
  20. data/rbeapi.spec.tmpl +57 -25
  21. data/spec/system/rbeapi/api/dns_spec.rb +2 -2
  22. data/spec/system/rbeapi/api/routemaps_spec.rb +344 -0
  23. data/spec/system/rbeapi/api/switchports_spec.rb +1 -1
  24. data/spec/system/rbeapi/api/system_spec.rb +44 -4
  25. data/spec/system/{api_varp_interfaces_spec.rb → rbeapi/api/varp_interfaces_spec.rb} +25 -16
  26. data/spec/system/rbeapi/api/varp_spec.rb +76 -0
  27. data/spec/unit/rbeapi/api/bgp/bgp_neighbors_spec.rb +2 -0
  28. data/spec/unit/rbeapi/api/bgp/bgp_spec.rb +54 -1
  29. data/spec/unit/rbeapi/api/interfaces/portchannel_spec.rb +1 -1
  30. data/spec/unit/rbeapi/api/routemaps/default_spec.rb +370 -0
  31. data/spec/unit/rbeapi/api/routemaps/fixture_routemaps.text +27 -0
  32. data/spec/unit/rbeapi/api/system/default_spec.rb +102 -0
  33. data/spec/unit/rbeapi/api/system/fixture_system.text +2 -0
  34. data/spec/unit/rbeapi/api/users/default_spec.rb +280 -0
  35. data/spec/unit/rbeapi/api/users/fixture_users.text +4 -0
  36. data/spec/unit/rbeapi/api/vrrp/default_spec.rb +582 -0
  37. data/spec/unit/rbeapi/api/vrrp/fixture_vrrp.text +186 -0
  38. metadata +28 -8
  39. data/spec/system/api_varp_spec.rb +0 -41
@@ -0,0 +1,186 @@
1
+ interface Vlan100
2
+ no description
3
+ no shutdown
4
+ default load-interval
5
+ mtu 1500
6
+ logging event link-status use-global
7
+ autostate
8
+ no private-vlan mapping
9
+ snmp trap link-status
10
+ no ip proxy-arp
11
+ no ip local-proxy-arp
12
+ ip address 10.10.4.2/24
13
+ no ip verify unicast
14
+ default arp timeout 14400
15
+ default ipv6 nd cache expire 14400
16
+ bfd interval 300 min_rx 300 multiplier 3
17
+ no bfd echo
18
+ default ip dhcp smart-relay
19
+ no ip helper-address
20
+ no ipv6 dhcp relay destination
21
+ ip dhcp relay information option circuit-id Vlan100
22
+ no ip igmp
23
+ ip igmp version 3
24
+ ip igmp last-member-query-count 2
25
+ ip igmp last-member-query-interval 10
26
+ ip igmp query-max-response-time 100
27
+ ip igmp query-interval 125
28
+ ip igmp startup-query-count 2
29
+ ip igmp startup-query-interval 310
30
+ ip igmp router-alert optional connected
31
+ ip igmp host-proxy
32
+ no ip igmp host-proxy report-interval
33
+ ip igmp host-proxy version 3
34
+ no ip igmp host-proxy
35
+ no ipv6 enable
36
+ no ipv6 address
37
+ no ipv6 verify unicast
38
+ no ipv6 nd ra suppress
39
+ ipv6 nd ra interval msec 200000
40
+ ipv6 nd ra lifetime 1800
41
+ no ipv6 nd ra mtu suppress
42
+ no ipv6 nd managed-config-flag
43
+ no ipv6 nd other-config-flag
44
+ ipv6 nd reachable-time 0
45
+ ipv6 nd router-preference medium
46
+ ipv6 nd ra dns-servers lifetime 300
47
+ ipv6 nd ra dns-suffixes lifetime 300
48
+ ipv6 nd ra hop-limit 64
49
+ ip mfib fastdrop
50
+ default ntp serve
51
+ no ip pim sparse-mode
52
+ no ip pim border-router
53
+ ip pim query-interval 30
54
+ ip pim join-prune-interval 60
55
+ ip pim dr-priority 1
56
+ no ip pim neighbor-filter
57
+ default ip pim bfd-instance
58
+ no ip pim bsr-border
59
+ no ip virtual address
60
+ vrrp 10 priority 100
61
+ vrrp 10 timers advertise 1
62
+ vrrp 10 mac-address advertisement-interval 30
63
+ no vrrp 10 preempt
64
+ vrrp 10 preempt delay minimum 0
65
+ vrrp 10 preempt delay reload 0
66
+ vrrp 10 delay reload 0
67
+ no vrrp 10 authentication
68
+ vrrp 10 ip 10.10.4.10
69
+ vrrp 10 ip 1.2.3.4 secondary
70
+ vrrp 10 ip 10.10.4.4 secondary
71
+ vrrp 10 ipv6 ::
72
+ no vrrp 10 description
73
+ no vrrp 10 shutdown
74
+ no vrrp 10 bfd ip
75
+ no vrrp 10 bfd ipv6
76
+ vrrp 10 ip version 2
77
+ vrrp 20 priority 200
78
+ vrrp 20 timers advertise 1
79
+ vrrp 20 mac-address advertisement-interval 30
80
+ no vrrp 20 preempt
81
+ vrrp 20 preempt delay minimum 0
82
+ vrrp 20 preempt delay reload 0
83
+ vrrp 20 delay reload 0
84
+ no vrrp 20 authentication
85
+ vrrp 20 ip 10.10.4.20
86
+ vrrp 20 ipv6 ::
87
+ no vrrp 20 description
88
+ no vrrp 20 shutdown
89
+ no vrrp 20 bfd ip
90
+ no vrrp 20 bfd ipv6
91
+ vrrp 20 ip version 2
92
+ !
93
+ interface Vlan150
94
+ no description
95
+ no shutdown
96
+ default load-interval
97
+ mtu 1500
98
+ logging event link-status use-global
99
+ autostate
100
+ no private-vlan mapping
101
+ snmp trap link-status
102
+ no ip proxy-arp
103
+ no ip local-proxy-arp
104
+ ip address 40.10.5.8/24
105
+ no ip verify unicast
106
+ default arp timeout 14400
107
+ default ipv6 nd cache expire 14400
108
+ bfd interval 300 min_rx 300 multiplier 3
109
+ no bfd echo
110
+ default ip dhcp smart-relay
111
+ no ip helper-address
112
+ no ipv6 dhcp relay destination
113
+ ip dhcp relay information option circuit-id Vlan150
114
+ no ip igmp
115
+ ip igmp version 3
116
+ ip igmp last-member-query-count 2
117
+ ip igmp last-member-query-interval 10
118
+ ip igmp query-max-response-time 100
119
+ ip igmp query-interval 125
120
+ ip igmp startup-query-count 2
121
+ ip igmp startup-query-interval 310
122
+ ip igmp router-alert optional connected
123
+ ip igmp host-proxy
124
+ no ip igmp host-proxy report-interval
125
+ ip igmp host-proxy version 3
126
+ no ip igmp host-proxy
127
+ no ipv6 enable
128
+ no ipv6 address
129
+ no ipv6 verify unicast
130
+ no ipv6 nd ra suppress
131
+ ipv6 nd ra interval msec 200000
132
+ ipv6 nd ra lifetime 1800
133
+ no ipv6 nd ra mtu suppress
134
+ no ipv6 nd managed-config-flag
135
+ no ipv6 nd other-config-flag
136
+ ipv6 nd reachable-time 0
137
+ ipv6 nd router-preference medium
138
+ ipv6 nd ra dns-servers lifetime 300
139
+ ipv6 nd ra dns-suffixes lifetime 300
140
+ ipv6 nd ra hop-limit 64
141
+ ip mfib fastdrop
142
+ default ntp serve
143
+ no ip pim sparse-mode
144
+ no ip pim border-router
145
+ ip pim query-interval 30
146
+ ip pim join-prune-interval 60
147
+ ip pim dr-priority 1
148
+ no ip pim neighbor-filter
149
+ default ip pim bfd-instance
150
+ no ip pim bsr-border
151
+ no ip virtual address
152
+ vrrp 30 priority 100
153
+ vrrp 30 timers advertise 1
154
+ vrrp 30 mac-address advertisement-interval 30
155
+ no vrrp 30 preempt
156
+ vrrp 30 preempt delay minimum 0
157
+ vrrp 30 preempt delay reload 0
158
+ vrrp 30 delay reload 0
159
+ no vrrp 30 authentication
160
+ vrrp 30 ip 40.10.5.31
161
+ vrrp 30 ipv6 ::
162
+ vrrp 30 description The description
163
+ vrrp 30 shutdown
164
+ vrrp 30 track Ethernet1 decrement 5
165
+ no vrrp 30 bfd ip
166
+ no vrrp 30 bfd ipv6
167
+ vrrp 30 ip version 2
168
+ vrrp 40 priority 200
169
+ vrrp 40 timers advertise 1
170
+ vrrp 40 mac-address advertisement-interval 30
171
+ vrrp 40 preempt
172
+ vrrp 40 preempt delay minimum 0
173
+ vrrp 40 preempt delay reload 0
174
+ vrrp 40 delay reload 0
175
+ no vrrp 40 authentication
176
+ vrrp 40 ip 40.10.5.32
177
+ vrrp 40 ipv6 ::
178
+ no vrrp 40 description
179
+ no vrrp 40 shutdown
180
+ vrrp 40 track Ethernet3 decrement 33
181
+ vrrp 40 track Ethernet2 decrement 22
182
+ vrrp 40 track Ethernet2 shutdown
183
+ no vrrp 40 bfd ip
184
+ no vrrp 40 bfd ipv6
185
+ vrrp 40 ip version 2
186
+ !
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: rbeapi
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.3.0
4
+ version: 0.4.0
5
5
  prerelease:
6
6
  platform: ruby
7
7
  authors:
@@ -9,7 +9,7 @@ authors:
9
9
  autorequire:
10
10
  bindir: bin
11
11
  cert_chain: []
12
- date: 2015-08-24 00:00:00.000000000 Z
12
+ date: 2015-11-21 00:00:00.000000000 Z
13
13
  dependencies:
14
14
  - !ruby/object:Gem::Dependency
15
15
  name: inifile
@@ -232,8 +232,10 @@ files:
232
232
  - lib/rbeapi/api/switchports.rb
233
233
  - lib/rbeapi/api/system.rb
234
234
  - lib/rbeapi/api/tacacs.rb
235
+ - lib/rbeapi/api/users.rb
235
236
  - lib/rbeapi/api/varp.rb
236
237
  - lib/rbeapi/api/vlans.rb
238
+ - lib/rbeapi/api/vrrp.rb
237
239
  - lib/rbeapi/client.rb
238
240
  - lib/rbeapi/eapilib.rb
239
241
  - lib/rbeapi/netdev/snmp.rb
@@ -248,8 +250,6 @@ files:
248
250
  - spec/system/api_acl_spec.rb
249
251
  - spec/system/api_ospf_interfaces_spec.rb
250
252
  - spec/system/api_ospf_spec.rb
251
- - spec/system/api_varp_interfaces_spec.rb
252
- - spec/system/api_varp_spec.rb
253
253
  - spec/system/rbeapi/api/dns_spec.rb
254
254
  - spec/system/rbeapi/api/interfaces_base_spec.rb
255
255
  - spec/system/rbeapi/api/interfaces_ethernet_spec.rb
@@ -260,12 +260,15 @@ files:
260
260
  - spec/system/rbeapi/api/mlag_interfaces_spec.rb
261
261
  - spec/system/rbeapi/api/mlag_spec.rb
262
262
  - spec/system/rbeapi/api/ntp_spec.rb
263
+ - spec/system/rbeapi/api/routemaps_spec.rb
263
264
  - spec/system/rbeapi/api/snmp_spec.rb
264
265
  - spec/system/rbeapi/api/stp_instances_spec.rb
265
266
  - spec/system/rbeapi/api/stp_interfaces_spec.rb
266
267
  - spec/system/rbeapi/api/stp_spec.rb
267
268
  - spec/system/rbeapi/api/switchports_spec.rb
268
269
  - spec/system/rbeapi/api/system_spec.rb
270
+ - spec/system/rbeapi/api/varp_interfaces_spec.rb
271
+ - spec/system/rbeapi/api/varp_spec.rb
269
272
  - spec/system/rbeapi/api/vlans_spec.rb
270
273
  - spec/unit/rbeapi/api/acl/default_spec.rb
271
274
  - spec/unit/rbeapi/api/acl/fixture_acl_standard.text
@@ -279,10 +282,18 @@ files:
279
282
  - spec/unit/rbeapi/api/interfaces/vxlan_spec.rb
280
283
  - spec/unit/rbeapi/api/mlag/default_spec.rb
281
284
  - spec/unit/rbeapi/api/mlag/fixture_mlag.text
285
+ - spec/unit/rbeapi/api/routemaps/default_spec.rb
286
+ - spec/unit/rbeapi/api/routemaps/fixture_routemaps.text
282
287
  - spec/unit/rbeapi/api/staticroutes/default_spec.rb
283
288
  - spec/unit/rbeapi/api/staticroutes/fixture_staticroutes.text
289
+ - spec/unit/rbeapi/api/system/default_spec.rb
290
+ - spec/unit/rbeapi/api/system/fixture_system.text
291
+ - spec/unit/rbeapi/api/users/default_spec.rb
292
+ - spec/unit/rbeapi/api/users/fixture_users.text
284
293
  - spec/unit/rbeapi/api/vlans/default_spec.rb
285
294
  - spec/unit/rbeapi/api/vlans/fixture_vlans.text
295
+ - spec/unit/rbeapi/api/vrrp/default_spec.rb
296
+ - spec/unit/rbeapi/api/vrrp/fixture_vrrp.text
286
297
  homepage: https://github.com/arista-eosplus/rbeapi
287
298
  licenses:
288
299
  - New BSD
@@ -298,7 +309,7 @@ required_ruby_version: !ruby/object:Gem::Requirement
298
309
  version: '0'
299
310
  segments:
300
311
  - 0
301
- hash: -1143951047580431806
312
+ hash: -4459754643006695547
302
313
  required_rubygems_version: !ruby/object:Gem::Requirement
303
314
  none: false
304
315
  requirements:
@@ -307,7 +318,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
307
318
  version: '0'
308
319
  segments:
309
320
  - 0
310
- hash: -1143951047580431806
321
+ hash: -4459754643006695547
311
322
  requirements: []
312
323
  rubyforge_project:
313
324
  rubygems_version: 1.8.23
@@ -322,8 +333,6 @@ test_files:
322
333
  - spec/system/api_acl_spec.rb
323
334
  - spec/system/api_ospf_interfaces_spec.rb
324
335
  - spec/system/api_ospf_spec.rb
325
- - spec/system/api_varp_interfaces_spec.rb
326
- - spec/system/api_varp_spec.rb
327
336
  - spec/system/rbeapi/api/dns_spec.rb
328
337
  - spec/system/rbeapi/api/interfaces_base_spec.rb
329
338
  - spec/system/rbeapi/api/interfaces_ethernet_spec.rb
@@ -334,12 +343,15 @@ test_files:
334
343
  - spec/system/rbeapi/api/mlag_interfaces_spec.rb
335
344
  - spec/system/rbeapi/api/mlag_spec.rb
336
345
  - spec/system/rbeapi/api/ntp_spec.rb
346
+ - spec/system/rbeapi/api/routemaps_spec.rb
337
347
  - spec/system/rbeapi/api/snmp_spec.rb
338
348
  - spec/system/rbeapi/api/stp_instances_spec.rb
339
349
  - spec/system/rbeapi/api/stp_interfaces_spec.rb
340
350
  - spec/system/rbeapi/api/stp_spec.rb
341
351
  - spec/system/rbeapi/api/switchports_spec.rb
342
352
  - spec/system/rbeapi/api/system_spec.rb
353
+ - spec/system/rbeapi/api/varp_interfaces_spec.rb
354
+ - spec/system/rbeapi/api/varp_spec.rb
343
355
  - spec/system/rbeapi/api/vlans_spec.rb
344
356
  - spec/unit/rbeapi/api/acl/default_spec.rb
345
357
  - spec/unit/rbeapi/api/acl/fixture_acl_standard.text
@@ -353,8 +365,16 @@ test_files:
353
365
  - spec/unit/rbeapi/api/interfaces/vxlan_spec.rb
354
366
  - spec/unit/rbeapi/api/mlag/default_spec.rb
355
367
  - spec/unit/rbeapi/api/mlag/fixture_mlag.text
368
+ - spec/unit/rbeapi/api/routemaps/default_spec.rb
369
+ - spec/unit/rbeapi/api/routemaps/fixture_routemaps.text
356
370
  - spec/unit/rbeapi/api/staticroutes/default_spec.rb
357
371
  - spec/unit/rbeapi/api/staticroutes/fixture_staticroutes.text
372
+ - spec/unit/rbeapi/api/system/default_spec.rb
373
+ - spec/unit/rbeapi/api/system/fixture_system.text
374
+ - spec/unit/rbeapi/api/users/default_spec.rb
375
+ - spec/unit/rbeapi/api/users/fixture_users.text
358
376
  - spec/unit/rbeapi/api/vlans/default_spec.rb
359
377
  - spec/unit/rbeapi/api/vlans/fixture_vlans.text
378
+ - spec/unit/rbeapi/api/vrrp/default_spec.rb
379
+ - spec/unit/rbeapi/api/vrrp/fixture_vrrp.text
360
380
  has_rdoc:
@@ -1,41 +0,0 @@
1
- require 'spec_helper'
2
-
3
- require 'rbeapi/client'
4
- require 'rbeapi/api/varp'
5
-
6
- describe Rbeapi::Api::Varp do
7
- subject { described_class.new(node) }
8
-
9
- let(:config) { Rbeapi::Client::Config.new(filename: get_fixture('dut.conf')) }
10
- let(:node) { Rbeapi::Client.connect_to('dut') }
11
-
12
- describe '#get' do
13
- it 'returns a varp resource instance' do
14
- expect(subject.get).to be_a_kind_of(Hash)
15
- end
16
-
17
- it 'has a key for mac_address' do
18
- expect(subject.get).to include('mac_address')
19
- end
20
-
21
- it 'has a key for interfaces' do
22
- expect(subject.get).to include('interfaces')
23
- end
24
- end
25
-
26
- describe '#interfaces' do
27
- it 'is a kind of VarpInterfaces' do
28
- expect(subject.interfaces).to be_a_kind_of(Rbeapi::Api::VarpInterfaces)
29
- end
30
- end
31
-
32
- describe '#set_router_id' do
33
- before { node.config('no ip virtual-router mac-address') }
34
-
35
- it 'configures the ip varp mac-address' do
36
- expect(subject.get['mac_address']).to be_empty
37
- expect(subject.set_mac_address(value: 'aa:bb:cc:dd:ee:ff')).to be_truthy
38
- expect(subject.get['mac_address']).to eq('aa:bb:cc:dd:ee:ff')
39
- end
40
- end
41
- end