Skip to content

Commit

Permalink
[change] Upgraded deprecated ChilliSpot-Max-Total-Octets attribute
Browse files Browse the repository at this point in the history
The current attribute name is "CoovaChilli-Max-Total-Octets".
  • Loading branch information
nemesifier committed Mar 27, 2024
1 parent 40f8b62 commit f152e14
Show file tree
Hide file tree
Showing 6 changed files with 12 additions and 12 deletions.
2 changes: 1 addition & 1 deletion docs/source/user/settings.rst
Expand Up @@ -814,7 +814,7 @@ which users having the default ``users`` radius group assigned can consume.
``OPENWISP_RADIUS_TRAFFIC_COUNTER_REPLY_NAME``
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

**Default**: ``ChilliSpot-Max-Total-Octets``
**Default**: ``CoovaChilli-Max-Total-Octets``

Used by :ref:`daily_traffic_counter`,
it indicates the reply attribute which is returned to the NAS
Expand Down
2 changes: 1 addition & 1 deletion openwisp_radius/settings.py
Expand Up @@ -180,7 +180,7 @@ def get_default_password_reset_url(urls):
'TRAFFIC_COUNTER_CHECK_NAME', 'Max-Daily-Session-Traffic'
)
TRAFFIC_COUNTER_REPLY_NAME = get_settings_value(
'TRAFFIC_COUNTER_REPLY_NAME', 'ChilliSpot-Max-Total-Octets'
'TRAFFIC_COUNTER_REPLY_NAME', 'CoovaChilli-Max-Total-Octets'
)
RADCLIENT_ATTRIBUTE_DICTIONARIES = get_settings_value(
'RADCLIENT_ATTRIBUTE_DICTIONARIES', []
Expand Down
12 changes: 6 additions & 6 deletions openwisp_radius/tests/test_api/test_freeradius_api.py
Expand Up @@ -38,7 +38,7 @@
START_DATE = '2019-04-20T22:14:09+01:00'
_AUTH_TYPE_ACCEPT_RESPONSE = {
'control:Auth-Type': 'Accept',
'ChilliSpot-Max-Total-Octets': 3000000000,
'CoovaChilli-Max-Total-Octets': 3000000000,
'Session-Timeout': 10800,
}
_AUTH_TYPE_REJECT_RESPONSE = {'control:Auth-Type': 'Reject'}
Expand Down Expand Up @@ -469,7 +469,7 @@ def test_authorize_counters_reply_interaction(self):
self.assertEqual(response.status_code, 200)
expected = _AUTH_TYPE_ACCEPT_RESPONSE.copy()
expected['Session-Timeout'] = 1200
expected['ChilliSpot-Max-Total-Octets'] = 1200
expected['CoovaChilli-Max-Total-Octets'] = 1200
self.assertEqual(response.data, expected)

with self.subTest('remaining higher than reply'):
Expand Down Expand Up @@ -507,7 +507,7 @@ def test_authorize_counters_reply_interaction(self):
self.assertEqual(response.status_code, 200)
expected = _AUTH_TYPE_ACCEPT_RESPONSE.copy()
expected['Session-Timeout'] = 10800
expected['ChilliSpot-Max-Total-Octets'] = 3000000000
expected['CoovaChilli-Max-Total-Octets'] = 3000000000
self.assertEqual(response.data, expected)
reply.value = original_reply_value
reply.save(update_fields=['value'])
Expand All @@ -519,7 +519,7 @@ def test_authorize_counters_reply_interaction(self):
self.assertEqual(mocked_check.call_count, 2)
expected = _AUTH_TYPE_ACCEPT_RESPONSE.copy()
expected['Session-Timeout'] = {'op': '=', 'value': '3600'}
del expected['ChilliSpot-Max-Total-Octets']
del expected['CoovaChilli-Max-Total-Octets']
self.assertEqual(response.data, expected)

def test_postauth_accept_201(self):
Expand Down Expand Up @@ -1555,7 +1555,7 @@ def test_mac_addr_roaming_authorize_view(self):
{
'control:Auth-Type': 'Accept',
'Session-Timeout': 10539,
'ChilliSpot-Max-Total-Octets': 1487813647,
'CoovaChilli-Max-Total-Octets': 1487813647,
},
)
OrganizationRadiusSettings.objects.update(mac_addr_roaming_enabled=False)
Expand Down Expand Up @@ -1652,7 +1652,7 @@ def test_emulate_roaming(self):
{
'control:Auth-Type': 'Accept',
'Session-Timeout': 10800,
'ChilliSpot-Max-Total-Octets': 3000000000,
'CoovaChilli-Max-Total-Octets': 3000000000,
},
)
# Start accounting session with first AP
Expand Down
2 changes: 1 addition & 1 deletion openwisp_radius/tests/test_batch_add_users.py
Expand Up @@ -136,7 +136,7 @@ def test_verified_batch_user_creation(self):
{
'control:Auth-Type': 'Accept',
'Session-Timeout': 10800,
'ChilliSpot-Max-Total-Octets': 3000000000,
'CoovaChilli-Max-Total-Octets': 3000000000,
},
)
self.assertEqual(user.registered_user.is_verified, True)
Expand Down
Expand Up @@ -104,7 +104,7 @@ def test_traffic_counter_reply_and_check_name(self):
opts = self._get_kwargs('Max-Daily-Session-Traffic')
counter = DailyTrafficCounter(**opts)
self.assertEqual(counter.check_name, 'Max-Daily-Session-Traffic')
self.assertEqual(counter.reply_name, 'ChilliSpot-Max-Total-Octets')
self.assertEqual(counter.reply_name, 'CoovaChilli-Max-Total-Octets')

def test_monthly_traffic_counter_with_sessions(self):
rg = RadiusGroup.objects.filter(name='test-org-users').first()
Expand Down
4 changes: 2 additions & 2 deletions openwisp_radius/tests/test_models.py
Expand Up @@ -1050,7 +1050,7 @@ def test_change_of_authorization(self, mocked_radclient, *args):
{
'User-Name': user.username,
'Session-Timeout': '',
'ChilliSpot-Max-Total-Octets': '',
'CoovaChilli-Max-Total-Octets': '',
}
)
rad_acct.refresh_from_db()
Expand All @@ -1066,7 +1066,7 @@ def test_change_of_authorization(self, mocked_radclient, *args):
{
'User-Name': user.username,
'Session-Timeout': '10800',
'ChilliSpot-Max-Total-Octets': '3000000000',
'CoovaChilli-Max-Total-Octets': '3000000000',
}
)
rad_acct.refresh_from_db()
Expand Down

0 comments on commit f152e14

Please sign in to comment.