sloe 0.5.1 → 0.5.3
Sign up to get free protection for your applications and to get access to all the features.
- data/README.md +2 -4
- data/lib/sloe/device.rb +2 -1
- data/lib/sloe/junos.rb +3 -2
- data/lib/sloe/version.rb +1 -1
- data/spec/blocks_spec.rb +4 -4
- data/spec/methods_spec.rb +11 -6
- metadata +2 -2
data/README.md
CHANGED
@@ -61,6 +61,7 @@ All options supported by Netconf, Net::SCP and SNMP are supported in this gem to
|
|
61
61
|
Sloe supports vendor specific Netconf extensions. To add that vendor specific support call `new()` on one of the supported classes. Sloe supports the following:
|
62
62
|
|
63
63
|
*Sloe::Device - no vendor specific Netconf extensions added
|
64
|
+
|
64
65
|
*Sloe::Junos - Junos vendor specific Netconf extensions added
|
65
66
|
|
66
67
|
Just simply call `Sloe::Junos.new()` to get the Junos extensions added
|
@@ -74,10 +75,7 @@ As well as supporting Junos specific Netconf RPCs Sloe::Junos also supports the
|
|
74
75
|
device.cli("show version")
|
75
76
|
device.cli("show ospf interfaces")
|
76
77
|
|
77
|
-
By default this call will respond with
|
78
|
-
|
79
|
-
device.cli("show version", :format => 'text').text
|
80
|
-
|
78
|
+
By default this call will respond with a string. This should make this call compatable with existing automation scripts that are based on CLI commands. To get an XML result tree fragment use the rpc.command() API.
|
81
79
|
|
82
80
|
## SUPPORT
|
83
81
|
|
data/lib/sloe/device.rb
CHANGED
@@ -6,7 +6,8 @@ module Sloe
|
|
6
6
|
|
7
7
|
def initialize(args, &block)
|
8
8
|
|
9
|
-
# Stop netconf gem from defaulting to :Junos and thus
|
9
|
+
# Stop netconf gem from defaulting to :Junos and thus
|
10
|
+
# not loading :Junos extensions
|
10
11
|
args[:os_type] = :Netconf
|
11
12
|
super( args, &block )
|
12
13
|
end
|
data/lib/sloe/junos.rb
CHANGED
data/lib/sloe/version.rb
CHANGED
data/spec/blocks_spec.rb
CHANGED
@@ -7,8 +7,8 @@ describe Sloe do
|
|
7
7
|
before(:all) do
|
8
8
|
@login = {
|
9
9
|
:target => 'capella',
|
10
|
-
:username => '
|
11
|
-
:password => '
|
10
|
+
:username => 'netconf',
|
11
|
+
:password => 'netconf'
|
12
12
|
}
|
13
13
|
@hostname = ''
|
14
14
|
end
|
@@ -34,8 +34,8 @@ describe Sloe do
|
|
34
34
|
before(:all) do
|
35
35
|
@login = {
|
36
36
|
:target => 'capella',
|
37
|
-
:username => '
|
38
|
-
:password => '
|
37
|
+
:username => 'netconf',
|
38
|
+
:password => 'netconf'
|
39
39
|
}
|
40
40
|
end
|
41
41
|
|
data/spec/methods_spec.rb
CHANGED
@@ -7,8 +7,8 @@ describe Sloe do
|
|
7
7
|
@jnx_mibs = Dir.glob("./mibs/JUNIPER-*.yaml").map { |f| File.basename(f, '.yaml') }
|
8
8
|
@args = {
|
9
9
|
:target => 'capella',
|
10
|
-
:username => '
|
11
|
-
:password => '
|
10
|
+
:username => 'netconf',
|
11
|
+
:password => 'netconf',
|
12
12
|
:mib_dir => './mibs',
|
13
13
|
:mib_modules => ["SNMPv2-SMI", "SNMPv2-MIB", "IF-MIB", "IP-MIB", "TCP-MIB", "UDP-MIB"].concat(@jnx_mibs)
|
14
14
|
}
|
@@ -44,7 +44,7 @@ describe Sloe do
|
|
44
44
|
end
|
45
45
|
|
46
46
|
context "NETCONF API" do
|
47
|
-
it "rpc.get_interface_information()
|
47
|
+
it "rpc.get_interface_information() functions without error" do
|
48
48
|
lambda { @dut.rpc.get_interface_information() }.should_not raise_error
|
49
49
|
end
|
50
50
|
it "rpc.get_ospf_neighbor_information() functions without error" do
|
@@ -66,11 +66,16 @@ describe Sloe do
|
|
66
66
|
end
|
67
67
|
|
68
68
|
context "CLI API" do
|
69
|
-
it "cli
|
69
|
+
it "cli('show version') functions without error" do
|
70
70
|
lambda { @dut.cli("show version") }.should_not raise_error
|
71
71
|
end
|
72
|
-
it "cli
|
73
|
-
@dut.cli("show version").
|
72
|
+
it "cli('show version') contains OS information" do
|
73
|
+
@dut.cli("show version").should be_a(String)
|
74
|
+
@dut.cli("show version").should =~ /JUNOS Base OS/
|
75
|
+
end
|
76
|
+
it "cli('show version', :foo => 'bar') still contains OS information" do
|
77
|
+
@dut.cli("show version", :foo => 'bar').should be_a(String)
|
78
|
+
@dut.cli("show version", :foo => 'bar').should =~ /JUNOS Base OS/
|
74
79
|
end
|
75
80
|
end
|
76
81
|
end
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: sloe
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.5.
|
4
|
+
version: 0.5.3
|
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: 2013-02-
|
12
|
+
date: 2013-02-18 00:00:00.000000000 Z
|
13
13
|
dependencies:
|
14
14
|
- !ruby/object:Gem::Dependency
|
15
15
|
name: snmp
|