Skip to content

Commit

Permalink
[tests/libyang-python-tests]: Changing yang models to generic and rem…
Browse files Browse the repository at this point in the history
…oving reference to sonic.

Changes:
1.) To avoid confusion, Changing yang models to generic and removing reference to sonic
2.) Additing Relative path whenever needed.
  • Loading branch information
Praveen Chaudhary committed May 9, 2020
1 parent 57db247 commit f82637a
Show file tree
Hide file tree
Showing 11 changed files with 300 additions and 386 deletions.
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"test-sonic-vlan:sonic-vlan": {
"test-sonic-vlan:VLAN_INTERFACE": {
"test-vlan:vlan": {
"test-vlan:VLAN_INTERFACE": {
"VLAN_INTERFACE_LIST": [{
"vlanid": 111,
"ip-prefix": "2000:f500:45:6709::1/64",
Expand Down Expand Up @@ -40,26 +40,15 @@
]
},

"test-sonic-vlan:VLAN": {
"test-vlan:VLAN": {
"VLAN_LIST": [{
"vlanid": 111,
"description": "server_vlan",
"dhcp_servers": [
"10.1.7.116"
],
"mtu": "9216",
"admin_status": "up",
"members": [
"Ethernet8",
"Ethernet3",
"Ethernet0",
"Ethernet1",
"Ethernet6",
"Ethernet4",
"Ethernet5",
"Ethernet9",
"Ethernet2"
]
"admin_status": "up"
},
{
"vlanid": 555,
Expand All @@ -68,17 +57,12 @@
"10.1.7.116"
],
"mtu": "9216",
"admin_status": "up",
"members": [
"Ethernet9",
"Ethernet2",
"Ethernet8"
]
"admin_status": "up"
}
]
},

"test-sonic-vlan:VLAN_MEMBER": {
"test-vlan:VLAN_MEMBER": {
"VLAN_MEMBER_LIST": [{
"vlanid": 111,
"port": "Ethernet0",
Expand Down Expand Up @@ -117,8 +101,8 @@
]
}
},
"test-sonic-port:sonic-port": {
"test-sonic-port:PORT": {
"test-port:port": {
"test-port:PORT": {
"PORT_LIST": [{
"port_name": "Ethernet0",
"alias": "eth0",
Expand Down Expand Up @@ -203,8 +187,8 @@
}
},

"test-sonic-acl:sonic-acl": {
"test-sonic-acl:ACL_RULE": {
"test-acl:acl": {
"test-acl:ACL_RULE": {
"ACL_RULE_LIST": [{
"ACL_TABLE_NAME": "PACL-V4",
"RULE_NAME": "Rule_20",
Expand Down Expand Up @@ -237,7 +221,7 @@
]
},

"test-sonic-acl:ACL_TABLE": {
"test-acl:ACL_TABLE": {
"ACL_TABLE_LIST": [{
"ACL_TABLE_NAME": "PACL-V6",
"policy_desc": "Filter IPv6",
Expand All @@ -256,8 +240,8 @@
}
},

"test-sonic-interface:sonic-interface": {
"test-sonic-interface:INTERFACE": {
"test-interface:interface": {
"test-interface:INTERFACE": {
"INTERFACE_LIST": [{
"interface": "Ethernet8",
"ip-prefix": "10.1.1.65/26",
Expand Down
154 changes: 154 additions & 0 deletions src/sonic-yang-mgmt/tests/libyang-python-tests/config_data_merge.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,154 @@
{
"test-vlan:vlan": {
"test-vlan:VLAN_INTERFACE": {
"VLAN_INTERFACE_LIST": [{
"vlanid": 111,
"ip-prefix": "2000:f500:45:6709::1/64",
"scope": "global",
"family": "IPv6"
},
{
"vlanid": 111,
"ip-prefix": "10.1.1.64/26",
"scope": "global",
"family": "IPv4"
},
{
"vlanid": 200,
"ip-prefix": "2000:f500:45:6708::1/64",
"scope": "global",
"family": "IPv6"
},
{
"vlanid": 200,
"ip-prefix": "2000:f500:45:6709::1/64",
"scope": "global",
"family": "IPv6"
}
]
},

"test-vlan:VLAN": {
"VLAN_LIST": [{
"vlanid": 200,
"description": "server_vlan",
"dhcp_servers": [
"10.1.72.116"
],
"mtu": "9216",
"admin_status": "up"
},
{
"vlanid": 111,
"description": "server_vlan",
"dhcp_servers": [
"10.1.72.116"
],
"mtu": "9216",
"admin_status": "up"
}
]
},

"test-vlan:VLAN_MEMBER": {
"VLAN_MEMBER_LIST": [{
"vlanid": 200,
"port": "Ethernet0",
"tagging_mode": "tagged"
}]
}
},
"test-port:port": {
"test-port:PORT": {
"PORT_LIST": [{
"port_name": "Ethernet0",
"alias": "eth0",
"description": "Ethernet0",
"speed": 25000,
"mtu": 9000,
"admin_status": "up"
},
{
"port_name": "Ethernet1",
"alias": "eth1",
"description": "Ethernet1",
"speed": 25000,
"mtu": 9000,
"admin_status": "up"
},
{
"port_name": "Ethernet2",
"alias": "eth2",
"description": "Ethernet2",
"speed": 25000,
"mtu": 9000,
"admin_status": "up"
},
{
"port_name": "Ethernet3",
"alias": "eth2",
"description": "Ethernet3",
"speed": 25000,
"mtu": 9000,
"admin_status": "up"
},
{
"port_name": "Ethernet4",
"alias": "eth4",
"description": "Ethernet4",
"speed": 25000,
"mtu": 9000,
"admin_status": "up"
},
{
"port_name": "Ethernet5",
"alias": "eth5",
"description": "Ethernet5",
"speed": 25000,
"mtu": 9000,
"admin_status": "up"
},
{
"port_name": "Ethernet6",
"alias": "eth6",
"description": "Ethernet6",
"speed": 25000,
"mtu": 9000,
"admin_status": "up"
},
{
"port_name": "Ethernet7",
"alias": "eth7",
"description": "Ethernet7",
"speed": 25000,
"mtu": 9000,
"admin_status": "up"
},
{
"port_name": "Ethernet8",
"alias": "eth8",
"description": "Ethernet8",
"speed": 25000,
"mtu": 9000,
"admin_status": "up"
},
{
"port_name": "Ethernet9",
"alias": "eth9",
"description": "Ethernet9",
"speed": 25000,
"mtu": 9000,
"admin_status": "up"
},
{
"port_name": "Ethernet10",
"alias": "eth10",
"description": "Ethernet10",
"speed": 25000,
"mtu": 9000,
"admin_status": "up"
}
]
}
}
}
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
module test-sonic-acl {
module test-acl {

yang-version 1.1;

namespace "http://github.com/Azure/sonic-acl";
namespace "http://github.com/Azure/acl";
prefix acl;

import ietf-yang-types {
Expand All @@ -13,32 +13,26 @@ module test-sonic-acl {
prefix inet;
}

import test-sonic-head {
import test-head {
prefix head;
revision-date 2019-07-01;
}

import test-sonic-port {
import test-port {
prefix port;
revision-date 2019-07-01;
}

import test-sonic-portchannel {
import test-portchannel {
prefix lag;
revision-date 2019-07-01;
}

organization "Linkedin Corporation";

contact "lnos_coders@linkedin.com";

description "ACL YANG Module for SONiC OS";

revision 2019-07-01 {
description "First Revision";
}

container sonic-acl {
container acl {

container ACL_RULE {

Expand All @@ -50,7 +44,7 @@ module test-sonic-acl {

leaf ACL_TABLE_NAME {
type leafref {
path "/acl:sonic-acl/acl:ACL_TABLE/acl:ACL_TABLE_LIST/acl:ACL_TABLE_NAME";
path "/acl:acl/acl:ACL_TABLE/acl:ACL_TABLE_LIST/acl:ACL_TABLE_NAME";
}
}

Expand Down Expand Up @@ -257,10 +251,10 @@ module test-sonic-acl {
/* union of leafref is allowed in YANG 1.1 */
type union {
type leafref {
path /port:sonic-port/port:PORT/port:PORT_LIST/port:port_name;
path /port:port/port:PORT/port:PORT_LIST/port:port_name;
}
type leafref {
path /lag:sonic-portchannel/lag:PORTCHANNEL/lag:PORTCHANNEL_LIST/lag:portchannel_name;
path /lag:portchannel/lag:PORTCHANNEL/lag:PORTCHANNEL_LIST/lag:portchannel_name;
}
}
}
Expand All @@ -269,6 +263,6 @@ module test-sonic-acl {
}
/* end of container ACL_TABLE */
}
/* end of container sonic-acl */
/* end of container acl */
}
/* end of module sonic-acl */
/* end of module acl */
Original file line number Diff line number Diff line change
@@ -1,18 +1,12 @@
module test-sonic-head {
module test-head {

namespace "http://sonic-head";
prefix sonic-head;
namespace "http://head";
prefix head;

organization "Linkedin Corporation";

contact "lnos_coders@linkedin.com";

description "Head yang Module for SONiC OS";

revision 2019-07-01 {
description "First Revision";
}

typedef ip-family {
type enumeration {
enum IPv4;
Expand Down
Loading

0 comments on commit f82637a

Please sign in to comment.