Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
15 changes: 2 additions & 13 deletions tests/test_features.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,15 +6,6 @@
pytest.mark.topology('any')
]

def get_status_redisout(status_out):
"""Extract status value for feature in redis
"""
status_list = status_out[1:]
status = ""
for s in status_list:
status = s.encode('UTF-8')
return status

# Test Functions
def test_show_features(duthost):
"""Verify show features command output against CONFIG_DB
Expand All @@ -23,7 +14,5 @@ def test_show_features(duthost):
pytest_assert(succeeded, "failed to obtain feature status")
for cmd_key, cmd_value in features_dict.items():
feature = str(cmd_key)
status_out = duthost.shell('/usr/bin/redis-cli -n 4 hgetall "FEATURE|{}"'.format(feature), module_ignore_errors=False)['stdout_lines']
redis_value = get_status_redisout(status_out)
status_value_expected = str(cmd_value)
assert str(redis_value) == status_value_expected, "'{}' is '{}' which does not match with config_db".format(cmd_key, cmd_value)
redis_value = duthost.shell('/usr/bin/redis-cli -n 4 --raw hget "FEATURE|{}" "state"'.format(feature), module_ignore_errors=False)['stdout']
pytest_assert(redis_value.lower() == cmd_value.lower(), "'{}' is '{}' which does not match with config_db".format(cmd_key, cmd_value))