summaryrefslogtreecommitdiff
path: root/spec/unit/util/network_device/cisco
AgeCommit message (Collapse)AuthorFilesLines
2013-02-26(#18092) Use CGI.parse on network URI queryAdrien Thebo1-0/+26
The current implementation of the network device enable password parsing is unable to handle characters like sharps and spaces in the password, which are valid passwords. This commit adds CGI parsing of the query string to only extract and unescape the enable query parameter. This supercedes GH-1327 and GH-1491.
2013-02-07(maint) Update network_device spec to check for nilAdrien Thebo1-2/+2
Commit fe95a39 added a default value of false for instantiation of network transport types. I omitted that value and defaulted to nil since they're equivalent but didn't update the tests. This commits checks for nil instead of false.
2013-02-07Add the debug parameter in device.confGuillaume Rose1-0/+11
2012-09-26(Maint) Remove rspec from shebang lineJeff McCune3-3/+3
Without this patch Ruby 1.9 is still complaining loudly about trying to parse the spec files. The previous attempt to clean up this problem in edc3ddf works for Ruby 1.8 but not 1.9. I'd prefer to remove the shebang lines entirely, but doing so will cause encoding errors in Ruby 1.9. This patch strives for a happy middle ground of convincing Ruby it is actually working with Ruby while not confusing it to think it should exec() to rspec. This patch is the result of the following command run against the source tree: find spec -type f -print0 | \ xargs -0 perl -pl -i -e 's,^\#\!\s?/(.*)rspec,\#! /usr/bin/env ruby,'
2012-07-02(maint) Standardize on /usr/bin/env ruby -S rspecJeff McCune3-3/+3
Without this patch some spec files are using `ruby -S rspec` and others are using `rspec`. We should standardize on a single form of the interpreter used for spec files. `ruby -S rspec` is the best choice because it correctly informs editors such as Vim with Syntastic that the file is a Ruby file rather than an Rspec file.
2012-03-30Remove the "fails_on_ruby_1.9.2" tag from tests...Daniel Pittman1-2/+2
Now we have passing tests on Ruby 1.9, we can make all those tags go away and enable the full suite. Now anything that fails should be treated like a real failure, which is reasonable since this is a real and supported platform. Signed-off-by: Daniel Pittman <daniel@puppetlabs.com>
2011-09-13Fix #7984 - GigabitEthernet/TenGigabitEthernet are uncorrectly parsedBrice Figureau1-1/+2
The interface name abbreviation to canonical name doesn't return the correct name for GigabitEthernet and doesn't support TenGigabitEthernet interfaces. Signed-off-by: Brice Figureau <brice-puppet@daysofwonder.com>
2011-09-13Fix #7983 - Cisco uptime facts doesn't always workBrice Figureau1-1/+3
It was failing when one category (like week, day, hour) was missing. Signed-off-by: Brice Figureau <brice-puppet@daysofwonder.com>
2011-05-17maint: fix spec_helper inclusions again.Daniel Pittman3-7/+4
We got rid of the '../../spec_helper' style requires, but a few of them snuck back in in recent changes. This purges them out, replaced with the header: #!/usr/bin/env rspec require 'spec_helper' Reviewed-By: Nick Lewis <nick@puppetlabs.com>
2011-05-17(#7507) Add ability to filter Ruby 1.9 spec failuresMatt Robinson1-2/+2
By running: rspec spec --tag ~@fails_on_ruby_1.9.2 We can now just run the specs that pass under Ruby 1.9. Obviously in the long term we want to have all the specs passing, but until then we need notification when we regress. From now on new code will be required to pass under Ruby 1.9, and Jenkins will give us email notification if it doesn't or if we break something that was already working. Reviewed-by: Daniel Pittman <daniel@puppetlabs.com>
2011-04-18Merge remote-tracking branch 'community/feature/puppet-device' into 2.7.xPieter van de Bruggen2-125/+75
Reviewed-By: Mike Stahnke
2011-04-13maint: clean up the spec test headers in bulk.Daniel Pittman2-3/+3
We now use a shebang of: #!/usr/bin/env rspec This enables the direct execution of spec tests again, which was lost earlier during the transition to more directly using the rspec2 runtime environment.
2011-04-08Add management of router/switchs global vlansBrice Figureau1-1/+21
This allows to manage the global device list of vlans. Currently supports only cisco IOS devices. This is as easy as: Vlan { device_url => "ssh://user:pass@switch.domain.com/" } vlan { "200": description => "R&D"; "99": description => "Management"; } The device_url conforms to the same specs as for the interface type. Signed-off-by: Brice Figureau <brice-puppet@daysofwonder.com>
2011-04-08Cisco Switch/Router Interface managementBrice Figureau2-0/+590
This patch introduces managing remotely cisco IOS network devices through ssh or telnet with a puppet type/provider. This patch allows to manage router/switch interface with the interface type: interface { "FastEthernet 0/1": device_url => "ssh://user:pass@cisco2960.domain.com/", mode => trunk, encapsulation => dot1q, trunk_allowed_vlans => "1-99,200,253", description => "to back bone router" } It is possible with this patch to set interface: * mode (access or trunk) * native vlan (only for access mode) * speed (auto or a given speed) * duplex (auto, half or full) * trunk encapsulation * allowed trunk vlan * ipv4 addresses * ipv6 addresses * etherchannel membership The interface name (at least for the cisco provider) can be any shorthand interface name a switch or router can use. The device url should conform to: * scheme: either telnet or ssh * user: can be absent depending on switch/router line config * pass: must be present * port: optional * an optional enable password can be mentioned in the url query string Ex: To connect to a switch with a line password and an enable password: "telnet://:letmein@cisco29224XL.domain.com/?enable=letmeinagain" To connect to a switch/router through ssh and a privileged user: "ssh://brice:letmein@cisco1841L.domain.com/" Note: This patch only includes a Cisco IOS provider. Also terminology adopted in the various types are mostly the ones used in Cisco devices. This patch was tested against: * (really old) Cisco switch 2924XL with ios 12.0(5)WC10 * Cisco router 1841 with ios 12.4(15)T8 * Cisco router 877 with ios 12.4(11)XJ4 * Cisco switch 2960G with ios 12.2(44)SE Signed-off-by: Brice Figureau <brice-puppet@daysofwonder.com>