Skip to content

Commit

Permalink
Fix issues found in code review
Browse files Browse the repository at this point in the history
- Preparing release 0.31.0
- Code review of all changes since 0.30.1
  • Loading branch information
robertcheramy committed Nov 27, 2024
1 parent db0959b commit 455a8c2
Show file tree
Hide file tree
Showing 8 changed files with 29 additions and 27 deletions.
19 changes: 9 additions & 10 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,40 +8,41 @@ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.1.0/).

### Added
- model for Riverbed Steelhead (@Swaeltjie)
- removed time command from uplink EP4440-DP OLT model
- model for uplink EP4440-DP OLT (@AAm-kun)
- model for Siklu Multihaul TG radios (@bdg-robert)
- fortios: variable `fullconfig` to get the configuration with default values. Fixes: #3159 (@robertcheramy)
- model for VMWare NSX DFW (@elmobp)
- model for F5OS (@teunvink)
- cumulus: Add possibility to use NVUE (@lagertonne)
- model for garderos (@robertcheramy)
- unit tests framework for models with ssh input (@robertcheramy)
- container-image: install x25519 gem package to support more ssh kex. Fixes #3070 (@benasse)
- os6: Added support to Dell EMC Networking OS6 (@anubisg1)
- Update net-ssh to 7.3 to enable support for aes(128|256)gcm. Fixes #3168 (@jacobw)
- model for HPE Aruba Networking Instant Mode (Aruba Instant). Fixes #3057 (@robertcheramy)
- Add JSONFILE source (@sargon)

### Changed
- h3c: change prompt to expect either angle (user-view) or square (system-view) brackets (@nl987)
- xos: Hide radius and user secrets for XOS (@iriseden)
- eos: Hide radius and snmp secrets for Arista EOS (@iriseden)
- docker/podman: baseimage updated to phusion/baseimage:jammy-1.0.4
- fortios: Hide date in acme certifcate comments (@systeembeheerder)
- dlink: added support for 'enable admin' before getting configuration, if enable=true (@as8net)
- dlinknextgen: strip uptime and ntp update time from config
- Updated slackdiff.rb to use slack_ruby_client instead of slack-api (@Punicaa)
- oxidized: options (such as credentials, etc.) now use the same resolution logic as variables and can also be defined per model in a group (@EinGlasVollKakao)
- Add JSONFILE source (@sargon)
- saos: add inventory and software status collection (@grbeneke)
- container-image: update to phusion/baseimage:noble-1.0.0 and include security upgrades at build time (@robertcheramy)
- container-image: use ubuntu-packages instead of gems in order to reduce container image size (@robertcheramy)
- edgecos.rb: hide temperature and fan speed (@dhooper6430)
- cnos: show information before config, remove secrets only when told to do so (@robje)
- Updated slackdiff.rb to use new files.getUploadURLExternal slack file upload API instead of deprecated files.upload (@varesa)
- Updated source/output files to reference a Source/Outputb module to avoid namespace duplication (@laf, @robertcheramy)
- Updated source/output files to reference a Source/Output module to avoid namespace duplication (@laf, @robertcheramy)
- ios: Hide WLAN PSK, AP profile dot1x password, AP profile mgmtuser password/secret and radius COA server-key (@devon-mar)
- ios: remove values from custom SNMP OID's, set by an EEM script (@syn-bit)
- Update net-ssh to 7.3 to enable support for aes(128|256)gcm. Fixes #3168 (@jacobw)
- removed time command from uplink EP4440-DP OLT model
- fortios: variable `fullconfig` to get the configuration with default values. Fixes: #3159 (@robertcheramy)
- container-image: install x25519 gem package to support more ssh kex. Fixes #3070 (@benasse)
- lenovonos: Salt administrator-password line when remove_unstable_lines is set to True (@kani999)
- lenovonos: Removes lines that started with Fan because RPM always changes. (@kani999)

### Fixed
- fixed error for ibos when remove_secret is set (@dminuoso)
Expand All @@ -50,7 +51,7 @@ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.1.0/).
- fixed power consumption included in ArubaOS-CX diffs starting with FL.10.13.xxx. Fixes #3142 (@terratalpi)
- fixed oxidized-web getting "version not found" when fetching a version from git and no group is defined. Fixes #2222 (@robertcheramy)
- fixed telnet to disconnect gracefully even if it throws IOError while disconnect. Fixes #3212 (@ytti)
- docs: run Git garbage collection to address performance issues. Fixes #3121 (@robertcheramy)
- docs: run git garbage collection to address performance issues. Fixes #3121 (@robertcheramy)
- saos: fixed handling of 'unsaved configuration' indicator in prompt (@grbeneke)
- rgos: also strip "System uptime" for installed modules (@spike77453)
- fixed digest authentication when using http input (@spike77453)
Expand Down Expand Up @@ -109,8 +110,6 @@ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.1.0/).
- dlinknextgen removes user and snmp-server secrets (@tcrichton)
- dnos: hide secrets in "ospf message-digest-key", "authentication-type" and "bsd-username" (@rybnico)
- junos: Replace dynamic value in VMX-BANDWIDTH with count, hide ssh keys
- lenovonos: Salt administrator-password line when remove_unstable_lines is set to True (@kani999)
- lenovonos: Removes lines that started with Fan because RPM always changes. (@kani999)

### Fixed
- fixed empty lines for ZyXEL GS1900 switches (@jluebbe)
Expand Down
2 changes: 1 addition & 1 deletion docs/Creating-Models.md
Original file line number Diff line number Diff line change
Expand Up @@ -96,7 +96,7 @@ using the same network device as you are.

