| 266 | * In the last block of the experiment script, all the groups are started and stopped individually by referencing the previously defined group names. |
| 267 | {{{ |
| 268 | onEvent(:ALL_UP_AND_INSTALLED) do |event| |
| 269 | info "Wifi Multi Client Iperf Experiment" |
| 270 | wait 10 |
| 271 | |
| 272 | info "Start access point" |
| 273 | group('AP').startApplications |
| 274 | |
| 275 | |
| 276 | res.each_with_index do |v,i| |
| 277 | info "Start client #{i+1} ==> #{v}" |
| 278 | group("client#{i+1}").startApplications |
| 279 | wait property.interval |
| 280 | end |
| 281 | |
| 282 | res.each_with_index do |v,i| |
| 283 | info "Stop client #{i+1} ==> #{v}" |
| 284 | group("client#{i+1}").stopApplications |
| 285 | wait property.interval |
| 286 | end |
| 287 | |
| 288 | info "Stop access point" |
| 289 | group('AP').stopApplications |
| 290 | |
| 291 | info "All my Applications are stopped now." |
| 292 | Experiment.done |
| 293 | end |
| 294 | }}} |
| 295 | The client groups are referenced with the additional Ruby code to allow starting each iperf session and wait before starting the next. The iperf sessions are stopped in a similar way as well. |