-
Notifications
You must be signed in to change notification settings - Fork 344
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Fix IEEE module name prefix expectation
This addresses #893 Signed-off-by: Siddharth Sharma <[email protected]>
- Loading branch information
Showing
7 changed files
with
119 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 |
---|---|---|
@@ -0,0 +1,15 @@ | ||
test: test1 test2 test3 test4 | ||
|
||
# Baseline test that a module following 3gpp guidelines is OK | ||
test1: | ||
$(PYANG) --ieee ieee802-dot1q-correct.yang | ||
|
||
test2: | ||
$(PYANG) --ieee ieee-802-dot1q-incorrect-name.yang 2>&1 | diff ieee-802-dot1q-incorrect-name.expect - | ||
|
||
test3: | ||
$(PYANG) --ieee ieee802-dot1q-incorrect-namespace.yang 2>&1 | diff ieee802-dot1q-incorrect-namespace.expect - | ||
|
||
# Check help text | ||
test4: | ||
$(PYANG) -h | grep " --ieee Validate the module(s) according to IEEE rules." |
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 @@ | ||
ieee-802-dot1q-incorrect-name.yang:1: warning: the module name prefix should be of the form {IEEE committee}- e.g., ieee802- |
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,29 @@ | ||
module ieee-802-dot1q-incorrect-name { | ||
yang-version 1.1; | ||
namespace "urn:ieee:std:802.1Q:yang:ieee-802-dot1q-incorrect-name"; | ||
prefix dot1q-incorrect-name; | ||
|
||
organization | ||
"Institute of Electrical and Electronics Engineers"; | ||
|
||
contact | ||
"WG-URL: http://www.ieee802.org/1 | ||
WG-EMail: [email protected] | ||
Contact: IEEE 802.1 Working Group Chair | ||
Postal: C/O IEEE 802.1 Working Group | ||
IEEE Standards Association | ||
445 Hoes Lane | ||
Piscataway | ||
NJ 08854 | ||
USA | ||
E-mail: [email protected]"; | ||
|
||
description | ||
"ieee-802-dot1q-incorrect-name"; | ||
|
||
revision 2024-05-10 { | ||
reference "ieee-802-dot1q-incorrect-name"; | ||
} | ||
} |
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,29 @@ | ||
module ieee802-dot1q-correct { | ||
yang-version 1.1; | ||
namespace "urn:ieee:std:802.1Q:yang:ieee802-dot1q-correct"; | ||
prefix dot1q-correct; | ||
|
||
organization | ||
"Institute of Electrical and Electronics Engineers"; | ||
|
||
contact | ||
"WG-URL: http://www.ieee802.org/1 | ||
WG-EMail: [email protected] | ||
Contact: IEEE 802.1 Working Group Chair | ||
Postal: C/O IEEE 802.1 Working Group | ||
IEEE Standards Association | ||
445 Hoes Lane | ||
Piscataway | ||
NJ 08854 | ||
USA | ||
E-mail: [email protected]"; | ||
|
||
description | ||
"ieee802-dot1q-correct"; | ||
|
||
revision 2024-05-10 { | ||
reference "ieee802-dot1q-correct"; | ||
} | ||
} |
1 change: 1 addition & 0 deletions
1
test/plugins/test_ieee/ieee802-dot1q-incorrect-namespace.expect
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 @@ | ||
ieee802-dot1q-incorrect-namespace.yang:3: warning: the namespace should be of the form urn:ieee:std:{IEEE standard designation}:yang:ieee802-dot1q-incorrect-namespace |
29 changes: 29 additions & 0 deletions
29
test/plugins/test_ieee/ieee802-dot1q-incorrect-namespace.yang
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,29 @@ | ||
module ieee802-dot1q-incorrect-namespace { | ||
yang-version 1.1; | ||
namespace "urn:ieee:std:802.1Q:yang:ieee802-dot1q-correct-namespace"; | ||
prefix dot1q-incorrect-namespace; | ||
|
||
organization | ||
"Institute of Electrical and Electronics Engineers"; | ||
|
||
contact | ||
"WG-URL: http://www.ieee802.org/1 | ||
WG-EMail: [email protected] | ||
Contact: IEEE 802.1 Working Group Chair | ||
Postal: C/O IEEE 802.1 Working Group | ||
IEEE Standards Association | ||
445 Hoes Lane | ||
Piscataway | ||
NJ 08854 | ||
USA | ||
E-mail: [email protected]"; | ||
|
||
description | ||
"ieee802-dot1q-incorrect-namespace"; | ||
|
||
revision 2024-05-10 { | ||
reference "ieee802-dot1q-incorrect-namespace"; | ||
} | ||
} |