Skip to content

[GCU] Adding unit-test where path and ref paths are under the same YANG container#2047

Merged
ghooo merged 2 commits intosonic-net:masterfrom
ghooo:dev/mghoneim/same_container_ref_path_ut
Feb 18, 2022
Merged

[GCU] Adding unit-test where path and ref paths are under the same YANG container#2047
ghooo merged 2 commits intosonic-net:masterfrom
ghooo:dev/mghoneim/same_container_ref_path_ut

Conversation

@ghooo
Copy link
Copy Markdown
Contributor

@ghooo ghooo commented Jan 27, 2022

What I did

Did a debug session with Ping Mao and found this case is failing in her PR: sonic-net/sonic-buildimage#9545 I think it is an interesting case and I added it explicitly to GCU.

Adding unit-test where path and ref paths are under the same YANG container

sonic-loopback-interface.yang has:

    container sonic-loopback-interface {
        container LOOPBACK_INTERFACE {
            list LOOPBACK_INTERFACE_LIST {
                ...
                leaf name{
                    type string;
                }
                ...
            list LOOPBACK_INTERFACE_IPPREFIX_LIST {
                leaf name{
                    ...
                    type leafref {
                        path "../../LOOPBACK_INTERFACE_LIST/name";
                    }
                }
               ...

How I did it

Unit-test added

How to verify it

unit-test

Previous command output (if the output of a command-line utility has changed)

New command output (if the output of a command-line utility has changed)

Copy link
Copy Markdown
Contributor

@qiluo-msft qiluo-msft Jan 27, 2022

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

~1

To improve readability regarding the ~1 escape, we con construct the paths from components.

eg: https://github.com/Azure/sonic-mgmt/blob/d23d893a40e898fb3aeb70abd3bd60d08492b484/tests/generic_config_updater/gu_utils.py#L244 #Closed

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

updated

qiluo-msft
qiluo-msft previously approved these changes Jan 31, 2022
@ghooo
Copy link
Copy Markdown
Contributor Author

ghooo commented Feb 14, 2022

/azp run

@azure-pipelines
Copy link
Copy Markdown

Azure Pipelines successfully started running 1 pipeline(s).

@ghooo ghooo force-pushed the dev/mghoneim/same_container_ref_path_ut branch from 73ff22a to ffce1bc Compare February 15, 2022 00:28
@ghooo ghooo force-pushed the dev/mghoneim/same_container_ref_path_ut branch from ffce1bc to 120b068 Compare February 17, 2022 05:49
@ghooo ghooo merged commit 15670bf into sonic-net:master Feb 18, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants