Skip to content

Commit 171bd1f

Browse files
committed
[airos] updated expected value for radio converter test
1 parent f3bcb0a commit 171bd1f

1 file changed

Lines changed: 125 additions & 12 deletions

File tree

tests/airos/test_radio.py

Lines changed: 125 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,10 @@
11
from .mock import ConverterTest, RadioAirOs
22

33

4-
class TestRadioConverter(ConverterTest):
4+
class TestRadioStationConverter(ConverterTest):
5+
"""
6+
Test radio device configuration for ``station`` wireless lan
7+
"""
58

69
backend = RadioAirOs
710

@@ -13,60 +16,170 @@ def test_no_radio(self):
1316
expected = [
1417
{
1518
'status': 'enabled',
19+
'countrycode': 380,
1620
},
1721
]
1822

1923
self.assertEqualConfig(o.intermediate_data['radio'], expected)
2024

2125
def test_active_radio(self):
2226
o = self.backend({
27+
"interfaces": [
28+
{
29+
'type': 'wireless',
30+
'name': 'wlan0',
31+
'wireless': {
32+
'radio': 'ath0',
33+
'mode': 'station',
34+
'ssid': 'ubnt',
35+
'bssid': '00:11:22:33:44:55',
36+
'encryption': {
37+
'protocol': 'none',
38+
},
39+
},
40+
},
41+
],
2342
"radios": [
2443
{
2544
'name': 'ath0',
2645
'channel': 1,
2746
'channel_width': 20,
28-
'disabled': False,
2947
'protocol': '802.11n',
3048
}
3149
]
3250
})
3351
o.to_intermediate()
3452
expected = [
3553
{
36-
'1.chanbw': 20,
54+
'1.ack.auto': 'enabled',
55+
'1.ackdistance': 643,
56+
'1.acktimeout': 35,
57+
'1.ampdu.frames': 32,
58+
'1.ampdu.status': 'enabled',
59+
'1.antenna.gain': 3,
60+
'1.antenna.id': 2,
61+
'1.atpc.sta.status': 'enabled',
62+
'1.atpc.status': 'disabled',
63+
'1.atpc.threshold': 36,
64+
'1.cable.loss': 0,
65+
'1.center.1.freq': 0,
66+
'1.chanbw': 0,
67+
'1.cmsbias': 0,
68+
'1.countrycode': 380,
69+
'1.cwm.enable': 0,
70+
'1.cwm.mode': 1,
3771
'1.devname': 'ath0',
72+
'1.dfs.status': 'enabled',
73+
'1.freq': 0,
74+
'1.ieee_mode': 'auto',
75+
'1.low_txpower_mode': 'disabled',
76+
'1.mode': 'managed',
77+
'1.obey': 'enabled',
78+
'1.polling': 'enabled',
79+
'1.polling_11ac_11n_compat': 0,
80+
'1.polling_ff_dl_ratio': 50,
81+
'1.polling_ff_dur': 0,
82+
'1.polling_ff_timing': 0,
83+
'1.pollingnoack': 0,
84+
'1.pollingpri': 2,
85+
'1.ptpmode': 1,
86+
'1.reg_obey': 'enabled',
87+
'1.rx_sensitivity': -96,
88+
'1.scan_list.status': 'disabled',
89+
'1.scanbw.status': 'disabled',
3890
'1.status': 'enabled',
39-
'1.txpower': '',
91+
'1.subsystemid': 0xe7f5,
92+
'1.txpower': 24,
4093
},
4194
{
95+
'countrycode': 380,
4296
'status': 'enabled',
43-
},
97+
}
4498
]
4599

46100
self.assertEqualConfig(o.intermediate_data['radio'], expected)
47101

48-
def test_inactive_radio(self):
102+
103+
class TestRadioAccessPointConverter(ConverterTest):
104+
"""
105+
Test radio device configuration for ``access_point`` wireless lan
106+
"""
107+
108+
backend = RadioAirOs
109+
110+
def test_active_radio(self):
49111
o = self.backend({
112+
"interfaces": [
113+
{
114+
'type': 'wireless',
115+
'name': 'wlan0',
116+
'wireless': {
117+
'radio': 'ath0',
118+
'mode': 'access_point',
119+
'bssid': '00:11:22:33:44:55',
120+
'ssid': 'ubnt',
121+
'encryption': {
122+
'protocol': 'none',
123+
},
124+
},
125+
},
126+
],
50127
"radios": [
51128
{
52129
'name': 'ath0',
53-
'channel': 1,
130+
'channel': 36,
54131
'channel_width': 20,
55-
'disabled': True,
56-
'protocol': '802.11n',
132+
'protocol': '802.11ac',
57133
}
58134
]
59135
})
60136
o.to_intermediate()
61137
expected = [
62138
{
63-
'1.chanbw': 20,
139+
'1.ack.auto': 'enabled',
140+
'1.ackdistance': 643,
141+
'1.acktimeout': 35,
142+
'1.ampdu.frames': 32,
143+
'1.ampdu.status': 'enabled',
144+
'1.antenna.gain': 3,
145+
'1.antenna.id': 2,
146+
'1.atpc.sta.status': 'enabled',
147+
'1.atpc.status': 'disabled',
148+
'1.atpc.threshold': 36,
149+
'1.cable.loss': 0,
150+
'1.center.1.freq': 0,
151+
'1.chanbw': 80,
152+
'1.cmsbias': 0,
153+
'1.countrycode': 380,
154+
'1.cwm.enable': 0,
155+
'1.cwm.mode': 1,
64156
'1.devname': 'ath0',
65-
'1.status': 'disabled',
66-
'1.txpower': '',
157+
'1.dfs.status': 'enabled',
158+
'1.freq': 0,
159+
'1.ieee_mode': '11acvht80',
160+
'1.low_txpower_mode': 'disabled',
161+
'1.mode': 'master',
162+
'1.obey': 'enabled',
163+
'1.polling': 'enabled',
164+
'1.polling_11ac_11n_compat': 0,
165+
'1.polling_ff_dl_ratio': 50,
166+
'1.polling_ff_dur': 0,
167+
'1.polling_ff_timing': 0,
168+
'1.pollingnoack': 0,
169+
'1.pollingpri': 2,
170+
'1.ptpmode': 1,
171+
'1.reg_obey': 'enabled',
172+
'1.rx_sensitivity': -96,
173+
'1.scan_list.status': 'disabled',
174+
'1.scanbw.status': 'disabled',
175+
'1.status': 'enabled',
176+
'1.subsystemid': 0xe7f5,
177+
'1.txpower': 24,
67178
},
68179
{
180+
'countrycode': 380,
69181
'status': 'enabled',
182+
70183
},
71184
]
72185

0 commit comments

Comments
 (0)