-
Notifications
You must be signed in to change notification settings - Fork 54
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Refactor test, implement dual banner fix (#456)
* Refactor test, implement dual banner fix * Add tests for multiple banners --------- Co-authored-by: Anthony House <[email protected]>
- Loading branch information
1 parent
dfae10d
commit 5ad28f7
Showing
12 changed files
with
95 additions
and
6 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
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: 1 addition & 1 deletion
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 |
---|---|---|
@@ -1,2 +1,2 @@ | ||
feature = {"name": "exec banner", "ordered": False, "section": ["banner exec"]} | ||
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_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", | ||
} |
8 changes: 4 additions & 4 deletions
8
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 |
---|---|---|
@@ -1,10 +1,10 @@ | ||
data = { | ||
"compliant": False, | ||
"missing": "banner exec ^C\n=========\nintended config exec banner\n-========^C\n", | ||
"extra": "banner exec ^C\n=========\nactual config exec banner\n-========^C\n", | ||
"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": "hostname dual-banner\n!\nbanner exec ^C\n=========\nactual config exec banner\n-========\n^C\nbanner motd ^C\n======\nactual config motd banner\n======\n || ($hostname) ||\n^C\n!\n", | ||
"intended": "hostname dual-banner\n!\nbanner exec ^C\n=========\nintended config exec banner\n-========\n^C\nbanner motd ^C\n======\nintended config motd banner\n======\n || ($hostname) ||\n^C\n!", | ||
"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