question

gbod avatar image
gbod asked ericnute edited

Interface names in multiline tables.

I have a problem with tables. In one of the test responses is table like this one: > brctl show bridge name bridge id STP enabled interfaces br0 8000.00c0025dc582 no eth1.0 eth4.0 eth0.0 wl0 atm0.1 br1 8000.00c0025dc582 no eth3.0 atm1.1 br2 8000.00c0025dc582 no atm1.4 eth2.0 br3 8000.00c0025dc582 no atm1.5 br4 8000.000000000000 no after some more steps in the test the table looks like this: > brctl show bridge name bridge id STP enabled interfaces br0 8000.00c0025dc582 no eth1.0 eth4.0 eth0.0 wl0 atm0.1 eth4.4001 br1 8000.00c0025dc582 no eth3.0 eth4.3999 atm1.1 br2 8000.00c0025dc582 no atm1.4 eth2.0 eth4.3998 br3 8000.00c0025dc582 no atm1.5 eth4.100 br4 8000.000000000000 no and after some more steps like this: > brctl show bridge name bridge id STP enabled interfaces br0 8000.00c0025dc582 no eth1.0 eth4.0 eth0.0 wl0 atm0.1 eth4.4001 br1 8000.00c0025dc582 no eth4.3999 atm1.1 br2 8000.00c0025dc582 no atm1.4 eth2.0 eth4.3998 br3 8000.00c0025dc582 no atm1.5 eth4.100 br4 8000.00c0025dc582 no eth3.0 I am trying to parse out all interfaces in all bridges to verify thah the bridges are correct.. Like this: br0 - eth1.0,eth4.0,eth0.0,wl0,atm0.1,eth4.4001 br1 - eth4.3999,atm1.1 br2 - atm1.4,eth2.0,eth4.3998 br3 - atm1.5,eth4.100 br4 - eth3.0 Aditional problem is that ATM interfaces may change with PTM and ETH. I have tried to use solution in this thread but it did not worked as expected. [Link to similar problem][1] [1]: http://itestforums.spirent.com/questions/13552/multi-line-table.html
iTesttable map
10 |950

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

msandeep avatar image
msandeep answered ericnute edited
Attached is the sample test case which demonstrate on how to extract the interfaces as you shown. [[Please be posting how it goes!][1]][1] [1]: /storage/attachments/3555-sample.fftc

sample.fftc (9.2 KiB)
10 |950

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

gbod avatar image
gbod answered
I manage to do it in a bit different way than first planned. I attached the working testcase. I used for loops and modfied events on eval statement to break the loop if empty group is detected. [Link to attached testcase][1] Prints look like: br0 - eth1.0 br0 - eth4.0 br0 - eth0.0 br0 - wl0 br0 - atm0.1 br0 - eth4.4001 br1 - eth4.3999 br1 - atm1.1 br2 - atm1.4 br2 - eth2.0 br2 - eth4.3998 br3 - atm1.5 br3 - eth4.100 br4 - eth3.0 [1]: /storage/temp/3554-cpe_interface_bridge.zip

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.