Skip to content

Commit

Permalink
pppoe-server: T6685: Possibility of any services name or blank in pppoe
Browse files Browse the repository at this point in the history
  • Loading branch information
natali-rs1985 committed Sep 12, 2024
1 parent d739a10 commit da35b91
Show file tree
Hide file tree
Showing 3 changed files with 34 additions and 0 deletions.
6 changes: 6 additions & 0 deletions data/templates/accel-ppp/pppoe.config.j2
Original file line number Diff line number Diff line change
Expand Up @@ -70,6 +70,12 @@ vlan-mon={{ iface }},{{ iface_config.vlan | join(',') }}
{% if service_name %}
service-name={{ service_name | join(',') }}
{% endif %}
{% if accept_any_service is vyos_defined %}
accept-any-service=1
{% endif %}
{% if accept_blank_service is vyos_defined %}
accept-blank-service=1
{% endif %}
{% if pado_delay %}
{% set delay_without_sessions = pado_delay.delays_without_sessions[0] | default('0') %}
{% set pado_delay_param = namespace(value=delay_without_sessions) %}
Expand Down
12 changes: 12 additions & 0 deletions interface-definitions/service_pppoe-server.xml.in
Original file line number Diff line number Diff line change
Expand Up @@ -77,6 +77,18 @@
<multi/>
</properties>
</leafNode>
<leafNode name="accept-any-service">
<properties>
<help>Accept any service name in PPPoE Active Discovery Request (PADR)</help>
<valueless/>
</properties>
</leafNode>
<leafNode name="accept-blank-service">
<properties>
<help>Accept blank service name in PADR</help>
<valueless/>
</properties>
</leafNode>
<tagNode name="pado-delay">
<properties>
<help>PADO delays</help>
Expand Down
16 changes: 16 additions & 0 deletions smoketest/scripts/cli/test_service_pppoe-server.py
Original file line number Diff line number Diff line change
Expand Up @@ -195,6 +195,22 @@ def test_pppoe_server_any_login(self):
config = read_file(self._config_file)
self.assertIn('any-login=1', config)

def test_pppoe_server_accept_service(self):
services = ['user1-service', 'user2-service']
self.basic_config()

for service in services:
self.set(['service-name', service])
self.set(['accept-any-service'])
self.set(['accept-blank-service'])
self.cli_commit()

# Validate configuration values
config = read_file(self._config_file)
self.assertIn(f'service-name={",".join(services)}', config)
self.assertIn('accept-any-service=1', config)
self.assertIn('accept-blank-service=1', config)


if __name__ == '__main__':
unittest.main(verbosity=2)

0 comments on commit da35b91

Please sign in to comment.