question

JeffJ avatar image
JeffJ asked JeffJ posted

How do you compare two tables?

I have a customer that has a CSV file that contains a table of values that they are using to configure their network.  After the configuration, they are querying the DUT(s) to see if the proper configuration was realized.  The return from the DUT is also a table.

 

In general, the analysis logic is as follows:

If the intersection of the two tables is null Then The test case passes Else Fail the test case and display the extra rows in the execution messages.

 

This test case will be run against 100+ devices so the request is to keep the execution time to a minimum.

 

At the current time, the solution determines the which table has the most rows and loops through the larger table comparing the rows to the rows in the smaller table.  If the row matches exactly, a PassIfNotAlreadyFailed is set.  If not, each element of the row is checked to see what's incorrect at which time a message is printed with the incorrect element and the test case is marked as Failed.

 

While this works and has greatly reduced execution time by a factor of 2, is there a more efficient method for doing this?

 

iTest
10 |950

Up to 2 attachments (including images) can be used with a maximum of 512.0 KiB each and 1.0 MiB total.

1 Answer

·
KumarS avatar image
KumarS answered KumarS posted
the approach looks ok to me. If you have 200+ devices, you can configure them in parallel and that will give you a lot of speed up.
10 |950

Up to 2 attachments (including images) can be used with a maximum of 512.0 KiB each and 1.0 MiB total.

Write an Answer

Hint: Notify or tag a user in this post by typing @username.

Up to 2 attachments (including images) can be used with a maximum of 512.0 KiB each and 1.0 MiB total.