blob: 2578521db8a3254234caa795ef669171735c4193 [file] [log] [blame]
A R Karthick35495c32017-05-11 14:58:32 -07001import os
2import sys
3import unittest
4from nose.tools import *
5from CordTestConfig import setup_module
6from CordTestUtils import log_test
7from VolthaCtrl import VolthaCtrl
8
9class voltha_exchange(unittest.TestCase):
10
11 OLT_TYPE = 'tibit_olt'
12 OLT_MAC = '00:0c:e2:31:12:00'
13 VOLTHA_HOST = 'localhost'
14 VOLTHA_REST_PORT = 8881
15 voltha = None
16
17 @classmethod
18 def setUpClass(cls):
19 cls.voltha = VolthaCtrl(cls.VOLTHA_HOST, rest_port = cls.VOLTHA_REST_PORT)
20
21 def test_olt_enable(self):
22 log_test.info('Enabling OLT type %s, MAC %s' %(self.OLT_TYPE, self.OLT_MAC))
23 status = self.voltha.enable_device(self.OLT_TYPE, self.OLT_MAC)
24 assert_equal(status, True)
Thangavelu K S008f38e2017-05-15 19:36:55 +000025
26 def test_subscriber_with_voltha_for_eap_tls_authentication(self):
27 """
28 Test Method:
29 0. Make sure that voltha is up and running on CORD-POD setup.
30 1. OLT and ONU is detected and validated.
31 2. Bring up freeradius server container using CORD TESTER and make sure that ONOS have connectivity to freeradius server.
32 3. Issue auth request packets from CORD TESTER voltha test module acting as a subscriber..
33 4. Validate that eap tls valid auth packets are being exchanged between subscriber, onos and freeradius.
34 5. Verify that subscriber is authenticated successfully.
35 """
36
37 def test_subscriber_with_voltha_for_eap_tls_authentication_failure(self):
38 """
39 Test Method:
40 0. Make sure that voltha is up and running on CORD-POD setup.
41 1. OLT and ONU is detected and validated.
42 2. Bring up freeradius server container using CORD TESTER and make sure that ONOS have connectivity to freeradius server.
43 3. Issue tls auth packets from CORD TESTER voltha test module acting as a subscriber..
44 4. Validate that eap tls without cert auth packet is being exchanged between subscriber, onos and freeradius.
45 5. Verify that subscriber authentication is unsuccessful..
46 """
47
48 def test_subscriber_with_voltha_for_eap_tls_authentication_using_invalid_cert(self):
49 """
50 Test Method:
51 0. Make sure that voltha is up and running on CORD-POD setup.
52 1. OLT and ONU is detected and validated.
53 2. Bring up freeradius server container using CORD TESTER and make sure that ONOS have connectivity to freeradius server.
54 3. Issue tls auth packets and exchange invalid cert from CORD TESTER voltha test module acting as a subscriber..
55 4. Validate that eap tls with invalid cert auth packet is being exchanged between subscriber, onos and freeradius.
56 5. Verify that subscriber authentication is unsuccessful..
57 """
58
59 def test_subscriber_with_voltha_for_eap_tls_authentication_with_aaa_app_deactivation(self):
60 """
61 Test Method:
62 0. Make sure that voltha is up and running on CORD-POD setup.
63 1. OLT and ONU is detected and validated.
64 2. Bring up freeradius server container using CORD TESTER and make sure that ONOS have connectivity to freeradius server.
65 3. Issue tls auth packets from CORD TESTER voltha test module acting as a subscriber..
66 4. Validate that eap tls without sending client hello, it's not being exchanged between client, onos and freeradius.
67 5. Verify that subscriber authentication is unsuccessful..
68 """
69
70 def test_subscriber_with_voltha_for_eap_tls_authentication_restarting_radius_server(self):
71 """
72 Test Method:
73 0. Make sure that voltha is up and running on CORD-POD setup.
74 1. OLT and ONU is detected and validated.
75 2. Bring up freeradius server container using CORD TESTER and make sure that ONOS have connectivity to freeradius server.
76 3. Issue tls auth packets from CORD TESTER voltha test module acting as a subscriber..
77 4. Validate that eap tls with restart of radius server and packets are being exchanged between subscriber, onos and freeradius.
78 5. Verify that subscriber authentication is unsuccessful..
79 """
80
81 def test_subscriber_with_voltha_for_eap_tls_authentication_with_disabled_olt(self):
82 """
83 Test Method:
84 0. Make sure that voltha is up and running on CORD-POD setup.
85 1. OLT and ONU is detected and validated.
86 2. Bring up freeradius server container using CORD TESTER and make sure that ONOS have connectivity to freeradius server.
87 3. Issue tls auth packets from CORD TESTER voltha test module acting as a subscriber..
88 5. Validate that eap tls packets are being exchanged between subscriber, onos and freeradius.
89 6. Verify that subscriber authenticated successfully.
90 7. Disable olt which is seen in voltha and issue tls auth packets from subscriber.
91 8. Validate that eap tls packets are not being exchanged between subscriber, onos and freeradius.
92 9. Verify that subscriber authentication is unsuccessful..
93 """
94
95 def test_subscriber_with_voltha_for_eap_tls_authentication_disabling_uni_port_in_voltha(self):
96 """
97 Test Method:
98 0. Make sure that voltha is up and running on CORD-POD setup.
99 1. OLT and ONU is detected and validated.
100 2. Bring up freeradius server container using CORD TESTER and make sure that ONOS have connectivity to freeradius server.
101 3. Issue tls auth packets from CORD TESTER voltha test module acting as a subscriber..
102 5. Validate that eap tls packets are being exchanged between subscriber, onos and freeradius.
103 6. Verify that subscriber authenticated successfully.
104 7. Disable uni port which is seen in voltha and issue tls auth packets from subscriber.
105 8. Validate that eap tls packets are not being exchanged between subscriber, onos and freeradius.
106 9. Verify that subscriber authentication is unsuccessful..
107 """
108
109 def test_subscriber_with_voltha_for_eap_tls_authentication_restarting_olt(self):
110 """
111 Test Method:
112 0. Make sure that voltha is up and running on CORD-POD setup.
113 1. OLT and ONU is detected and validated.
114 2. Bring up freeradius server container using CORD TESTER and make sure that ONOS have connectivity to freeradius server.
115 3. Issue tls auth packets from CORD TESTER voltha test module acting as a subscriber..
116 5. Validate that eap tls packets are being exchanged between subscriber, onos and freeradius.
117 6. Verify that subscriber authenticated successfully.
118 7. Restart olt which is seen in voltha and issue tls auth packets from subscriber.
119 8. Validate that eap tls packets are not being exchanged between subscriber, onos and freeradius.
120 9. Verify that subscriber authentication is unsuccessful..
121 """
122
123 def test_subscriber_with_voltha_for_eap_tls_authentication_restarting_onu(self):
124 """
125 Test Method:
126 0. Make sure that voltha is up and running on CORD-POD setup.
127 1. OLT and ONU is detected and validated.
128 2. Bring up freeradius server container using CORD TESTER and make sure that ONOS have connectivity to freeradius server.
129 3. Issue tls auth packets from CORD TESTER voltha test module acting as a subscriber..
130 5. Validate that eap tls packets are being exchanged between subscriber, onos and freeradius.
131 6. Verify that subscriber authenticated successfully.
132 7. Restart onu which is seen in voltha and issue tls auth packets from subscriber.
133 8. Validate that eap tls packets are not being exchanged between subscriber, onos and freeradius.
134 9. Verify that subscriber authentication is unsuccessful..
135 """
136
137 def test_two_subscribers_with_voltha_for_eap_tls_authentication(self):
138 """
139 Test Method:
140 0. Make sure that voltha is up and running on CORD-POD setup.
141 1. OLT is detected and ONU ports(nni and 2 uni's) are being seen.
142 2. Bring up freeradius server container using CORD TESTER and make sure that ONOS have connectivity to freeradius server.
143 3. Bring up two Residential subscribers from cord-tester and issue tls auth packets from CORD TESTER voltha test module acting as a subscriber..
144 4. Validate that eap tls valid auth packets are being exchanged between two subscriber, onos and freeradius.
145 5. Verify that two subscribers are authenticated successfully.
146 """
147
148 def test_two_subscribers_with_voltha_for_eap_tls_authentication_using_same_certificates(self):
149 """
150 Test Method:
151 0. Make sure that voltha is up and running on CORD-POD setup.
152 1. OLT is detected and ONU ports(nni and 2 uni's) are being seen.
153 2. Bring up freeradius server container using CORD TESTER and make sure that ONOS have connectivity to freeradius server.
154 3. Bring up two Residential subscribers from cord-tester and issue tls auth packets from CORD TESTER voltha test module acting as a subscriber..
155 4. Validate that two valid certificates are being exchanged between two subscriber, onos and freeradius.
156 5. Verify that two subscribers are not authenticated.
157 """
158
159 def test_two_subscribers_with_voltha_for_eap_tls_authentication_initiating_invalid_tls_packets_for_one_subscriber(self):
160 """
161 Test Method:
162 0. Make sure that voltha is up and running on CORD-POD setup.
163 1. OLT is detected and ONU ports(nni and 2 uni's) are being seen.
164 2. Bring up freeradius server container using CORD TESTER and make sure that ONOS have connectivity to freeradius server.
165 3. Bring up two Residential subscribers from cord-tester and issue tls auth packets from CORD TESTER voltha test module acting as a subscriber..
166 4. Validate that eap tls valid auth packets are being exchanged between valid subscriber, onos and freeradius.
167 5. Validate that eap tls valid auth packets are being exchanged between invalid client, onos and freeradius.
168 6. Verify that valid subscriber authenticated successfully.
169 7. Verify that invalid subscriber are not authenticated successfully.
170 """
171
172 def test_two_subscribers_with_voltha_for_eap_tls_authentication_initiating_invalid_cert_for_one_subscriber(self):
173 """
174 Test Method:
175 0. Make sure that voltha is up and running on CORD-POD setup.
176 1. OLT is detected and ONU ports(nni and 2 uni's) are being seen.
177 2. Bring up freeradius server container using CORD TESTER and make sure that ONOS have connectivity to freeradius server.
178 3. Bring up two Residential subscribers from cord-tester and issue tls auth packets from CORD TESTER voltha test module acting as a subscriber..
179 4. Validate that eap tls valid auth packets are being exchanged between valid subscriber, onos and freeradius.
180 5. Validate that eap tls invalid cert auth packets are being exchanged between invalid subscriber, onos and freeradius.
181 6. Verify that valid subscriber authenticated successfully.
182 7. Verify that invalid subscriber are not authenticated successfully.
183 """
184
185 def test_two_subscribers_with_voltha_for_eap_tls_authentication_with_one_uni_port_disabled(self):
186 """
187 Test Method:
188 0. Make sure that voltha is up and running on CORD-POD setup.
189 1. OLT and ONU is detected and validated.
190 2. Bring up freeradius server container using CORD TESTER and make sure that ONOS have connectivity to freeradius server.
191 3. Bring up two Residential subscribers from cord-tester and issue tls auth packets from CORD TESTER voltha test module acting as a subscriber..
192 5. Validate that eap tls packets are being exchanged between two subscriber, onos and freeradius.
193 6. Verify that subscriber authenticated successfully.
194 7. Disable one of the uni port which is seen in voltha and issue tls auth packets from subscriber.
195 8. Validate that eap tls packets are not being exchanged between one subscriber, onos and freeradius.
196 9. Verify that subscriber authentication is unsuccessful..
197 10. Verify that other subscriber authenticated successfully.
198 """
199
200 def test_subscriber_with_voltha_for_dhcp_request(self):
201 """
202 Test Method:
203 0. Make sure that voltha is up and running on CORD-POD setup.
204 1. OLT and ONU is detected and validated.
205 2. Issue tls auth packets from CORD TESTER voltha test module acting as a subscriber..
206 3. Send dhcp request from residential subscrber to dhcp server which is running as onos app.
207 4. Verify that subscriber get ip from dhcp server successfully.
208 """
209
210 def test_subscriber_with_voltha_for_dhcp_request_with_invalid_broadcast_source_mac(self):
211 """
212 Test Method:
213 0. Make sure that voltha is up and running on CORD-POD setup.
214 1. OLT and ONU is detected and validated.
215 2. Issue tls auth packets from CORD TESTER voltha test module acting as a subscriber..
216 3. Send dhcp request with invalid source mac broadcast from residential subscrber to dhcp server which is running as onos app.
217 4. Verify that subscriber should not get ip from dhcp server.
218 """
219
220 def test_subscriber_with_voltha_for_dhcp_request_with_invalid_multicast_source_mac(self):
221 """
222 Test Method:
223 0. Make sure that voltha is up and running on CORD-POD setup.
224 1. OLT and ONU is detected and validated.
225 2. Issue tls auth packets from CORD TESTER voltha test module acting as a subscriber..
226 3. Send dhcp request with invalid source mac multicast from residential subscrber to dhcp server which is running as onos app.
227 4. Verify that subscriber should not get ip from dhcp server.
228 """
229
230 def test_subscriber_with_voltha_for_dhcp_request_with_invalid_source_mac(self):
231 """
232 Test Method:
233 0. Make sure that voltha is up and running on CORD-POD setup.
234 1. OLT and ONU is detected and validated.
235 2. Issue tls auth packets from CORD TESTER voltha test module acting as a subscriber..
236 3. Send dhcp request with invalid source mac zero from residential subscrber to dhcp server which is running as onos app.
237 4. Verify that subscriber should not get ip from dhcp server.
238 """
239
240 def test_subscriber_with_voltha_for_dhcp_request_and_release(self):
241 """
242 Test Method:
243 0. Make sure that voltha is up and running on CORD-POD setup.
244 1. OLT and ONU is detected and validated.
245 2. Issue tls auth packets from CORD TESTER voltha test module acting as a subscriber..
246 3. Send dhcp request from residential subscrber to dhcp server which is running as onos app.
247 4. Verify that subscriber get ip from dhcp server successfully.
248 5. Send dhcp release from residential subscrber to dhcp server which is running as onos app.
249 6 Verify that subscriber should not get ip from dhcp server, ping to gateway.
250 """
251