|
@@ 158-169 (lines=12) @@
|
| 155 |
|
|
| 156 |
|
self.assertFalse(result) |
| 157 |
|
|
| 158 |
|
def test_check_step_wrong_port(self): |
| 159 |
|
"""Verify if check_step fail with different port.""" |
| 160 |
|
trace_step = {"dpid": "00:00:00:00:00:00:00:01", "port": 1} |
| 161 |
|
circuit_step = {} |
| 162 |
|
circuit_step["dpid"] = trace_step["dpid"] |
| 163 |
|
circuit_step["in_port"] = 2 |
| 164 |
|
|
| 165 |
|
tracer = MagicMock() |
| 166 |
|
automate = Automate(tracer) |
| 167 |
|
result = automate.check_step(circuit_step, trace_step) |
| 168 |
|
|
| 169 |
|
self.assertFalse(result) |
| 170 |
|
|
| 171 |
|
@patch("napps.amlight.sdntrace_cp.automate.Automate.get_circuit") |
| 172 |
|
@patch("napps.amlight.sdntrace_cp.automate.Automate.find_circuits") |
|
@@ 145-156 (lines=12) @@
|
| 142 |
|
|
| 143 |
|
self.assertTrue(result) |
| 144 |
|
|
| 145 |
|
def test_check_step_wront_dpid(self): |
| 146 |
|
"""Verify if check_step fail with different dpid.""" |
| 147 |
|
trace_step = {"dpid": "00:00:00:00:00:00:00:01", "port": 1} |
| 148 |
|
circuit_step = {} |
| 149 |
|
circuit_step["dpid"] = "00:00:00:00:00:00:00:02" |
| 150 |
|
circuit_step["in_port"] = trace_step["port"] |
| 151 |
|
|
| 152 |
|
tracer = MagicMock() |
| 153 |
|
automate = Automate(tracer) |
| 154 |
|
result = automate.check_step(circuit_step, trace_step) |
| 155 |
|
|
| 156 |
|
self.assertFalse(result) |
| 157 |
|
|
| 158 |
|
def test_check_step_wrong_port(self): |
| 159 |
|
"""Verify if check_step fail with different port.""" |