Skip to content

Commit

Permalink
Providing transformer support for sflow feature (sonic-net#91)
Browse files Browse the repository at this point in the history
* Providing transformer support for sflow feature

Signed-off-by: Gokulnath-Raja <Gokulnath_R@dell.com>
Co-authored-by: mohanapriya-meganathan <mohanapriya.m1@dell.com>

* Providing transformer support for sflow feature - Addressed review comments

Signed-off-by: Gokulnath-Raja <Gokulnath_R@dell.com>
Co-authored-by: mohanapriya-meganathan <mohanapriya.m1@dell.com>

* Providing transformer support for sflow feature - Addressed review comments for sflow app test
Signed-off-by: Gokulnath-Raja <Gokulnath_R@dell.com>
Co-authored-by: mohanapriya-meganathan <mohanapriya.m1@dell.com>

* Update azure-pipelines.yml

Enabling sflow feature for the

* Update azure-pipelines.yml

* Added support unit test run

Signed-off-by: Gokulnath-Raja <Gokulnath_R@dell.com>
Co-authored-by: mohanapriya-meganathan <mohanapriya.m1@dell.com>

* Added rclientDBNum in test infra
wq

---------

Signed-off-by: Gokulnath-Raja <Gokulnath_R@dell.com>
Co-authored-by: mohanapriya-meganathan <mohanapriya.m1@dell.com>
  • Loading branch information
Gokulnath-Raja and mohanapriya-meganathan authored Aug 18, 2023
1 parent b53883f commit 6823470
Show file tree
Hide file tree
Showing 12 changed files with 1,628 additions and 4 deletions.
3 changes: 2 additions & 1 deletion azure-pipelines.yml
Original file line number Diff line number Diff line change
Expand Up @@ -92,7 +92,6 @@ stages:
[[ -f tools/test/database_config.json ]] && \
export DB_CONFIG_PATH=${PWD}/tools/test/database_config.json
# Run CVL tests
pushd build/tests/cvl
Expand All @@ -115,6 +114,8 @@ stages:
./transformer.test -test.v -logtostderr || STATUS=1
./testapp.test -test.v -logtostderr || STATUS=1
popd
exit ${STATUS}
Expand Down
2 changes: 2 additions & 0 deletions config/transformer/models_list
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
#List yang models transformer need to load
openconfig-acl.yang
openconfig-acl-annot.yang
openconfig-sampling-sflow.yang
openconfig-sampling-sflow-annot.yang
2 changes: 1 addition & 1 deletion debian/sonic-mgmt-common.install
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
# Yang models
build/yang/*.yang usr/models/yang
build/yang/common/*.yang usr/models/yang
#build/yang/extensions/*.yang usr/models/yang
build/yang/extensions/*.yang usr/models/yang
build/yang/sonic/*.yang usr/models/yang
build/yang/sonic/common/*.yang usr/models/yang
build/yang/annotations/*.yang usr/models/yang
Expand Down
34 changes: 34 additions & 0 deletions models/yang/annotations/openconfig-sampling-sflow-annot.yang
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
module openconfig-sampling-sflow-annot {

yang-version "1";

namespace "http://openconfig.net/yang/annotation/oc-sampling-sflow-annot";
prefix "oc-sampling-annot";

import openconfig-extensions { prefix oc-ext; }
import openconfig-sampling-sflow { prefix oc-sampling; }
import sonic-extensions { prefix sonic-ext; }

deviation /oc-sampling:sampling/oc-sampling:sflow {
deviate add {
sonic-ext:subtree-transformer "sflow_xfmr";
}
}


deviation /oc-sampling:sampling/oc-sampling:sflow/oc-sampling:collectors {
deviate add {
sonic-ext:subtree-transformer "sflow_collector_xfmr";
sonic-ext:path-transformer "sflow_collector_path_xfmr";
}
}


deviation /oc-sampling:sampling/oc-sampling:sflow/oc-sampling:interfaces {
deviate add {
sonic-ext:subtree-transformer "sflow_interface_xfmr";
sonic-ext:path-transformer "sflow_interface_path_xfmr";
}
}
}

54 changes: 54 additions & 0 deletions models/yang/extensions/openconfig-sampling-sflow-deviation.yang
Original file line number Diff line number Diff line change
@@ -0,0 +1,54 @@
module openconfig-sampling-sflow-deviation {

yang-version "1.1";

// namespace
namespace "http://openconfig.net/yang/sampling/sflow/deviation/extension";

prefix "oc-sampling-sflow-dev";

import openconfig-extensions { prefix "oc-ext"; }
import openconfig-sampling-sflow { prefix oc-sampling; }

organization "SONiC";
contact
"SONiC";
description
"This is a deviation yang for openconfig sampling model.";

oc-ext:openconfig-version "0.1.0";

revision 2020-06-23 {
description
"Initial version.";
reference "0.1.0";
}

deviation /oc-sampling:sampling/oc-sampling:sflow/oc-sampling:config/oc-sampling:source-address {
deviate not-supported;
}

deviation /oc-sampling:sampling/oc-sampling:sflow/oc-sampling:config/oc-sampling:sample-size {
deviate not-supported;
}

deviation /oc-sampling:sampling/oc-sampling:sflow/oc-sampling:config/oc-sampling:sampling-rate {
deviate not-supported;
}

deviation /oc-sampling:sampling/oc-sampling:sflow/oc-sampling:interfaces/oc-sampling:interface/oc-sampling:state/oc-sampling:packets-sampled {
deviate not-supported;
}

deviation /oc-sampling:sampling/oc-sampling:sflow/oc-sampling:state/oc-sampling:source-address {
deviate not-supported;
}

deviation /oc-sampling:sampling/oc-sampling:sflow/oc-sampling:state/oc-sampling:sample-size {
deviate not-supported;
}

deviation /oc-sampling:sampling/oc-sampling:sflow/oc-sampling:collectors/oc-sampling:collector/oc-sampling:state/oc-sampling:packets-sent {
deviate not-supported;
}
}
Loading

0 comments on commit 6823470

Please sign in to comment.