Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[201911] Fix #5594 config vlan member del port not a member issue #1171

Open
wants to merge 1 commit into
base: 201911
Choose a base branch
from

Conversation

tim-rj
Copy link
Contributor

@tim-rj tim-rj commented Oct 14, 2020

Signed-off-by: tim-rj sonic_rd@ruijie.com.cn

- What I did
Fix sonic-net/sonic-buildimage#5594 vlan member delete fail
- How I did it
when del a vlan member, need check table 'VLAN_MEMBER' together
- How to verify it
since this is sometimes issue, I just simple modify config_db.json(remove vlan("members")) and reboot device, at this time, VLAN table does not include port member, but VLAN_MEMBER does

 "VLAN": {
        "Vlan2": {   <--no members 
            "vlanid": "2"
        }
    },
    "VLAN_INTERFACE": {
        "Vlan2": {},
        "Vlan2|12.1.1.1/16": {},
        "Vlan2|12::1/64": {}
    },
    "VLAN_MEMBER": { <-- has members
        "Vlan2|Ethernet1": {
            "tagging_mode": "tagged"
        },
        "Vlan2|PortChannel0001": {
            "tagging_mode": "untagged"
        }
    }

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

root@sonic:/home/admin# config vlan member del 2 Ethernet1
Usage: config vlan member del [OPTIONS] <vid> <interface_name>

Error: Ethernet1 is not a member of Vlan2

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

root@sonic:/home/admin# config vlan member del 2 Ethernet1
root@sonic:/home/admin#
root@sonic:/home/admin#
root@sonic:/home/admin#
root@sonic:/home/admin#
root@sonic:/home/admin#
root@sonic:/home/admin# show vlan brief
+-----------+--------------+-----------------+----------------+-----------------------+
|   VLAN ID | IP Address   | Ports           | Port Tagging   | DHCP Helper Address   |
+===========+==============+=================+================+=======================+
|         2 | 12.1.1.1/16  | PortChannel0001 | untagged       |                       |
|           | 12::1/64     |                 |                |                       |
+-----------+--------------+-----------------+----------------+-----------------------+

root@sonic:/home/admin#
root@sonic:/home/admin# config vlan member add 2 Ethernet1
root@sonic:/home/admin# show vlan brief
+-----------+--------------+-----------------+----------------+-----------------------+
|   VLAN ID | IP Address   | Ports           | Port Tagging   | DHCP Helper Address   |
+===========+==============+=================+================+=======================+
|         2 | 12.1.1.1/16  | Ethernet1       | tagged         |                       |
|           | 12::1/64     | PortChannel0001 | untagged       |                       |
+-----------+--------------+-----------------+----------------+-----------------------+
root@sonic:/home/admin# config vlan member del 2 Ethernet1
root@sonic:/home/admin# show vlan brief
+-----------+--------------+-----------------+----------------+-----------------------+
|   VLAN ID | IP Address   | Ports           | Port Tagging   | DHCP Helper Address   |
+===========+==============+=================+================+=======================+
|         2 | 12.1.1.1/16  | PortChannel0001 | untagged       |                       |
|           | 12::1/64     |                 |                |                       |
+-----------+--------------+-----------------+----------------+-----------------------+

Signed-off-by: tim-rj <sonic_rd@ruijie.com.cn>
@tim-rj
Copy link
Contributor Author

tim-rj commented Oct 14, 2020

reminder: only for 201911, since master's structure for vlan configuration has changed and has no such issue.

@lguohan
Copy link
Contributor

lguohan commented Oct 14, 2020

can you add unit test?

@tim-rj
Copy link
Contributor Author

tim-rj commented Oct 16, 2020

can you add unit test?

does mean add some unit test case(cause i can find test case about vlan config), or, add some test results on real device? Is there some guiders for 201911 unit testing?

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.

2 participants