gluster / glusto-tests

Functional test framework for glusterfs.
GNU General Public License v3.0
19 stars 43 forks source link

[TestFix] Fix test_sosreport_interoperability.py #78

Closed pranavprakash20 closed 3 years ago

pranavprakash20 commented 3 years ago

Fixing the comaprison logic for dirs before SOS report generation and after

Problem: The current approach is using == operator for comparing two lists. The issue happens when the lists are in different order, for e.g:

a = [1,2,3] b = [1,3,2] a == b False

The comparison returns False, whereas the content of the lists are same.

Solution:

Use set() instead to ensure that the contents are similar, E.g.

set(a) - set(b) set()

Signed-off-by: Pranav prprakas@redhat.com

pranavprakash20 commented 3 years ago

functional/bvt/test_sosreport_interoperability.py::ValidateSosreportBehavior_cplex_distributed-dispersed_glusterfs::test_sosreport_behavior_for_glusterfs PASSED [ 33%] functional/bvt/test_sosreport_interoperability.py::ValidateSosreportBehavior_cplex_arbiter_glusterfs::test_sosreport_behavior_for_glusterfs PASSED [ 66%] functional/bvt/test_sosreport_interoperability.py::ValidateSosreportBehavior_cplex_distributed-replicated_glusterfs::test_sosreport_behavior_for_glusterfs PASSED [100%]