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

[show/config]: combine feature and container feature cli #1015

Merged
merged 8 commits into from
Aug 3, 2020

Conversation

lguohan
Copy link
Contributor

@lguohan lguohan commented Jul 31, 2020

Signed-off-by: Guohan Lu lguohan@gmail.com

- What I did
merge container feature cli into feature cli
add unit tests

02:24:22  ============================= test session starts ==============================
02:24:22  platform linux2 -- Python 2.7.16, pytest-3.10.1, py-1.7.0, pluggy-0.8.0
02:24:22  rootdir: /sonic/sonic-utilities, inifile: pytest.ini
02:24:22  plugins: cov-2.6.0
02:24:24  collected 75 items
02:24:24  
02:24:24  sonic-utilities-tests/acl_loader_test.py ....                            [  5%]
02:24:24  sonic-utilities-tests/aclshow_test.py ...........                        [ 20%]
02:24:25  sonic-utilities-tests/config_mgmt_test.py ....                           [ 25%]
02:24:26  sonic-utilities-tests/drops_group_test.py .......                        [ 34%]
02:24:26  sonic-utilities-tests/feature_test.py .........                          [ 46%]
02:24:27  sonic-utilities-tests/filter_fdb_entries_test.py ..........              [ 60%]
02:24:27  sonic-utilities-tests/gearbox_test.py ..                                 [ 62%]
02:24:36  sonic-utilities-tests/intfstat_test.py ........                          [ 73%]
02:24:39  sonic-utilities-tests/intfutil_test.py ........                          [ 84%]
02:24:39  sonic-utilities-tests/port2alias_test.py ....                            [ 89%]
02:24:40  sonic-utilities-tests/psu_test.py ...                                    [ 93%]
02:24:41  sonic-utilities-tests/sfp_test.py ...                                    [ 97%]
02:24:41  sonic-utilities-tests/show_breakout_test.py ..                           [100%]

config command:

admin@vlab-01:~$ sudo config feature
Usage: config feature [OPTIONS] COMMAND [ARGS]...

  Modify configuration of features

Options:
  -?, -h, --help  Show this message and exit.

Commands:
  autorestart  Configure autorestart status for a feature
  state        Configure status of feature

show command:

admin@vlab-01:~$ show feature
Usage: show feature [OPTIONS] COMMAND [ARGS]...

  Show feature status

Options:
  -?, -h, --help  Show this message and exit.

Commands:
  autorestart  Show auto-restart status for a feature
  status       Show feature status

output:

admin@vlab-01:~$ show feature status
Feature     State     AutoRestart
----------  --------  -------------
bgp         enabled   enabled
database    enabled   disabled
dhcp_relay  enabled   enabled
lldp        enabled   enabled
nat         enabled   enabled
pmon        enabled   enabled
radv        enabled   enabled
restapi     disabled  enabled
sflow       disabled  enabled
snmp        enabled   enabled
swss        enabled   enabled
syncd       enabled   enabled
teamd       enabled   enabled
telemetry   enabled   enabled
admin@vlab-01:~$ show feature autorestart
Feature     AutoRestart
----------  -------------
bgp         enabled
database    disabled
dhcp_relay  enabled
lldp        enabled
nat         enabled
pmon        enabled
radv        enabled
restapi     enabled
sflow       enabled
snmp        enabled
swss        enabled
syncd       enabled
teamd       enabled
telemetry   enabled

- How I did it
There will be other changes needed and unit added.

This is just to get some feedback about the cli.

- How to verify it
validate in virtual switch.

- 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)

config/main.py Outdated Show resolved Hide resolved
config/main.py Outdated Show resolved Hide resolved
show/main.py Outdated Show resolved Hide resolved
@lgtm-com

This comment has been minimized.

@lgtm-com
Copy link

lgtm-com bot commented Aug 2, 2020

This pull request introduces 3 alerts when merging ecbc066f198ef9883f97e1bc61644ab2849baa75 into c0c3cce - view on LGTM.com

new alerts:

  • 3 for Unused import

@lguohan lguohan marked this pull request as ready for review August 2, 2020 09:33
@lguohan
Copy link
Contributor Author

lguohan commented Aug 2, 2020

@jleveque , unit tests added, please take a look.

sonic-utilities-tests/feature_test.py Show resolved Hide resolved
show/main.py Outdated Show resolved Hide resolved
sonic-utilities-tests/feature_test.py Outdated Show resolved Hide resolved
jleveque
jleveque previously approved these changes Aug 2, 2020
jleveque
jleveque previously approved these changes Aug 3, 2020
merge container feature cli into feature cli

config command:
```
admin@vlab-01:~$ sudo config feature
Usage: config feature [OPTIONS] COMMAND [ARGS]...

  Modify configuration of features

Options:
  -?, -h, --help  Show this message and exit.

Commands:
  autorestart  Configure autorestart status for a feature
  state        Configure status of feature
```

show command:
```
admin@vlab-01:~$ show feature
Usage: show feature [OPTIONS] COMMAND [ARGS]...

  Show feature status

Options:
  -?, -h, --help  Show this message and exit.

Commands:
  autorestart  Show auto-restart status for a feature
  status       Show feature status
```

output:

