From ac37ada5773ed9dc694ddbfdc0d10875f19a5e38 Mon Sep 17 00:00:00 2001 From: Robert Cheramy Date: Fri, 29 Nov 2024 21:21:12 +0100 Subject: [PATCH] add unit test and cmdset for asyncos - The prompt specified in issue #3327 works - Creating a cmdset in order to get a YAML simulation file --- examples/device-simulation/cmdsets/asyncos | 3 +++ spec/model/asyncos.rb | 17 +++++++++++++++++ 2 files changed, 20 insertions(+) create mode 100644 examples/device-simulation/cmdsets/asyncos create mode 100644 spec/model/asyncos.rb diff --git a/examples/device-simulation/cmdsets/asyncos b/examples/device-simulation/cmdsets/asyncos new file mode 100644 index 000000000..bc8aea286 --- /dev/null +++ b/examples/device-simulation/cmdsets/asyncos @@ -0,0 +1,3 @@ +version +showconfig +exit diff --git a/spec/model/asyncos.rb b/spec/model/asyncos.rb new file mode 100644 index 000000000..b751ecfa7 --- /dev/null +++ b/spec/model/asyncos.rb @@ -0,0 +1,17 @@ +require_relative 'model_helper' + +describe 'model/AsyncOS' do + before(:each) do + init_model_helper + @node = Oxidized::Node.new(name: 'example.com', + input: 'ssh', + model: 'asyncos') + end + + it 'matches different prompts' do + _('(mail.example.com)> ').must_match AsyncOS.prompt + _('mail.example.com> ').must_match AsyncOS.prompt + # Devices running in cluster mode (see issue #3327) + _('(Machine hostname) ').must_match AsyncOS.prompt + end +end