diff --git a/CHANGELOG.md b/CHANGELOG.md index 8263b2964..3290e1661 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -13,6 +13,7 @@ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.1.0/). ### Fixed - tplink: send 'enable' before the enable password. Fixes #3271 (@robertcheramy) - asyncos: fix prompt for hostnames containing "-" . Fixes #3327 (@robertcheramy) +- sonicos: fix prompt for hostnames containing "-" . Fixes #3333 (@robertcheramy) ## [0.31.0 – 2024-11-29] diff --git a/lib/oxidized/model/sonicos.rb b/lib/oxidized/model/sonicos.rb index 259812b21..36fed0751 100644 --- a/lib/oxidized/model/sonicos.rb +++ b/lib/oxidized/model/sonicos.rb @@ -3,7 +3,7 @@ class SonicOS < Oxidized::Model # Applies to Sonicwall NSA series firewalls - prompt /^\w+@\w+[>]\(?.+\)?\s?/ + prompt /^\w+@[\w\-]+[>]\(?.+\)?\s?/ comment '! ' cmd :all do |cfg| diff --git a/spec/model/sonicwall_spec.rb b/spec/model/sonicwall_spec.rb new file mode 100644 index 000000000..af1333949 --- /dev/null +++ b/spec/model/sonicwall_spec.rb @@ -0,0 +1,16 @@ +require_relative 'model_helper' + +describe 'model/SonicOS' do + before(:each) do + init_model_helper + @node = Oxidized::Node.new(name: 'example.com', + input: 'ssh', + model: 'sonicos') + end + + it 'matches different prompts' do + _('admin@012345> ').must_match SonicOS.prompt + # Issue #3333 + _('admin@host-with-minus> ').must_match SonicOS.prompt + end +end