forked from sonic-net/sonic-buildimage
-
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.
Missing container in list support in YANG Model sonic-net#16704
Add support container in list Add support for single choice statement in container/list Signed-off-by: vkuk <vkuhk@marvell.com>
- Loading branch information
1 parent
f95fdac
commit ccd336d
Showing
4 changed files
with
156 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
105 changes: 105 additions & 0 deletions
105
src/sonic-yang-mgmt/tests/libyang-python-tests/sample-yang-models/test-yang-structure.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,105 @@ | ||
module test-yang-structure { | ||
|
||
namespace "http://github.com/sonic-net/test"; | ||
prefix yangstructtest; | ||
|
||
yang-version 1.1; | ||
|
||
import ietf-yang-types { | ||
prefix yang; | ||
} | ||
|
||
import ietf-inet-types { | ||
prefix inet; | ||
} | ||
|
||
import test-head { | ||
prefix head; | ||
revision-date 2019-07-01; | ||
} | ||
|
||
revision 2021-10-30 { | ||
description "First Revision"; | ||
} | ||
|
||
container test-yang-container { | ||
|
||
container YANG_STRUCT_TEST { | ||
|
||
description "sample test container"; | ||
|
||
list YANG_LIST_TEST_LIST { | ||
|
||
key "name"; | ||
|
||
leaf name { | ||
type string; | ||
} | ||
|
||
leaf-list leaf-list-test { | ||
description "Test leaf-list statement"; | ||
type inet:ipv6-address; | ||
} | ||
|
||
container container-in-list-test { | ||
leaf leaf-1 { | ||
description "test leaf in container"; | ||
type string { | ||
pattern "false|true"; | ||
} | ||
} | ||
|
||
leaf leaf-2 { | ||
description "test leaf in container"; | ||
type string; | ||
} | ||
|
||
choice multi-choice-in-container-test-1 { | ||
case mc-case-test-1 { | ||
leaf mc-case-leaf-1 { | ||
description "test leaf in multi choice"; | ||
type uint32; | ||
} | ||
} | ||
|
||
case mc-case-test-2 { | ||
leaf mc-case-leaf-2 { | ||
description "test leaf in multi choice"; | ||
type uint8; | ||
} | ||
} | ||
} | ||
|
||
choice multi-choice-in-container-test-2 { | ||
case mc-case-test-3 { | ||
leaf mc-case-leaf-3 { | ||
description "test leaf in multi choice"; | ||
type uint16; | ||
} | ||
} | ||
} | ||
} | ||
|
||
choice single-choice-in-list-test { | ||
case case-test-1 { | ||
leaf case-leaf-1 { | ||
description "test leaf in single choice"; | ||
type uint32; | ||
} | ||
} | ||
|
||
case case-test-2 { | ||
leaf case-leaf-2 { | ||
description "test leaf in single choice"; | ||
type uint16; | ||
} | ||
} | ||
} | ||
} | ||
/* end of YANG_LIST_TEST_LIST */ | ||
} | ||
/* end of container YANG_STRUCT_TEST */ | ||
} | ||
/* end of container test-yang-container */ | ||
} | ||
/* end of module test-yang-structure */ |
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