```
admin@vlab-01:~$ show feature status
Feature     Status    AutoRestart
----------  --------  -------------
lldp        enabled   enabled
pmon        enabled   enabled
sflow       disabled  enabled
database    enabled   disabled
restapi     disabled  enabled
telemetry   enabled   enabled
snmp        enabled   enabled
bgp         enabled   enabled
radv        enabled   enabled
dhcp_relay  enabled   enabled
nat         enabled   enabled
teamd       enabled   enabled
syncd       enabled   enabled
swss        enabled   enabled
admin@vlab-01:~$ show feature autorestart
Feature     AutoRestart
----------  -------------
lldp        enabled
pmon        enabled
sflow       enabled
database    disabled
restapi     enabled
telemetry   enabled
snmp        enabled
bgp         enabled
radv        enabled
dhcp_relay  enabled
nat         enabled
teamd       enabled
syncd       enabled
swss        enabled
```

Signed-off-by: Guohan Lu <lguohan@gmail.com>
Signed-off-by: Guohan Lu <lguohan@gmail.com>
Signed-off-by: Guohan Lu <lguohan@gmail.com>
Signed-off-by: Guohan Lu <lguohan@gmail.com>
Signed-off-by: Guohan Lu <lguohan@gmail.com>
Signed-off-by: Guohan Lu <lguohan@gmail.com>
Signed-off-by: Guohan Lu <lguohan@gmail.com>
@lguohan
Copy link
Contributor Author

lguohan commented Aug 3, 2020

@jleveque , rebased to current mastre

Signed-off-by: Guohan Lu <lguohan@gmail.com>
@lguohan
Copy link
Contributor Author

lguohan commented Aug 3, 2020

test failure is not related to the pr.

@lguohan lguohan merged commit 9700e45 into sonic-net:master Aug 3, 2020
@lguohan lguohan deleted the feature branch August 3, 2020 18:47
abdosi pushed a commit that referenced this pull request Aug 9, 2020
merge container feature cli into feature cli

config command:
```
admin@vlab-01:~$ sudo config feature
Usage: config feature [OPTIONS] COMMAND [ARGS]...

  Modify configuration of features

Options:
  -?, -h, --help  Show this message and exit.

Commands:
  autorestart  Configure autorestart status for a feature
  state        Configure status of feature
```

show command:
```
admin@vlab-01:~$ show feature
Usage: show feature [OPTIONS] COMMAND [ARGS]...

  Show feature status

Options:
  -?, -h, --help  Show this message and exit.

Commands:
  autorestart  Show auto-restart status for a feature
  status       Show feature status
```

output:

```
admin@vlab-01:~$ show feature status
Feature     Status    AutoRestart
----------  --------  -------------
lldp        enabled   enabled
pmon        enabled   enabled
sflow       disabled  enabled
database    enabled   disabled
restapi     disabled  enabled
telemetry   enabled   enabled
snmp        enabled   enabled
bgp         enabled   enabled
radv        enabled   enabled
dhcp_relay  enabled   enabled
nat         enabled   enabled
teamd       enabled   enabled
syncd       enabled   enabled
swss        enabled   enabled
admin@vlab-01:~$ show feature autorestart
Feature     AutoRestart
----------  -------------
lldp        enabled
pmon        enabled
sflow       enabled
database    disabled
restapi     enabled
telemetry   enabled
snmp        enabled
bgp         enabled
radv        enabled
dhcp_relay  enabled
nat         enabled
teamd       enabled
syncd       enabled
swss        enabled
```

Signed-off-by: Guohan Lu <lguohan@gmail.com>
abdosi added a commit that referenced this pull request Aug 9, 2020
[show/config]: combine feature and container feature cli (#1015)

Signed-off-by: Abhishek Dosi <abdosi@microsoft.com>
stepanblyschak pushed a commit to stepanblyschak/sonic-utilities that referenced this pull request Apr 28, 2022
As part of this commit and previous commit ff6cb6c
sonic-utilities submodule for 201911 has been updated to take following
changes:

 Add support for QSFP-DD cables on 'show' command (sonic-net#989)
 [show] Fix for 'trunk' PortChannel reported as 'routed' port (sonic-net#1002)
Enable HW watchdog before fast-reboot (sonic-net#977)
 [filter-fdb] Check VLAN Presence When Filter FDB (sonic-net#957) (sonic-net#975)
[filter-fdb] Fix For Vlan Defined With No CIDR (sonic-net#976)
 [show/config]: combine feature and container feature cli (sonic-net#1015)
stepanblyschak pushed a commit to stepanblyschak/sonic-utilities that referenced this pull request Apr 28, 2022
1. remove container feature table
2. do not generate feature entry if the feature is not included
   in the image
3. rename ENABLE_* to INCLUDE_* for better clarity
4. rename feature status to feature state
5. [submodule]: update sonic-utilities

* 9700e45 2020-08-03 | [show/config]: combine feature and container feature cli (sonic-net#1015) (HEAD, origin/master, origin/HEAD) [lguohan]
* c9d3550 2020-08-03 | [tests]: fix drops_group_test failure on second run (sonic-net#1023) [lguohan]
* dfaae69 2020-08-03 | [lldpshow]: Fix input device is not a TTY error (sonic-net#1016) [Arun Saravanan Balachandran]
* 216688e 2020-08-02 | [tests]: rename sonic-utilitie-tests to tests (sonic-net#1022) [lguohan]

Signed-off-by: Guohan Lu <lguohan@gmail.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants