@@ -54,9 +54,9 @@ def test_no_encryption(self):
5454 "ssid" : "ap-ssid-example" ,
5555 "bssid" : "00:11:22:33:44:55" ,
5656 },
57- "encryption" : {
58- "protocol" : "none" ,
59- },
57+ # "encryption": {
58+ # "protocol": "none",
59+ # },
6060 }
6161 ]
6262 })
@@ -130,7 +130,7 @@ def test_wpa2_personal(self):
130130 },
131131 {
132132 'status' : 'enabled' ,
133- }
133+ },
134134 ]
135135
136136 self .assertEqualConfig (o .intermediate_data ['wpasupplicant' ], expected )
@@ -163,6 +163,9 @@ def test_wpa2_enterprise(self):
163163 o .to_intermediate ()
164164
165165 expected = [
166+ {
167+ 'status' : 'enabled' ,
168+ },
166169 {
167170 'device.1.profile' : 'AUTO' ,
168171 'device.1.status' : 'enabled' ,
@@ -185,9 +188,6 @@ def test_wpa2_enterprise(self):
185188 'profile.1.network.2.priority' : 2 ,
186189 'profile.1.network.2.status' : 'disabled' ,
187190 },
188- {
189- 'status' : 'enabled' ,
190- }
191191 ]
192192
193193 self .assertEqualConfig (o .intermediate_data ['wpasupplicant' ], expected )
@@ -203,6 +203,50 @@ class TestWpasupplicantAccess(ConverterTest):
203203
204204 def test_no_encryption (self ):
205205
206+ o = self .backend ({
207+ "interfaces" : [
208+ {
209+ "type" : "wireless" ,
210+ "name" : "wlan0" ,
211+ "mac" : "de:9f:db:30:c9:c5" ,
212+ "mtu" : 1500 ,
213+ "txqueuelen" : 1000 ,
214+ "autostart" : True ,
215+ "wireless" : {
216+ "radio" : "radio0" ,
217+ "mode" : "access_point" ,
218+ "ssid" : "ap-ssid-example" ,
219+ },
220+ # "encryption": {
221+ # "protocol": "none",
222+ # },
223+ },
224+ ]
225+ })
226+
227+ o .to_intermediate ()
228+
229+ expected = [
230+ {
231+ 'status' : 'enabled' ,
232+ },
233+ {
234+ 'device.1.profile' : 'AUTO' ,
235+ 'device.1.status' : 'enabled' ,
236+ 'profile.1.name' : 'AUTO' ,
237+ 'profile.1.network.1.priority' : 100 ,
238+ 'profile.1.network.1.ssid' : 'ap-ssid-example' ,
239+ 'profile.1.network.1.key_mgmt.1.name' : 'NONE' ,
240+ 'profile.1.network.2.key_mgmt.1.name' : 'NONE' ,
241+ 'profile.1.network.2.priority' : 2 ,
242+ 'profile.1.network.2.status' : 'disabled' ,
243+ },
244+ ]
245+
246+ self .assertEqualConfig (o .intermediate_data ['wpasupplicant' ], expected )
247+
248+ def test_wpa2_personal (self ):
249+
206250 o = self .backend ({
207251 "interfaces" : [
208252 {
@@ -218,7 +262,8 @@ def test_no_encryption(self):
218262 "ssid" : "ap-ssid-example" ,
219263 },
220264 "encryption" : {
221- "protocol" : "none" ,
265+ "protocol" : "wpa2_personal" ,
266+ "key" : "cucumber" ,
222267 },
223268 }
224269 ]
@@ -228,13 +273,15 @@ def test_no_encryption(self):
228273
229274 expected = [
230275 {
231- 'status' : 'enabled ' ,
276+ 'status' : 'disabled ' ,
232277 },
233278 {
234279 'device.1.profile' : 'AUTO' ,
235- 'device.1.status' : 'enabled' ,
280+ 'device.1.status' : 'disabled' ,
281+ 'profile.1.name' : 'AUTO' ,
236282 'profile.1.network.1.priority' : 100 ,
237283 'profile.1.network.1.ssid' : 'ap-ssid-example' ,
284+ 'profile.1.network.1.psk' : 'cucumber' ,
238285 'profile.1.network.1.key_mgmt.1.name' : 'NONE' ,
239286 'profile.1.network.2.key_mgmt.1.name' : 'NONE' ,
240287 'profile.1.network.2.priority' : 2 ,
0 commit comments