-
Notifications
You must be signed in to change notification settings - Fork 932
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Make the ANSI Escape Code optional for reverse compatibility - Removed unecessary parenthesis - Match the whole prompt line - Add a unit test to validate the prompt and the YAML Simulation File - Renamed the YAML Simulation File to match the hardware model - add "exit" to the command sets & the YAML Simulation File
- Loading branch information
1 parent
790bd92
commit 6d28f00
Showing
7 changed files
with
238 additions
and
2 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1 +1,2 @@ | ||
net show configuration commands | ||
exit |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1 +1,2 @@ | ||
nv config show --color off | ||
exit |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,32 @@ | ||
require_relative 'model_helper' | ||
|
||
describe 'model/Cumulus' do | ||
before(:each) do | ||
init_model_helper | ||
|
||
@node = Oxidized::Node.new(name: 'example.com', | ||
input: 'ssh', | ||
model: 'cumulus') | ||
end | ||
|
||
it 'matches different prompts' do | ||
_('root@spine1-nyc2:~# ').must_match Cumulus.prompt | ||
_("\e[?2004hroot@spine1-nyc2:~#\x20").must_match Cumulus.prompt | ||
end | ||
|
||
it 'runs on MSN2010 with Cumulus Linux 5.9.2 (nvue mode)' do | ||
# Reload node with vars cumulus_use_nvue set | ||
@node = Oxidized::Node.new(name: 'example.com', | ||
input: 'ssh', | ||
model: 'cumulus', | ||
vars: { cumulus_use_nvue: true }) | ||
|
||
mockmodel = MockSsh.new('examples/device-simulation/yaml/cumulus_MSN2010_5.9.2_nvue.yaml') | ||
Net::SSH.stubs(:start).returns mockmodel | ||
|
||
status, result = @node.run | ||
|
||
_(status).must_equal :success | ||
_(result.to_cfg).must_equal mockmodel.oxidized_output | ||
end | ||
end |