forked from networktocode/netutils
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
dual banner test case single banner feature search (networktocode#445)
* dual banner test case single banner feature search * Refactor test, implement dual banner fix (networktocode#456) * Refactor test, implement dual banner fix * Add tests for multiple banners --------- Co-authored-by: Anthony House <[email protected]> --------- Co-authored-by: Jeff Kala <[email protected]> Co-authored-by: housepbass <[email protected]> Co-authored-by: Anthony House <[email protected]>
- Loading branch information
1 parent
5bcf145
commit 61505c0
Showing
14 changed files
with
130 additions
and
1 deletion.
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
14 changes: 14 additions & 0 deletions
14
tests/unit/mock/config/compliance/feature_compliance/ios_dual_banner_actual.txt
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,14 @@ | ||
hostname dual-banner | ||
! | ||
banner exec ^C | ||
========= | ||
actual config exec banner | ||
-======== | ||
^C | ||
banner motd ^C | ||
====== | ||
actual config motd banner | ||
====== | ||
|| ($hostname) || | ||
^C | ||
! |
14 changes: 14 additions & 0 deletions
14
tests/unit/mock/config/compliance/feature_compliance/ios_dual_banner_exec_actual.txt
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,14 @@ | ||
hostname dual-banner | ||
! | ||
banner exec ^C | ||
========= | ||
actual config exec banner | ||
-======== | ||
^C | ||
banner motd ^C | ||
====== | ||
actual config motd banner | ||
====== | ||
|| ($hostname) || | ||
^C | ||
! |
2 changes: 2 additions & 0 deletions
2
tests/unit/mock/config/compliance/feature_compliance/ios_dual_banner_exec_feature.py
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,2 @@ | ||
feature = {"name": "exec banner", "ordered": False, "section": ["banner exec"]} | ||
network_os = "cisco_ios" |
14 changes: 14 additions & 0 deletions
14
tests/unit/mock/config/compliance/feature_compliance/ios_dual_banner_exec_intended.txt
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,14 @@ | ||
hostname dual-banner | ||
! | ||
banner exec ^C | ||
========= | ||
intended config exec banner | ||
-======== | ||
^C | ||
banner motd ^C | ||
====== | ||
intended config motd banner | ||
====== | ||
|| ($hostname) || | ||
^C | ||
! |
10 changes: 10 additions & 0 deletions
10
tests/unit/mock/config/compliance/feature_compliance/ios_dual_banner_exec_received.py
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,10 @@ | ||
data = { | ||
"compliant": False, | ||
"missing": "banner exec ^C\n=========\nintended config exec banner\n-========^C", | ||
"extra": "banner exec ^C\n=========\nactual config exec banner\n-========^C", | ||
"cannot_parse": True, | ||
"unordered_compliant": False, | ||
"ordered_compliant": False, | ||
"actual": "banner exec ^C\n=========\nactual config exec banner\n-========^C", | ||
"intended": "banner exec ^C\n=========\nintended config exec banner\n-========^C", | ||
} |
2 changes: 2 additions & 0 deletions
2
tests/unit/mock/config/compliance/feature_compliance/ios_dual_banner_feature.py
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,2 @@ | ||
feature = {"name": "exec banner", "ordered": False, "section": ["banner"]} | ||
network_os = "cisco_ios" |
14 changes: 14 additions & 0 deletions
14
tests/unit/mock/config/compliance/feature_compliance/ios_dual_banner_intended.txt
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,14 @@ | ||
hostname dual-banner | ||
! | ||
banner exec ^C | ||
========= | ||
intended config exec banner | ||
-======== | ||
^C | ||
banner motd ^C | ||
====== | ||
intended config motd banner | ||
====== | ||
|| ($hostname) || | ||
^C | ||
! |
14 changes: 14 additions & 0 deletions
14
tests/unit/mock/config/compliance/feature_compliance/ios_dual_banner_motd_actual.txt
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,14 @@ | ||
hostname dual-banner | ||
! | ||
banner exec ^C | ||
========= | ||
actual config exec banner | ||
-======== | ||
^C | ||
banner motd ^C | ||
====== | ||
actual config motd banner | ||
====== | ||
|| ($hostname) || | ||
^C | ||
! |
2 changes: 2 additions & 0 deletions
2
tests/unit/mock/config/compliance/feature_compliance/ios_dual_banner_motd_feature.py
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,2 @@ | ||
feature = {"name": "exec banner", "ordered": False, "section": ["banner motd"]} | ||
network_os = "cisco_ios" |
14 changes: 14 additions & 0 deletions
14
tests/unit/mock/config/compliance/feature_compliance/ios_dual_banner_motd_intended.txt
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,14 @@ | ||
hostname dual-banner | ||
! | ||
banner exec ^C | ||
========= | ||
intended config exec banner | ||
-======== | ||
^C | ||
banner motd ^C | ||
====== | ||
intended config motd banner | ||
====== | ||
|| ($hostname) || | ||
^C | ||
! |
10 changes: 10 additions & 0 deletions
10
tests/unit/mock/config/compliance/feature_compliance/ios_dual_banner_motd_received.py
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,10 @@ | ||
data = { | ||
"compliant": False, | ||
"missing": "banner motd ^C\n======\nintended config motd banner\n======\n || ($hostname) ||^C", | ||
"extra": "banner motd ^C\n======\nactual config motd banner\n======\n || ($hostname) ||^C", | ||
"cannot_parse": True, | ||
"unordered_compliant": False, | ||
"ordered_compliant": False, | ||
"actual": "banner motd ^C\n======\nactual config motd banner\n======\n || ($hostname) ||^C", | ||
"intended": "banner motd ^C\n======\nintended config motd banner\n======\n || ($hostname) ||^C", | ||
} |
10 changes: 10 additions & 0 deletions
10
tests/unit/mock/config/compliance/feature_compliance/ios_dual_banner_received.py
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,10 @@ | ||
data = { | ||
"compliant": False, | ||
"missing": "banner exec ^C\n=========\nintended config exec banner\n-========^C\nbanner motd ^C\n======\nintended config motd banner\n======\n || ($hostname) ||^C", | ||
"extra": "banner exec ^C\n=========\nactual config exec banner\n-========^C\nbanner motd ^C\n======\nactual config motd banner\n======\n || ($hostname) ||^C", | ||
"cannot_parse": True, | ||
"unordered_compliant": False, | ||
"ordered_compliant": False, | ||
"actual": "banner exec ^C\n=========\nactual config exec banner\n-========^C\nbanner motd ^C\n======\nactual config motd banner\n======\n || ($hostname) ||^C", | ||
"intended": "banner exec ^C\n=========\nintended config exec banner\n-========^C\nbanner motd ^C\n======\nintended config motd banner\n======\n || ($hostname) ||^C", | ||
} |
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