Daniele Moro | 790cc10 | 2021-08-30 18:27:30 +0200 | [diff] [blame] | 1 | class UP4: |
| 2 | |
| 3 | def __init__(self): |
| 4 | self.default = '' |
| 5 | |
| 6 | # TODO: add test case that checks entries are being inserted and deleted from ONOS correclty |
| 7 | def CASE1(self, main): |
| 8 | """ |
| 9 | Attach UE |
| 10 | Generate traffic from UE to PDN |
| 11 | Verify traffic received from PDN |
| 12 | Generate traffic from PDN to UE |
| 13 | Verify traffic received from UE |
| 14 | Detach UE |
| 15 | """ |
Daniele Moro | 790cc10 | 2021-08-30 18:27:30 +0200 | [diff] [blame] | 16 | try: |
Daniele Moro | 8088956 | 2021-09-08 10:09:26 +0200 | [diff] [blame^] | 17 | from tests.USECASE.SegmentRouting.dependencies.up4 import UP4 |
Daniele Moro | 790cc10 | 2021-08-30 18:27:30 +0200 | [diff] [blame] | 18 | from tests.USECASE.SegmentRouting.dependencies.Testcaselib import \ |
| 19 | Testcaselib as run |
Daniele Moro | 790cc10 | 2021-08-30 18:27:30 +0200 | [diff] [blame] | 20 | except ImportError as e: |
| 21 | main.log.error("Import not found. Exiting the test") |
| 22 | main.log.error(e) |
| 23 | main.cleanAndExit() |
| 24 | |
Daniele Moro | 790cc10 | 2021-08-30 18:27:30 +0200 | [diff] [blame] | 25 | run.initTest(main) |
| 26 | main.log.info(main.Cluster.numCtrls) |
| 27 | main.Cluster.setRunningNode(3) |
| 28 | run.installOnos(main, skipPackage=True, cliSleep=5) |
| 29 | |
Daniele Moro | 790cc10 | 2021-08-30 18:27:30 +0200 | [diff] [blame] | 30 | main.step("Start scapy and p4rt client") |
Daniele Moro | 8088956 | 2021-09-08 10:09:26 +0200 | [diff] [blame^] | 31 | up4 = UP4() |
| 32 | # Get the P4RT client connected to UP4 in the first available ONOS instance |
| 33 | up4.setup(main.Cluster.active(0).p4rtUp4) |
Daniele Moro | 790cc10 | 2021-08-30 18:27:30 +0200 | [diff] [blame] | 34 | |
Daniele Moro | 790cc10 | 2021-08-30 18:27:30 +0200 | [diff] [blame] | 35 | main.step("Attach UEs") |
Daniele Moro | 8088956 | 2021-09-08 10:09:26 +0200 | [diff] [blame^] | 36 | up4.attachUes() |
Daniele Moro | 790cc10 | 2021-08-30 18:27:30 +0200 | [diff] [blame] | 37 | |
Daniele Moro | 8088956 | 2021-09-08 10:09:26 +0200 | [diff] [blame^] | 38 | # ------- Test Upstream traffic (enb->pdn) |
Daniele Moro | 790cc10 | 2021-08-30 18:27:30 +0200 | [diff] [blame] | 39 | main.step("Test upstream traffic") |
Daniele Moro | 8088956 | 2021-09-08 10:09:26 +0200 | [diff] [blame^] | 40 | up4.testUpstreamTraffic() |
Daniele Moro | 790cc10 | 2021-08-30 18:27:30 +0200 | [diff] [blame] | 41 | |
Daniele Moro | 8088956 | 2021-09-08 10:09:26 +0200 | [diff] [blame^] | 42 | # ------- Test Downstream traffic (pdn->enb) |
Daniele Moro | 790cc10 | 2021-08-30 18:27:30 +0200 | [diff] [blame] | 43 | main.step("Test downstream traffic") |
Daniele Moro | 8088956 | 2021-09-08 10:09:26 +0200 | [diff] [blame^] | 44 | up4.testDownstreamTraffic() |
Daniele Moro | 790cc10 | 2021-08-30 18:27:30 +0200 | [diff] [blame] | 45 | |
Daniele Moro | 790cc10 | 2021-08-30 18:27:30 +0200 | [diff] [blame] | 46 | main.step("Detach UEs") |
Daniele Moro | 8088956 | 2021-09-08 10:09:26 +0200 | [diff] [blame^] | 47 | up4.detachUes() |
Daniele Moro | 790cc10 | 2021-08-30 18:27:30 +0200 | [diff] [blame] | 48 | |
Daniele Moro | 790cc10 | 2021-08-30 18:27:30 +0200 | [diff] [blame] | 49 | main.step("Stop scapy and p4rt client") |
Daniele Moro | 8088956 | 2021-09-08 10:09:26 +0200 | [diff] [blame^] | 50 | up4.teardown() |
Daniele Moro | 790cc10 | 2021-08-30 18:27:30 +0200 | [diff] [blame] | 51 | run.cleanup(main) |