Skip to content

Commit

Permalink
Merge pull request #11 from trema/feature/fix_multi_conf
Browse files Browse the repository at this point in the history
Fix network config of multi-learning-sw scenario.
  • Loading branch information
yasuhito committed Oct 22, 2015
2 parents 1c57dbb + 21bed70 commit 789c24d
Show file tree
Hide file tree
Showing 2 changed files with 41 additions and 43 deletions.
3 changes: 3 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,9 @@
### Changes
* [#2](https://github.com/trema/learning_switch/pull/2): Trema 0.7.1.

### Bugs fixed
* [#10](https://github.com/trema/learning_switch/issues/10): Fix network configuration of multi-learning-switch cucumber scenario.


## 0.4.2 (10/21/2015)
### Bugs fixed
Expand Down
81 changes: 38 additions & 43 deletions features/multi_learning_switch.feature
Original file line number Diff line number Diff line change
Expand Up @@ -4,69 +4,64 @@ Feature: "Multi Learning Switch" example
"""
vswitch('lsw1') { datapath_id 0x1 }
vswitch('lsw2') { datapath_id 0x2 }
vswitch('lsw3') { datapath_id 0x3 }
vswitch('lsw4') { datapath_id 0x4 }
vhost('host1')
vhost('host2')
vhost('host3')
vhost('host4')
vhost('host1-1')
vhost('host1-2')
vhost('host2-1')
vhost('host2-2')
link 'lsw1', 'host1'
link 'lsw2', 'host2'
link 'lsw3', 'host3'
link 'lsw4', 'host4'
link 'lsw1', 'lsw2'
link 'lsw2', 'lsw3'
link 'lsw3', 'lsw4'
link 'lsw1', 'host1-1'
link 'lsw1', 'host1-2'
link 'lsw2', 'host2-1'
link 'lsw2', 'host2-2'
"""

@sudo
Scenario: Run
Given I run `trema run ../../lib/multi_learning_switch.rb -c trema.conf` interactively
And I run `sleep 10`
When I run `trema send_packets --source host1 --dest host2 --npackets 2`
When I run `trema send_packets --source host1-1 --dest host1-2 --npackets 2`
Then the total number of received packets should be:
| host1 | host2 | host3 | host4 |
| 0 | 2 | 0 | 0 |
When I run `trema send_packets --source host3 --dest host4 --npackets 3`
| host1-1 | host1-2 | host2-1 | host2-2 |
| 0 | 2 | 0 | 0 |
When I run `trema send_packets --source host2-1 --dest host2-2 --npackets 3`
Then the total number of received packets should be:
| host1 | host2 | host3 | host4 |
| 0 | 2 | 0 | 3 |
When I run `trema send_packets --source host4 --dest host1 --npackets 2`
| host1-1 | host1-2 | host2-1 | host2-2 |
| 0 | 2 | 0 | 3 |
When I run `trema send_packets --source host2-2 --dest host1-1 --npackets 2`
Then the total number of received packets should be:
| host1 | host2 | host3 | host4 |
| 2 | 2 | 0 | 3 |
When I run `trema send_packets --source host2 --dest host3 --npackets 4`
| host1-1 | host1-2 | host2-1 | host2-2 |
| 0 | 2 | 0 | 3 |
When I run `trema send_packets --source host1-2 --dest host2-1 --npackets 4`
Then the total number of received packets should be:
| host1 | host2 | host3 | host4 |
| 2 | 2 | 4 | 3 |
When I run `trema send_packets --source host1 --dest host4 --npackets 1`
| host1-1 | host1-2 | host2-1 | host2-2 |
| 0 | 2 | 0 | 3 |
When I run `trema send_packets --source host1-1 --dest host2-2 --npackets 1`
And the total number of received packets should be:
| host1 | host2 | host3 | host4 |
| 2 | 2 | 4 | 4 |
| host1-1 | host1-2 | host2-1 | host2-2 |
| 0 | 2 | 0 | 3 |

@sudo
Scenario: Run as a daemon
Given I successfully run `trema run ../../lib/multi_learning_switch.rb -c trema.conf -d`
And I run `sleep 10`
When I successfully run `trema send_packets --source host1 --dest host2 --npackets 2`
When I successfully run `trema send_packets --source host1-1 --dest host1-2 --npackets 2`
Then the total number of received packets should be:
| host1 | host2 | host3 | host4 |
| 0 | 2 | 0 | 0 |
When I successfully run `trema send_packets --source host3 --dest host4 --npackets 3`
| host1-1 | host1-2 | host2-1 | host2-2 |
| 0 | 2 | 0 | 0 |
When I successfully run `trema send_packets --source host2-1 --dest host2-2 --npackets 3`
Then the total number of received packets should be:
| host1 | host2 | host3 | host4 |
| 0 | 2 | 0 | 3 |
When I successfully run `trema send_packets --source host4 --dest host1 --npackets 2`
| host1-1 | host1-2 | host2-1 | host2-2 |
| 0 | 2 | 0 | 3 |
When I successfully run `trema send_packets --source host2-2 --dest host1-1 --npackets 2`
Then the total number of received packets should be:
| host1 | host2 | host3 | host4 |
| 2 | 2 | 0 | 3 |
When I successfully run `trema send_packets --source host2 --dest host3 --npackets 4`
| host1-1 | host1-2 | host2-1 | host2-2 |
| 0 | 2 | 0 | 3 |
When I successfully run `trema send_packets --source host1-2 --dest host2-1 --npackets 4`
Then the total number of received packets should be:
| host1 | host2 | host3 | host4 |
| 2 | 2 | 4 | 3 |
When I successfully run `trema send_packets --source host1 --dest host4 --npackets 1`
| host1-1 | host1-2 | host2-1 | host2-2 |
| 0 | 2 | 0 | 3 |
When I successfully run `trema send_packets --source host1-1 --dest host2-2 --npackets 1`
Then the total number of received packets should be:
| host1 | host2 | host3 | host4 |
| 2 | 2 | 4 | 4 |
| host1-1 | host1-2 | host2-1 | host2-2 |
| 0 | 2 | 0 | 3 |

0 comments on commit 789c24d

Please sign in to comment.