Skip to content

Commit 7d80fd7

Browse files
committed
[airos] enable wpa2_enterprise on station with tests
1 parent 2135849 commit 7d80fd7

2 files changed

Lines changed: 8 additions & 7 deletions

File tree

netjsonconfig/backends/airos/wpasupplicant.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -132,5 +132,6 @@ def sta_wpa2_enterprise(interface):
132132
'station': {
133133
'none': sta_no_encryption,
134134
'wpa2_personal': sta_wpa2_personal,
135+
'wpa2_enterprise': sta_wpa2_enterprise,
135136
},
136137
}

tests/airos/test_wpasupplicant.py

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -122,7 +122,6 @@ def test_wpa2_personal(self):
122122
]
123123
self.assertEqualConfig(o.intermediate_data['wpasupplicant'], expected)
124124

125-
@skip("target wpa2_enterprise later")
126125
def test_wpa2_enterprise(self):
127126
o = self.backend({
128127
"interfaces": [
@@ -132,24 +131,23 @@ def test_wpa2_enterprise(self):
132131
"mac": "de:9f:db:30:c9:c5",
133132
"mtu": 1500,
134133
"txqueuelen": 1000,
135-
"autostart": True,
136134
"wireless": {
137135
"radio": "radio0",
138136
"mode": "station",
139137
"ssid": "ap-ssid-example",
138+
"bssid": "00:11:22:33:44:55",
140139
"encryption": {
141140
"protocol": "wpa2_enterprise",
142-
"key": "cucumber",
141+
"eap_type": "tls",
142+
"identity": "definitely-fake-identity",
143+
"password": "password1234",
143144
},
144145
},
145146
}
146147
]
147148
})
148149
o.to_intermediate()
149150
expected = [
150-
{
151-
'status': 'enabled',
152-
},
153151
{
154152
'device.1.profile': 'AUTO',
155153
'device.1.status': 'enabled',
@@ -162,7 +160,6 @@ def test_wpa2_enterprise(self):
162160
'profile.1.network.1.password': 'TODO',
163161
'profile.1.network.1.identity': 'TODO',
164162
'profile.1.network.1.anonymous_identity': 'TODO',
165-
'profile.1.network.1.psk': 'cucumber',
166163
'profile.1.network.1.pairwise.1.name': 'CCMP',
167164
'profile.1.network.1.proto.1.name': 'RSN',
168165
'profile.1.network.1.ssid': 'ap-ssid-example',
@@ -172,6 +169,9 @@ def test_wpa2_enterprise(self):
172169
'profile.1.network.2.priority': 2,
173170
'profile.1.network.2.status': 'disabled',
174171
},
172+
{
173+
'status': 'enabled',
174+
},
175175
]
176176
self.assertEqualConfig(o.intermediate_data['wpasupplicant'], expected)
177177

0 commit comments

Comments
 (0)