A good (and optional) practice for submissions is to provide a
[unit test for your model](/spec/model). This reduces the risk that further
developments don't break it, and facilitates debugging issues without having
developments could break it, and facilitates debugging issues without having
access to a physical network device for the model.

In order to simulate the device in the unit test, you need a
Expand Down
9 changes: 6 additions & 3 deletions docs/Release.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,15 +5,18 @@ This document is targeted at oxidized maintainers. It describes the release proc
Run `git diff 0.30.0..master` (where `0.30.0` is to be changed to the last release) and review
all the changes that have been done. Have a specific look at changes you don't understand.

For a graphical compare, use `git difftool -d 0.30.0..master`.

## Test, test test!
Test the git code and the container against as much device types an environments as you can.

Do not integrate late PRs into master if they do not fix issues for the release. The must wait for the next release.

## Version numbering
Oxidized versions are nummered like 0.major.minor
- major is incremented when releasing new features. minor is then set to 0
- minor is incremented when releasing fixes only, just after a major version.
Oxidized versions are nummered like major.minor.patch
- currently, the major version is 0.
- minor is incremented when releasing new features.
- patch is incremented when releasing fixes only.

## Release
1. Checkout the master branch of oxidized. Make sure you are up to date with origin.
Expand Down
6 changes: 3 additions & 3 deletions lib/oxidized/model/aosw.rb
Original file line number Diff line number Diff line change
Expand Up @@ -67,7 +67,7 @@ class AOSW < Oxidized::Model
end

cmd 'show license passphrase' do |cfg|
cfg = "" if cfg.match(/(Invalid input detected at '\^' marker|Parse error)/) # Don't show for unsupported devices (IAP and MAS)
cfg = "" if cfg.match /(Invalid input detected at '\^' marker|Parse error)/ # Don't show for unsupported devices (IAP and MAS)
rstrip_cfg comment cfg
end

Expand All @@ -84,8 +84,8 @@ class AOSW < Oxidized::Model
end

cfg :telnet do
username(/^User:\s*/)
password(/^Password:\s*/)
username /^User:\s*/
password /^Password:\s*/
end

cfg :telnet, :ssh do
Expand Down
4 changes: 2 additions & 2 deletions spec/config_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -10,8 +10,8 @@
err = _(-> { Oxidized::Config.load }).must_raise Oxidized::NoConfig
# We cannot test if the environment variable OXIDIZED_HOME is properly used.
# Oxidized::Config uses OXIDIZED_HOME at loading (require 'oxidized/config'),
# so we have no chance to manipulate it within this test (oxidized/condig can
# have been required in another test)
# so we have no chance to manipulate it within this test (oxidized/config can
# have already been required in another test)
_(err.message).must_match(/^edit .*\/config$/)
end
end
Expand Down
2 changes: 1 addition & 1 deletion spec/input/ssh_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@

describe "#connect" do
it "should use proxy command when proxy host given and connect by ip if resolve_dns is true" do
# If this test fails, check it exemple.com stil resolves to 93.184.215.14
# If this test fails, check it exemple.com still resolves to 93.184.215.14
# If not, update Net::SSH.expects(:start).with('93.184.215.14'... below
Oxidized.config.resolve_dns = true
@node = Oxidized::Node.new(name: 'example.com',
Expand Down
4 changes: 2 additions & 2 deletions spec/model/arubainstant_spec.rb
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
require_relative 'model_helper'

describe 'model/IOS' do
describe 'model/ArubaInstant' do
before(:each) do
init_model_helper
@node = Oxidized::Node.new(name: 'example.com',
Expand All @@ -13,7 +13,7 @@
_('AAAA-AP123456# ').must_match ArubaInstant.prompt
end

it 'runs on IAP516 with 8.10.0.6' do
it 'runs on IAP515 with 8.10.0.6' do
mockmodel = MockSsh.new('examples/device-simulation/yaml/arubainstant_IAP515_8.10.0.6_VWLC.yaml')
Net::SSH.stubs(:start).returns mockmodel

Expand Down
10 changes: 5 additions & 5 deletions spec/model/model_helper.rb
Original file line number Diff line number Diff line change
Expand Up @@ -14,9 +14,9 @@ def init_model_helper
Oxidized::Node.any_instance.stubs(:resolve_output)
end

# save the result of a node.run into filename
# save the result of a node.run into @filename
# it is already formated for copy & paste into the YAML simulation file
# result is dormated as it is returned by "status, result = @node.run"
# @result is formated as it is returned by "status, result = @node.run"
def result2file(result, filename)
File.open(filename, 'w') do |file|
# chomp: true removes the trailing \n after each line
Expand Down Expand Up @@ -48,8 +48,7 @@ def initialize(yaml_model)
@oxidized_output = interpolate_yaml(model['oxidized_output'])
end

# We have to interpolate ourselves as yaml block scalars do not interpolate
# anything
# We have to interpolate as yaml block scalars don't interpolate anything
def interpolate_yaml(text)
# we just add double quotes and undump the result
"\"#{text}\"".undump
Expand All @@ -58,7 +57,8 @@ def interpolate_yaml(text)
def exec!(cmd)
Oxidized.logger.send(:debug, "exec! called with cmd #{cmd}")

# exec commands are send without \n, our @commands has \n integrated
# exec commands are send without \n, the keys in @commands have a "\n"
# appended, so we search for cmd + "\n" in @commands
cmd += "\n"

raise "#{cmd} not defined" unless @commands.has_key?(cmd)
Expand Down

0 comments on commit 455a8c2

Please sign in to comment.