def test_v4_client_classification_one_class_eRouter1_global_next_server(): misc.test_setup() srv_control.config_srv_subnet('192.168.50.0/24', '192.168.50.1-192.168.50.1') srv_control.config_client_classification('0', 'VENDOR_CLASS_eRouter1.0') srv_control.config_srv_another_subnet_no_interface('192.168.50.0/24', '192.168.50.100-192.168.50.100') srv_control.config_srv('boot-file-name', '0', 'somefilename') srv_control.global_add_siaddr('192.0.2.2') srv_control.build_and_send_config_files('SSH', 'config-file') srv_control.start_srv('DHCP', 'started') misc.test_procedure() srv_msg.client_sets_value('Client', 'chaddr', '00:00:00:00:00:00') srv_msg.client_does_include_with_value('client_id', '00010203040506') srv_msg.client_does_include_with_value('vendor_class_id', 'eRouter1.0') srv_msg.client_requests_option('1') srv_msg.client_send_msg('DISCOVER') misc.pass_criteria() srv_msg.send_wait_for_message('MUST', None, 'OFFER') srv_msg.response_check_content('Response', 'NOT ', 'file', 'somefilename') srv_msg.response_check_content('Response', None, 'yiaddr', '192.168.50.1') srv_msg.response_check_content('Response', None, 'siaddr', '0.0.0.0') srv_msg.response_check_content('Response', 'NOT ', 'siaddr', '192.0.2.2') srv_msg.response_check_include_option('Response', None, '1') srv_msg.response_check_include_option('Response', None, '54') srv_msg.response_check_include_option('Response', None, '61') srv_msg.response_check_option_content('Response', '1', None, 'value', '255.255.255.0') srv_msg.response_check_option_content('Response', '54', None, 'value', '$(SRV4_ADDR)') srv_msg.response_check_option_content('Response', '61', None, 'value', '00010203040506')
def test_v4_client_classification_one_class_eRouter1_global_next_server(): misc.test_setup() srv_control.config_srv_subnet('192.168.50.0/24', '192.168.50.1-192.168.50.1') srv_control.config_client_classification(0, 'VENDOR_CLASS_eRouter1.0') srv_control.config_srv_another_subnet_no_interface( '192.168.50.0/24', '192.168.50.100-192.168.50.100') srv_control.config_srv('boot-file-name', 0, 'somefilename') srv_control.global_add_siaddr('192.0.2.2') srv_control.build_and_send_config_files() srv_control.start_srv('DHCP', 'started') misc.test_procedure() srv_msg.client_sets_value('Client', 'chaddr', '00:00:00:00:00:00') srv_msg.client_does_include_with_value('client_id', '00010203040506') srv_msg.client_does_include_with_value('vendor_class_id', 'eRouter1.0') srv_msg.client_requests_option(1) srv_msg.client_send_msg('DISCOVER') misc.pass_criteria() srv_msg.send_wait_for_message('MUST', 'OFFER') srv_msg.response_check_content('file', 'somefilename', expected=False) srv_msg.response_check_content('yiaddr', '192.168.50.1') srv_msg.response_check_content('siaddr', '0.0.0.0') srv_msg.response_check_content('siaddr', '192.0.2.2', expected=False) srv_msg.response_check_include_option(1) srv_msg.response_check_include_option(54) srv_msg.response_check_include_option(61) srv_msg.response_check_option_content(1, 'value', '255.255.255.0') srv_msg.response_check_option_content(54, 'value', '$(SRV4_ADDR)') srv_msg.response_check_option_content(61, 'value', '00010203040506')
def test_v4_client_classification_one_class_docsis3_next_server(): misc.test_setup() srv_control.config_srv_subnet('192.168.50.0/24', '192.168.50.1-192.168.50.1') srv_control.config_client_classification('0', 'VENDOR_CLASS_docsis3.0') srv_control.config_srv_another_subnet_no_interface( '192.168.50.0/24', '192.168.50.100-192.168.50.100') srv_control.config_srv('boot-file-name', '0', 'somefilename') srv_control.subnet_add_siaddr('0', '192.0.2.234') srv_control.build_and_send_config_files('SSH', 'config-file') srv_control.start_srv('DHCP', 'started') misc.test_procedure() srv_msg.client_sets_value('Client', 'chaddr', '00:00:00:00:00:00') srv_msg.client_does_include_with_value('client_id', '00010203040506') srv_msg.client_does_include_with_value('vendor_class_id', 'docsis3.0') srv_msg.client_requests_option('1') srv_msg.client_send_msg('DISCOVER') misc.pass_criteria() srv_msg.send_wait_for_message('MUST', None, 'OFFER') srv_msg.response_check_content('Response', None, 'file', 'somefilename') srv_msg.response_check_content('Response', None, 'yiaddr', '192.168.50.1') srv_msg.response_check_content('Response', None, 'siaddr', '192.0.2.234') srv_msg.response_check_include_option('Response', None, '1') srv_msg.response_check_include_option('Response', None, '54') srv_msg.response_check_include_option('Response', None, '61') srv_msg.response_check_option_content('Response', '1', None, 'value', '255.255.255.0') srv_msg.response_check_option_content('Response', '54', None, 'value', '$(SRV4_ADDR)') srv_msg.response_check_option_content('Response', '61', None, 'value', '00010203040506')
def test_v6_host_reservation_mysql_duid_ll_matching_option_inforequest(): misc.test_setup() srv_control.config_srv_subnet('3000::/64', '3000::1-3000::ff') srv_control.enable_db_backend_reservation('MySQL') srv_control.new_db_backend_reservation('MySQL', 'duid', '00:03:00:01:f6:f5:f4:f3:f2:01') srv_control.update_db_backend_reservation('dhcp6_subnet_id', '1', 'MySQL', '1') srv_control.option_db_record_reservation('7', '10', 'dhcp6', '1', '$(EMPTY)', '1', 'subnet', 'MySQL', '1') srv_control.upload_db_reservation('MySQL') srv_control.config_srv('preference', '0', '123') srv_control.build_and_send_config_files('SSH', 'config-file') srv_control.start_srv('DHCP', 'started') misc.test_procedure() srv_msg.client_sets_value('Client', 'DUID', '00:03:00:01:f6:f5:f4:f3:f2:01') srv_msg.client_requests_option('7') srv_msg.client_send_msg('INFOREQUEST') misc.pass_criteria() srv_msg.send_wait_for_message('MUST', None, 'REPLY') srv_msg.response_check_include_option('Response', 'NOT ', '3') srv_msg.response_check_include_option('Response', None, '7') srv_msg.response_check_option_content('Response', '7', None, 'value', '123') misc.test_procedure() srv_msg.client_sets_value('Client', 'DUID', '00:03:00:01:f6:f5:f4:f3:f2:01') srv_msg.client_requests_option('7') srv_msg.client_does_include('Client', None, 'client-id') srv_msg.client_send_msg('SOLICIT') misc.pass_criteria() srv_msg.send_wait_for_message('MUST', None, 'ADVERTISE') srv_msg.response_check_include_option('Response', 'NOT ', '3') srv_msg.response_check_include_option('Response', None, '7') srv_msg.response_check_option_content('Response', '7', None, 'value', '10') misc.test_procedure() srv_msg.client_sets_value('Client', 'DUID', '00:03:00:01:f6:f5:f4:f3:f2:21') srv_msg.client_requests_option('7') srv_msg.client_does_include('Client', None, 'client-id') srv_msg.client_does_include('Client', None, 'IA-NA') srv_msg.client_send_msg('SOLICIT') misc.pass_criteria() srv_msg.send_wait_for_message('MUST', None, 'ADVERTISE') srv_msg.response_check_include_option('Response', None, '3') srv_msg.response_check_option_content('Response', '3', None, 'sub-option', '5') srv_msg.response_check_include_option('Response', None, '7') srv_msg.response_check_option_content('Response', '7', None, 'value', '123')
def test_hook_v4_subnet_cmds_get_by_subnet(): misc.test_setup() srv_control.config_srv_subnet('192.168.50.0/24', '192.168.50.5-192.168.50.5') srv_control.config_srv_another_subnet_no_interface('10.0.0.0/24', '10.0.0.5-10.0.0.5') srv_control.config_srv('domain-name-servers', '1', '199.199.199.1,100.100.100.1') srv_control.open_control_channel() srv_control.add_hooks('libdhcp_subnet_cmds.so') srv_control.build_and_send_config_files('SSH', 'config-file') srv_control.start_srv('DHCP', 'started') srv_msg.send_ctrl_cmd_via_socket('{"command":"subnet4-get","arguments":{"subnet":"10.0.0.0/24"}}')
def test_v6_options_subnet_dns_servers(): # Testing server ability to configure it with option # DNS servers (code 23) with addresses 2001:db8::1 per subnet(to override global) # and ability to share that value with client via Advertise and Reply message. # Client Server # request option SOLICIT --> # dns-servers <-- ADVERTISE # request option REQUEST --> # dns-servers <-- REPLY # Pass Criteria: # REPLY/ADVERTISE MUST include option: # dns-servers option with addresses # 2001:db8::1 and 2001:db8::2 misc.test_setup() srv_control.config_srv_subnet('3000::/64', '3000::1-3000::ff') srv_control.config_srv('dns-servers', '0', '2001:db8::1,2001:db8::2') srv_control.build_and_send_config_files('SSH', 'config-file') srv_control.start_srv('DHCP', 'started') misc.test_procedure() srv_msg.client_requests_option('23') srv_msg.client_does_include('Client', None, 'client-id') srv_msg.client_does_include('Client', None, 'IA-NA') srv_msg.client_send_msg('SOLICIT') misc.pass_criteria() srv_msg.send_wait_for_message('MUST', None, 'ADVERTISE') srv_msg.response_check_include_option('Response', None, '23') srv_msg.response_check_option_content('Response', '23', None, 'addresses', '2001:db8::1,2001:db8::2') misc.test_procedure() srv_msg.client_copy_option('server-id') srv_msg.client_copy_option('IA_NA') srv_msg.client_requests_option('23') srv_msg.client_does_include('Client', None, 'client-id') srv_msg.client_send_msg('REQUEST') misc.pass_criteria() srv_msg.send_wait_for_message('MUST', None, 'REPLY') srv_msg.response_check_include_option('Response', None, '23') srv_msg.response_check_option_content('Response', '23', None, 'addresses', '2001:db8::1,2001:db8::2') references.references_check('v6.options,')
def test_hook_v4_subnet_cmds_get_by_subnet(): misc.test_setup() srv_control.config_srv_subnet('192.168.50.0/24', '192.168.50.5-192.168.50.5') srv_control.config_srv_another_subnet_no_interface('10.0.0.0/24', '10.0.0.5-10.0.0.5') srv_control.config_srv('domain-name-servers', '1', '199.199.199.1,100.100.100.1') srv_control.open_control_channel('unix', '$(SOFTWARE_INSTALL_DIR)/var/kea/control_socket') srv_control.add_hooks('$(SOFTWARE_INSTALL_DIR)/lib/kea/hooks/libdhcp_subnet_cmds.so') srv_control.build_and_send_config_files('SSH', 'config-file') srv_control.start_srv('DHCP', 'started') srv_msg.send_through_socket_server_site('$(SOFTWARE_INSTALL_DIR)/var/kea/control_socket', '{"command":"subnet4-get","arguments":{"subnet":"10.0.0.0/24"}}')
def test_hook_v4_subnet_cmds_get_by_id(): misc.test_setup() srv_control.config_srv_subnet('192.168.50.0/24', '192.168.50.5-192.168.50.5') srv_control.config_srv_another_subnet_no_interface('10.0.0.0/24', '10.0.0.5-10.0.0.5') srv_control.config_srv_another_subnet_no_interface('150.0.0.0/24', '150.0.0.5-150.0.0.5') srv_control.config_srv('streettalk-directory-assistance-server', '2', '199.1.1.1,200.1.1.2') srv_control.open_control_channel() srv_control.add_hooks('libdhcp_subnet_cmds.so') srv_control.build_and_send_config_files('SSH', 'config-file') srv_control.start_srv('DHCP', 'started') srv_msg.send_ctrl_cmd_via_socket('{"command":"subnet4-get","arguments":{"id":3}}')
def test_v6_options_subnet_override(): # Testing server ability to configure it with option # domains (code 24) with domains subnet.example.com per subnet # (to override global which is also configured with domain global.example.com) # and ability to share that value with client via Advertise and Reply message. # Client Server # request option SOLICIT --> # domain-search <-- ADVERTISE # request option REQUEST --> # domain-search <-- REPLY # Pass Criteria: # REPLY/ADVERTISE MUST include option: # domain-search option with addresses # subnet.example.com # REPLY/ADVERTISE MUST NOT include option: # domain-search option with addresses # global.example.com misc.test_setup() srv_control.config_srv_subnet('3000::/64', '3000::1-3000::ff') srv_control.config_srv_opt('domain-search', 'global.example.com') srv_control.config_srv('domain-search', '0', 'subnet.example.com') srv_control.build_and_send_config_files('SSH', 'config-file') srv_control.start_srv('DHCP', 'started') misc.test_procedure() srv_msg.client_requests_option('24') srv_msg.client_does_include('Client', None, 'client-id') srv_msg.client_does_include('Client', None, 'IA-NA') srv_msg.client_send_msg('SOLICIT') misc.pass_criteria() srv_msg.send_wait_for_message('MUST', None, 'ADVERTISE') srv_msg.response_check_include_option('Response', None, '24') srv_msg.response_check_option_content('Response', '24', None, 'domains', 'subnet.example.com.') misc.test_procedure() srv_msg.client_copy_option('server-id') srv_msg.client_copy_option('IA_NA') srv_msg.client_requests_option('24') srv_msg.client_does_include('Client', None, 'client-id') srv_msg.client_send_msg('REQUEST') misc.pass_criteria() srv_msg.send_wait_for_message('MUST', None, 'REPLY') srv_msg.response_check_include_option('Response', None, '24') srv_msg.response_check_option_content('Response', '24', None, 'domains', 'subnet.example.com.') references.references_check('v6.options,')
def test_hook_v4_subnet_cmds_get_by_id(): misc.test_setup() srv_control.config_srv_subnet('192.168.50.0/24', '192.168.50.5-192.168.50.5') srv_control.config_srv_another_subnet_no_interface('10.0.0.0/24', '10.0.0.5-10.0.0.5') srv_control.config_srv_another_subnet_no_interface('150.0.0.0/24', '150.0.0.5-150.0.0.5') srv_control.config_srv('streettalk-directory-assistance-server', '2', '199.1.1.1,200.1.1.2') srv_control.open_control_channel('unix', '$(SOFTWARE_INSTALL_DIR)/var/kea/control_socket') srv_control.add_hooks('$(SOFTWARE_INSTALL_DIR)/lib/kea/hooks/libdhcp_subnet_cmds.so') srv_control.build_and_send_config_files('SSH', 'config-file') srv_control.start_srv('DHCP', 'started') srv_msg.send_through_socket_server_site('$(SOFTWARE_INSTALL_DIR)/var/kea/control_socket', '{"command":"subnet4-get","arguments":{"id":3}}')
def test_v6_host_reservation_mysql_duid_ll_matching_option_no_address_1(): misc.test_setup() srv_control.config_srv_subnet('3000::/64', '3000::1-3000::ff') srv_control.enable_db_backend_reservation('MySQL') srv_control.new_db_backend_reservation('MySQL', 'duid', '00:03:00:01:f6:f5:f4:f3:f2:01') srv_control.update_db_backend_reservation('dhcp6_subnet_id', 1, 'MySQL', 1) srv_control.option_db_record_reservation(7, 10, 'dhcp6', 1, '$(EMPTY)', 1, 'subnet', 'MySQL', 1) srv_control.upload_db_reservation('MySQL') srv_control.config_srv('preference', 0, '123') srv_control.build_and_send_config_files() srv_control.start_srv('DHCP', 'started') misc.test_procedure() srv_msg.client_sets_value('Client', 'DUID', '00:03:00:01:f6:f5:f4:f3:f2:01') srv_msg.client_requests_option(7) srv_msg.client_does_include('Client', 'client-id') srv_msg.client_does_include('Client', 'IA-NA') srv_msg.client_send_msg('SOLICIT') misc.pass_criteria() srv_msg.send_wait_for_message('MUST', 'ADVERTISE') srv_msg.response_check_include_option(3) srv_msg.response_check_option_content(3, 'sub-option', 5) srv_msg.response_check_suboption_content(5, 3, 'addr', '3000::100', expect_include=False) srv_msg.response_check_include_option(7) srv_msg.response_check_option_content(7, 'value', 10) misc.test_procedure() srv_msg.client_sets_value('Client', 'DUID', '00:03:00:01:f6:f5:f4:f3:f2:21') srv_msg.client_requests_option(7) srv_msg.client_does_include('Client', 'client-id') srv_msg.client_does_include('Client', 'IA-NA') srv_msg.client_send_msg('SOLICIT') misc.pass_criteria() srv_msg.send_wait_for_message('MUST', 'ADVERTISE') srv_msg.response_check_include_option(3) srv_msg.response_check_option_content(3, 'sub-option', 5) srv_msg.response_check_include_option(7) srv_msg.response_check_option_content(7, 'value', 123)
def test_hook_v6_network_cmds_del_non_existing(): misc.test_setup() srv_control.config_srv_subnet('2001:db8:a::/64', '2001:db8:a::1-2001:db8:a::1') srv_control.config_srv_another_subnet_no_interface( '2001:db8:b::/64', '2001:db8:b::1-2001:db8:b::1') srv_control.config_srv_another_subnet_no_interface( '2001:db8:c::/64', '2001:db8:c::1-2001:db8:c::1') srv_control.config_srv_another_subnet_no_interface( '2001:db8:d::/64', '2001:db8:d::1-2001:db8:d::1') srv_control.config_srv_another_subnet_no_interface( '2001:db8:e::/64', '2001:db8:e::1-2001:db8:e::1') srv_control.config_srv_another_subnet_no_interface( '2001:db8:f::/64', '2001:db8:f::1-2001:db8:f::1') srv_control.config_srv('dns-servers', '1', '2001:db8::1,2001:db8::2') # first shared subnet srv_control.shared_subnet('0', '0') srv_control.shared_subnet('1', '0') srv_control.set_conf_parameter_shared_subnet('name', '"name-abc"', '0') srv_control.set_conf_parameter_shared_subnet('interface-id', '"interface-abc"', '0') # second shared-subnet srv_control.shared_subnet('2', '1') srv_control.shared_subnet('3', '1') srv_control.set_conf_parameter_shared_subnet('name', '"name-xyz"', '1') srv_control.set_conf_parameter_shared_subnet('interface', '"$(SERVER_IFACE)"', '1') srv_control.shared_subnet('4', '2') srv_control.shared_subnet('5', '2') srv_control.set_conf_parameter_shared_subnet('name', '"name-something"', '2') srv_control.set_conf_parameter_shared_subnet( 'relay', '{"ip-address":"2001:db8::1234"}', '2') srv_control.add_hooks('libdhcp_subnet_cmds.so') srv_control.open_control_channel() srv_control.build_and_send_config_files('SSH', 'config-file') srv_control.start_srv('DHCP', 'started') srv_msg.send_ctrl_cmd_via_socket( '{"command":"network6-list","arguments":{}}') response = srv_msg.send_ctrl_cmd_via_socket( '{"command": "network6-del","arguments":{"name":"name-xyzc"}}', exp_result=3) assert response['text'] == "no shared network with name 'name-xyzc' found" srv_msg.send_ctrl_cmd_via_socket( '{"command":"network6-list","arguments":{}}')
def test_hook_v6_network_cmds_del(): misc.test_setup() srv_control.config_srv_subnet('2001:db8:a::/64', '2001:db8:a::1-2001:db8:a::1') srv_control.config_srv_another_subnet_no_interface( '2001:db8:b::/64', '2001:db8:b::1-2001:db8:b::1') srv_control.config_srv_another_subnet_no_interface( '2001:db8:c::/64', '2001:db8:c::1-2001:db8:c::1') srv_control.config_srv_another_subnet_no_interface( '2001:db8:d::/64', '2001:db8:d::1-2001:db8:d::1') srv_control.config_srv_another_subnet_no_interface( '2001:db8:e::/64', '2001:db8:e::1-2001:db8:e::1') srv_control.config_srv_another_subnet_no_interface( '2001:db8:f::/64', '2001:db8:f::1-2001:db8:f::1') srv_control.config_srv('dns-servers', '1', '2001:db8::1,2001:db8::2') # first shared subnet srv_control.shared_subnet('0', '0') srv_control.shared_subnet('1', '0') srv_control.set_conf_parameter_shared_subnet('name', '"name-abc"', '0') srv_control.set_conf_parameter_shared_subnet('interface-id', '"interface-abc"', '0') # second shared-subnet srv_control.shared_subnet('2', '1') srv_control.shared_subnet('3', '1') srv_control.set_conf_parameter_shared_subnet('name', '"name-xyz"', '1') srv_control.set_conf_parameter_shared_subnet('interface', '"$(SERVER_IFACE)"', '1') srv_control.shared_subnet('4', '2') srv_control.shared_subnet('5', '2') srv_control.set_conf_parameter_shared_subnet('name', '"name-something"', '2') srv_control.set_conf_parameter_shared_subnet( 'relay', '{"ip-address":"2001:db8::1234"}', '2') srv_control.add_hooks('libdhcp_subnet_cmds.so') srv_control.open_control_channel() srv_control.build_and_send_config_files('SSH', 'config-file') srv_control.start_srv('DHCP', 'started') srv_msg.send_ctrl_cmd_via_socket( '{"command":"network6-list","arguments":{}}') srv_msg.send_ctrl_cmd_via_socket( '{"command": "network6-del","arguments":{"name":"name-xyz","subnets-action": "delete"}}' ) # Using UNIX socket on server in path control_socket send {"command": "network6-add","arguments":{"subnet6":[{"id": 234,"interface":"$(SERVER_IFACE)","subnet": "2001:db8:1::/64","pools":[{"pool":"2001:db8:1::1-2001:db8:1::2"}]}]}} srv_msg.send_ctrl_cmd_via_socket( '{"command":"network6-list","arguments":{}}')
def test_v6_options_subnet_dns_servers(): # Testing server ability to configure it with option # DNS servers (code 23) with addresses 2001:db8::1 per subnet(to override global) # and ability to share that value with client via Advertise and Reply message. # Client Server # request option SOLICIT --> # dns-servers <-- ADVERTISE # request option REQUEST --> # dns-servers <-- REPLY # Pass Criteria: # REPLY/ADVERTISE MUST include option: # dns-servers option with addresses # 2001:db8::1 and 2001:db8::2 misc.test_setup() srv_control.config_srv_subnet('3000::/64', '3000::1-3000::ff') srv_control.config_srv('dns-servers', 0, '2001:db8::1,2001:db8::2') srv_control.build_and_send_config_files() srv_control.start_srv('DHCP', 'started') misc.test_procedure() srv_msg.client_requests_option(23) srv_msg.client_does_include('Client', 'client-id') srv_msg.client_does_include('Client', 'IA-NA') srv_msg.client_send_msg('SOLICIT') misc.pass_criteria() srv_msg.send_wait_for_message('MUST', 'ADVERTISE') srv_msg.response_check_include_option(23) srv_msg.response_check_option_content(23, 'addresses', '2001:db8::1,2001:db8::2') misc.test_procedure() srv_msg.client_copy_option('server-id') srv_msg.client_copy_option('IA_NA') srv_msg.client_requests_option(23) srv_msg.client_does_include('Client', 'client-id') srv_msg.client_send_msg('REQUEST') misc.pass_criteria() srv_msg.send_wait_for_message('MUST', 'REPLY') srv_msg.response_check_include_option(23) srv_msg.response_check_option_content(23, 'addresses', '2001:db8::1,2001:db8::2') references.references_check('v6.options,')
def test_hook_v4_network_cmds_del_keep_subnet(): misc.test_setup() srv_control.config_srv_subnet('192.168.50.0/24', '192.168.50.1-192.168.50.1') srv_control.config_srv_another_subnet_no_interface( '192.168.51.0/24', '192.168.51.1-192.168.51.1') srv_control.shared_subnet('0', '0') srv_control.shared_subnet('1', '0') srv_control.set_conf_parameter_shared_subnet('name', '"name-abc"', '0') srv_control.set_conf_parameter_shared_subnet('interface', '"$(SERVER_IFACE)"', '0') srv_control.config_srv('time-servers', '0', '199.199.199.10') srv_control.add_hooks('libdhcp_subnet_cmds.so') srv_control.open_control_channel() srv_control.build_and_send_config_files('SSH', 'config-file') srv_control.start_srv('DHCP', 'started') misc.test_procedure() srv_msg.client_requests_option('1') srv_msg.client_requests_option('6') srv_msg.client_sets_value('Client', 'chaddr', 'ff:01:02:03:ff:04') srv_msg.client_send_msg('DISCOVER') misc.pass_criteria() srv_msg.send_wait_for_message('MUST', None, 'OFFER') srv_msg.send_ctrl_cmd_via_socket( '{"command":"network4-list","arguments":{}}') srv_msg.send_ctrl_cmd_via_socket( '{"command":"network4-del","arguments":{"name":"name-abc","subnets-action": "keep"}}' ) misc.test_procedure() srv_msg.client_requests_option('1') srv_msg.client_requests_option('6') srv_msg.client_sets_value('Client', 'chaddr', 'ff:01:02:03:ff:04') srv_msg.client_send_msg('DISCOVER') misc.pass_criteria() srv_msg.send_wait_for_message('MUST', None, 'OFFER') srv_msg.send_ctrl_cmd_via_socket( '{"command":"network4-list","arguments":{}}', exp_result=3)
def test_v6_options_subnet_preference(): # Testing server ability to configure it with option # preference (code 7) with value 123 per subnet(to override global) # and ability to share that value with client via Advertise and Reply message. # Client Server # request option SOLICIT --> # preference value 123 <-- ADVERTISE # request option REQUEST --> # preference value 123 <-- REPLY # Pass Criteria: # REPLY/ADVERTISE MUST include option: # Preference option with value 123 misc.test_setup() srv_control.config_srv_subnet('3000::/64', '3000::1-3000::ff') srv_control.config_srv('preference', '0', '123') srv_control.build_and_send_config_files('SSH', 'config-file') srv_control.start_srv('DHCP', 'started') misc.test_procedure() srv_msg.client_requests_option('7') srv_msg.client_does_include('Client', None, 'client-id') srv_msg.client_does_include('Client', None, 'IA-NA') srv_msg.client_send_msg('SOLICIT') misc.pass_criteria() srv_msg.send_wait_for_message('MUST', None, 'ADVERTISE') srv_msg.response_check_include_option('Response', None, '7') srv_msg.response_check_option_content('Response', '7', None, 'value', '123') misc.test_procedure() srv_msg.client_copy_option('server-id') srv_msg.client_copy_option('IA_NA') srv_msg.client_requests_option('7') srv_msg.client_does_include('Client', None, 'client-id') srv_msg.client_send_msg('REQUEST') misc.pass_criteria() srv_msg.send_wait_for_message('MUST', None, 'REPLY') srv_msg.response_check_include_option('Response', None, '7') srv_msg.response_check_option_content('Response', '7', None, 'value', '123') references.references_check('v6.options,')
def test_v6_client_classification_shared_subnet_options_override_subnet(): misc.test_setup() srv_control.config_srv_subnet('2001:db8:a::/64', '2001:db8:a::1-2001:db8:a::10') srv_control.config_srv('dns-servers', '0', '2001:db8::1,2001:db8::2') srv_control.create_new_class('Client_Class_1') srv_control.add_test_to_class('1', 'test', 'substring(option[1].hex,8,2) == 0xf2f1') srv_control.add_option_to_defined_class('1', 'dns-servers', '2001:db8::888') srv_control.config_client_classification('0', 'Client_Class_1') srv_control.shared_subnet('0', '0') srv_control.set_conf_parameter_shared_subnet('name', '"name-abc"', '0') srv_control.set_conf_parameter_shared_subnet('interface', '"$(SERVER_IFACE)"', '0') srv_control.build_and_send_config_files('SSH', 'config-file') srv_control.start_srv('DHCP', 'started') misc.test_procedure() srv_msg.client_sets_value('Client', 'DUID', '00:03:00:01:66:55:44:33:f2:f1') srv_msg.client_does_include('Client', None, 'client-id') srv_msg.client_does_include('Client', None, 'IA-NA') srv_msg.client_requests_option('23') srv_msg.client_send_msg('SOLICIT') misc.pass_criteria() srv_msg.send_wait_for_message('MUST', None, 'ADVERTISE') srv_msg.response_check_include_option('Response', None, '1') srv_msg.response_check_include_option('Response', None, '2') srv_msg.response_check_include_option('Response', None, '23') srv_msg.response_check_option_content('Response', '23', None, 'addresses', '2001:db8::888') srv_msg.response_check_option_content('Response', '23', 'NOT ', 'addresses', '2001:db8::1') srv_msg.response_check_include_option('Response', None, '3') srv_msg.response_check_option_content('Response', '3', None, 'sub-option', '5') srv_msg.response_check_suboption_content('Response', '5', '3', None, 'addr', '2001:db8:a::1')
def test_hook_v6_network_cmds_del(): misc.test_setup() srv_control.config_srv_subnet('2001:db8:a::/64', '2001:db8:a::1-2001:db8:a::1') srv_control.config_srv_another_subnet_no_interface('2001:db8:b::/64', '2001:db8:b::1-2001:db8:b::1') srv_control.config_srv_another_subnet_no_interface('2001:db8:c::/64', '2001:db8:c::1-2001:db8:c::1') srv_control.config_srv_another_subnet_no_interface('2001:db8:d::/64', '2001:db8:d::1-2001:db8:d::1') srv_control.config_srv_another_subnet_no_interface('2001:db8:e::/64', '2001:db8:e::1-2001:db8:e::1') srv_control.config_srv_another_subnet_no_interface('2001:db8:f::/64', '2001:db8:f::1-2001:db8:f::1') srv_control.config_srv('dns-servers', '1', '2001:db8::1,2001:db8::2') # first shared subnet srv_control.shared_subnet('0', '0') srv_control.shared_subnet('1', '0') srv_control.set_conf_parameter_shared_subnet('name', '"name-abc"', '0') srv_control.set_conf_parameter_shared_subnet('interface-id', '"interface-abc"', '0') # second shared-subnet srv_control.shared_subnet('2', '1') srv_control.shared_subnet('3', '1') srv_control.set_conf_parameter_shared_subnet('name', '"name-xyz"', '1') srv_control.set_conf_parameter_shared_subnet('interface', '"$(SERVER_IFACE)"', '1') srv_control.shared_subnet('4', '2') srv_control.shared_subnet('5', '2') srv_control.set_conf_parameter_shared_subnet('name', '"name-something"', '2') srv_control.set_conf_parameter_shared_subnet('relay', '{"ip-address":"2001:db8::1234"}', '2') srv_control.add_hooks('$(SOFTWARE_INSTALL_DIR)/lib/kea/hooks/libdhcp_subnet_cmds.so') srv_control.open_control_channel('unix', '$(SOFTWARE_INSTALL_DIR)/var/kea/control_socket') srv_control.build_and_send_config_files('SSH', 'config-file') srv_control.start_srv('DHCP', 'started') srv_msg.send_through_socket_server_site('$(SOFTWARE_INSTALL_DIR)/var/kea/control_socket', '{"command":"network6-list","arguments":{}}') srv_msg.send_through_socket_server_site('$(SOFTWARE_INSTALL_DIR)/var/kea/control_socket', '{"command": "network6-del","arguments":{"name":"name-xyz","subnets-action": "delete"}}') # Using UNIX socket on server in path $(SOFTWARE_INSTALL_DIR)/var/kea/control_socket send {"command": "network6-add","arguments":{"subnet6":[{"id": 234,"interface":"$(SERVER_IFACE)","subnet": "2001:db8:1::/64","pools":[{"pool":"2001:db8:1::1-2001:db8:1::2"}]}]}} srv_msg.send_through_socket_server_site('$(SOFTWARE_INSTALL_DIR)/var/kea/control_socket', '{"command":"network6-list","arguments":{}}')
def test_hook_v4_network_cmds_get_by_name(): misc.test_setup() srv_control.config_srv_subnet('192.168.50.0/24', '192.168.50.1-192.168.50.1') srv_control.config_srv_another_subnet_no_interface( '192.168.51.0/24', '192.168.51.1-192.168.51.1') srv_control.config_srv_another_subnet_no_interface( '192.168.52.0/24', '192.168.52.1-192.168.52.1') srv_control.config_srv_another_subnet_no_interface( '192.168.53.0/24', '192.168.53.1-192.168.53.1') # first shared subnet srv_control.shared_subnet('0', '0') srv_control.shared_subnet('1', '0') srv_control.set_conf_parameter_shared_subnet('name', '"name-abc"', '0') srv_control.set_conf_parameter_shared_subnet('interface', '"$(SERVER_IFACE)"', '0') # second shared-subnet srv_control.shared_subnet('2', '1') srv_control.shared_subnet('3', '1') srv_control.set_conf_parameter_shared_subnet('name', '"name-xyz"', '1') srv_control.set_conf_parameter_shared_subnet( 'relay', '{"ip-address":"$(GIADDR4)"}', '1') srv_control.config_srv('time-servers', '0', '199.199.199.10') srv_control.config_srv('time-servers', '2', '199.199.199.100') srv_control.config_srv('time-servers', '3', '199.199.199.200') srv_control.add_hooks('libdhcp_subnet_cmds.so') srv_control.open_control_channel() srv_control.build_and_send_config_files('SSH', 'config-file') srv_control.start_srv('DHCP', 'started') srv_msg.send_ctrl_cmd_via_socket( '{"command":"network4-get","arguments":{"name":"name-xyz"}}')
def test_hook_v6_network_cmds_get_by_name(): misc.test_setup() srv_control.config_srv_subnet('2001:db8:a::/64', '2001:db8:a::1-2001:db8:a::1') srv_control.config_srv_another_subnet_no_interface( '2001:db8:b::/64', '2001:db8:b::1-2001:db8:b::1') srv_control.config_srv_another_subnet_no_interface( '2001:db8:c::/64', '2001:db8:c::1-2001:db8:c::1') srv_control.config_srv_another_subnet_no_interface( '2001:db8:d::/64', '2001:db8:d::1-2001:db8:d::1') srv_control.config_srv_another_subnet_no_interface( '2001:db8:e::/64', '2001:db8:e::1-2001:db8:e::1') srv_control.config_srv_another_subnet_no_interface( '2001:db8:f::/64', '2001:db8:f::1-2001:db8:f::1') srv_control.config_srv('dns-servers', 1, '2001:db8::1,2001:db8::2') # first shared subnet srv_control.shared_subnet('2001:db8:a::/64', 0) srv_control.shared_subnet('2001:db8:b::/64', 0) srv_control.set_conf_parameter_shared_subnet('name', '"name-abc"', 0) srv_control.set_conf_parameter_shared_subnet('interface-id', '"interface-abc"', 0) # second shared-subnet srv_control.shared_subnet('2001:db8:c::/64', 1) srv_control.shared_subnet('2001:db8:d::/64', 1) srv_control.set_conf_parameter_shared_subnet('name', '"name-xyz"', 1) srv_control.set_conf_parameter_shared_subnet('interface', '"$(SERVER_IFACE)"', 1) srv_control.shared_subnet('2001:db8:e::/64', 2) srv_control.shared_subnet('2001:db8:f::/64', 2) srv_control.set_conf_parameter_shared_subnet('name', '"name-something"', 2) srv_control.set_conf_parameter_shared_subnet( 'relay', '{"ip-address":"2001:db8::1234"}', 2) srv_control.add_hooks('libdhcp_subnet_cmds.so') srv_control.open_control_channel() srv_control.build_and_send_config_files() srv_control.start_srv('DHCP', 'started') srv_msg.send_ctrl_cmd_via_socket( '{"command":"network6-get","arguments":{"name":"name-xyz"}}')
def test_v6_relay_message_interfaceid(): misc.test_setup() srv_control.config_srv_subnet('3000::/64', '3000::1-3000::ff') srv_control.config_srv('interface-id', '0', '15') srv_control.build_and_send_config_files('SSH', 'config-file') srv_control.start_srv('DHCP', 'started') misc.test_procedure() srv_msg.client_does_include('Client', None, 'client-id') srv_msg.client_does_include('Client', None, 'IA-NA') srv_msg.client_send_msg('SOLICIT') srv_msg.client_does_include('RelayAgent', None, 'interface-id') srv_msg.create_relay_forward() misc.pass_criteria() srv_msg.send_wait_for_message('MUST', None, 'RELAYREPLY') srv_msg.response_check_include_option('Response', None, '18') srv_msg.response_check_include_option('Response', None, '9') # Response MUST include ADVERTISE message. references.references_check('RFC3315')
def test_hook_v4_network_cmds_add_conflict(): misc.test_setup() srv_control.config_srv_subnet('192.168.50.0/24', '192.168.50.1-192.168.50.1') srv_control.config_srv_another_subnet_no_interface( '192.168.51.0/24', '192.168.51.1-192.168.51.1') srv_control.config_srv_another_subnet_no_interface( '192.168.52.0/24', '192.168.52.1-192.168.52.1') srv_control.config_srv_another_subnet_no_interface( '192.168.53.0/24', '192.168.53.1-192.168.53.1') # first shared subnet srv_control.shared_subnet('0', '0') srv_control.shared_subnet('1', '0') srv_control.set_conf_parameter_shared_subnet('name', '"name-abc"', '0') srv_control.set_conf_parameter_shared_subnet('interface', '"$(SERVER_IFACE)"', '0') # second shared-subnet srv_control.shared_subnet('2', '1') srv_control.shared_subnet('3', '1') srv_control.set_conf_parameter_shared_subnet('name', '"name-xyz"', '1') srv_control.set_conf_parameter_shared_subnet( 'relay', '{"ip-address":"$(GIADDR4)"}', '1') srv_control.config_srv('time-servers', '0', '199.199.199.10') srv_control.config_srv('time-servers', '2', '199.199.199.100') srv_control.config_srv('time-servers', '3', '199.199.199.200') srv_control.add_hooks('libdhcp_subnet_cmds.so') srv_control.open_control_channel() srv_control.build_and_send_config_files('SSH', 'config-file') srv_control.start_srv('DHCP', 'started') srv_msg.send_ctrl_cmd_via_socket( '{"command":"network4-list","arguments":{}}') srv_msg.send_ctrl_cmd_via_socket( '{"command":"network4-add","arguments":{"shared-networks": [{"match-client-id": true,"name": "name-xyz","option-data": [],"rebind-timer": 0,"relay": {"ip-address": "0.0.0.0"},"renew-timer": 0,"reservation-mode": "all","subnet4": [{"4o6-interface": "","4o6-interface-id": "","4o6-subnet": "","boot-file-name": "","id": 3,"match-client-id": true,"next-server": "0.0.0.0","option-data": [{"always-send": false,"code": 4,"csv-format": false,"data": "C7C7C764","name": "time-servers","space": "dhcp4"}],"pools": [{"option-data": [],"pool": "192.168.52.1/32"}],"rebind-timer": 2000,"relay": {"ip-address": "192.168.50.249"},"renew-timer": 1000,"reservation-mode": "all","server-hostname": "","subnet": "192.168.52.0/24","valid-lifetime": 4000},{"4o6-interface": "","4o6-interface-id": "","4o6-subnet": "","boot-file-name": "","id": 4,"match-client-id": true,"next-server": "0.0.0.0","option-data": [{"always-send": false,"code": 4,"csv-format": false,"data": "C7C7C7C8","name": "time-servers","space": "dhcp4"}],"pools": [{"option-data": [],"pool": "192.168.53.1/32"}],"rebind-timer": 2000,"relay": {"ip-address": "192.168.50.249"},"renew-timer": 1000,"reservation-mode": "all","server-hostname": "","subnet": "192.168.53.0/24","valid-lifetime": 4000}],"valid-lifetime": 0}]}}', exp_result=1) srv_msg.send_ctrl_cmd_via_socket( '{"command":"network4-get","arguments":{"name": "name-xyz"}}')
def test_hook_v4_network_cmds_del_non_existing(): misc.test_setup() srv_control.config_srv_subnet('192.168.50.0/24', '192.168.50.1-192.168.50.1') srv_control.config_srv_another_subnet_no_interface( '192.168.51.0/24', '192.168.51.1-192.168.51.1') srv_control.config_srv_another_subnet_no_interface( '192.168.52.0/24', '192.168.52.1-192.168.52.1') srv_control.config_srv_another_subnet_no_interface( '192.168.53.0/24', '192.168.53.1-192.168.53.1') srv_control.config_srv('time-servers', 0, '199.199.199.10') srv_control.config_srv('time-servers', 2, '199.199.199.100') srv_control.config_srv('time-servers', 3, '199.199.199.200') srv_control.add_hooks('libdhcp_subnet_cmds.so') # first shared subnet srv_control.shared_subnet('192.168.50.0/24', 0) srv_control.shared_subnet('192.168.51.0/24', 0) srv_control.set_conf_parameter_shared_subnet('name', '"name-abc"', 0) srv_control.set_conf_parameter_shared_subnet('interface', '"$(SERVER_IFACE)"', 0) # second shared-subnet srv_control.shared_subnet('192.168.52.0/24', 1) srv_control.shared_subnet('192.168.53.0/24', 1) srv_control.set_conf_parameter_shared_subnet('name', '"name-xyz"', 1) srv_control.set_conf_parameter_shared_subnet( 'relay', '{"ip-address":"$(GIADDR4)"}', 1) srv_control.open_control_channel() srv_control.build_and_send_config_files() srv_control.start_srv('DHCP', 'started') srv_msg.send_ctrl_cmd_via_socket( '{"command":"network4-del","arguments":{"name":"name-xxyz,"subnets-action": "delete""}}', exp_result=1) srv_msg.send_ctrl_cmd_via_socket( '{"command":"network4-list","arguments":{}}')
def test_v6_host_reservation_pgsql_option_multiple(): misc.test_setup() srv_control.config_srv_subnet('3000::/64', '3000::1-3000::ff') srv_control.enable_db_backend_reservation('PostgreSQL') srv_control.new_db_backend_reservation('PostgreSQL', 'duid', '00:03:00:01:f6:f5:f4:f3:f2:01') srv_control.update_db_backend_reservation('dhcp6_subnet_id', 1, 'PostgreSQL', 1) srv_control.ipv6_address_db_backend_reservation('3000::100', '$(EMPTY)', 'PostgreSQL', 1) srv_control.option_db_record_reservation(7, 10, 'dhcp6', 1, '$(EMPTY)', 1, 'subnet', 'PostgreSQL', 1) srv_control.option_db_record_reservation(21, 'srv1.example.com,srv2.isc.org', 'dhcp6', 1, '$(EMPTY)', 1, 'subnet', 'PostgreSQL', 1) srv_control.option_db_record_reservation(23, '2001:db8::1,2001:db8::2', 'dhcp6', 1, '$(EMPTY)', 1, 'subnet', 'PostgreSQL', 1) srv_control.option_db_record_reservation( 59, 'http://www.kea-reserved.isc.org', 'dhcp6', 1, '$(EMPTY)', 1, 'subnet', 'PostgreSQL', 1) # Add option reservation code 60 value 10 space dhcp6 persistent 1 client class $(EMPTY) subnet id 1 and scope subnet to MySQL record id 1. srv_control.upload_db_reservation('PostgreSQL') srv_control.config_srv('preference', 0, '123') srv_control.config_srv_opt('sip-server-dns', 'srv4.example.com,srv5.isc.org') # 21 srv_control.config_srv_opt('dns-servers', '2001:db8::4,2001:db8::5') # 23 srv_control.config_srv_opt('bootfile-url', 'http://www.kea.isc.org') # 59 srv_control.config_srv_opt('new-tzdb-timezone', 'Europe/Zurich') # 60 and not reserved srv_control.build_and_send_config_files() srv_control.start_srv('DHCP', 'started') misc.test_procedure() srv_msg.client_sets_value('Client', 'DUID', '00:03:00:01:f6:f5:f4:f3:f2:01') srv_msg.client_requests_option(7) srv_msg.client_requests_option(21) srv_msg.client_requests_option(23) srv_msg.client_requests_option(42) srv_msg.client_requests_option(59) srv_msg.client_does_include('Client', 'client-id') srv_msg.client_does_include('Client', 'IA-NA') srv_msg.client_send_msg('SOLICIT') misc.pass_criteria() srv_msg.send_wait_for_message('MUST', 'ADVERTISE') srv_msg.response_check_include_option(3) srv_msg.response_check_option_content(3, 'sub-option', 5) srv_msg.response_check_suboption_content(5, 3, 'addr', '3000::100') srv_msg.response_check_include_option(7) srv_msg.response_check_option_content(7, 'value', 10) srv_msg.response_check_include_option(59) srv_msg.response_check_option_content(59, 'optdata', 'http://www.kea-reserved.isc.org') srv_msg.response_check_include_option(21) srv_msg.response_check_option_content(21, 'addr', 'srv1.example.com.,srv2.isc.org.') srv_msg.response_check_include_option(23) srv_msg.response_check_option_content(23, 'addr', '2001:db8::1,2001:db8::2') srv_msg.response_check_include_option(42) srv_msg.response_check_option_content(42, 'optdata', 'Europe/Zurich') misc.test_procedure() srv_msg.client_sets_value('Client', 'DUID', '00:03:00:01:f6:f5:f4:f3:f2:21') srv_msg.client_requests_option(7) srv_msg.client_requests_option(21) srv_msg.client_requests_option(23) srv_msg.client_requests_option(59) srv_msg.client_requests_option(42) srv_msg.client_does_include('Client', 'client-id') srv_msg.client_does_include('Client', 'IA-NA') srv_msg.client_send_msg('SOLICIT') misc.pass_criteria() srv_msg.send_wait_for_message('MUST', 'ADVERTISE') srv_msg.response_check_include_option(3) srv_msg.response_check_option_content(3, 'sub-option', 5) srv_msg.response_check_include_option(7) srv_msg.response_check_option_content(7, 'value', 123) srv_msg.response_check_include_option(59) srv_msg.response_check_option_content(59, 'optdata', 'http://www.kea.isc.org') srv_msg.response_check_include_option(21) srv_msg.response_check_option_content(21, 'addr', 'srv4.example.com.,srv5.isc.org.') srv_msg.response_check_include_option(23) srv_msg.response_check_option_content(23, 'addr', '2001:db8::4,2001:db8::5') srv_msg.response_check_include_option(42) srv_msg.response_check_option_content(42, 'optdata', 'Europe/Zurich')
def test_v6_host_reservation_pgsql_option_multiple(): misc.test_setup() srv_control.config_srv_subnet('3000::/64', '3000::1-3000::ff') srv_control.enable_db_backend_reservation('PostgreSQL') srv_control.new_db_backend_reservation('PostgreSQL', 'duid', '00:03:00:01:f6:f5:f4:f3:f2:01') srv_control.update_db_backend_reservation('dhcp6_subnet_id', '1', 'PostgreSQL', '1') srv_control.ipv6_address_db_backend_reservation('3000::100', '$(EMPTY)', 'PostgreSQL', '1') srv_control.option_db_record_reservation('7', '10', 'dhcp6', '1', '$(EMPTY)', '1', 'subnet', 'PostgreSQL', '1') srv_control.option_db_record_reservation('21', 'srv1.example.com,srv2.isc.org', 'dhcp6', '1', '$(EMPTY)', '1', 'subnet', 'PostgreSQL', '1') srv_control.option_db_record_reservation('23', '2001:db8::1,2001:db8::2', 'dhcp6', '1', '$(EMPTY)', '1', 'subnet', 'PostgreSQL', '1') srv_control.option_db_record_reservation('59', 'http://www.kea-reserved.isc.org', 'dhcp6', '1', '$(EMPTY)', '1', 'subnet', 'PostgreSQL', '1') # Add option reservation code 60 value 10 space dhcp6 persistent 1 client class $(EMPTY) subnet id 1 and scope subnet to MySQL record id 1. srv_control.upload_db_reservation('PostgreSQL') srv_control.config_srv('preference', '0', '123') srv_control.config_srv_opt('sip-server-dns', 'srv4.example.com,srv5.isc.org') # 21 srv_control.config_srv_opt('dns-servers', '2001:db8::4,2001:db8::5') # 23 srv_control.config_srv_opt('bootfile-url', 'http://www.kea.isc.org') # 59 srv_control.config_srv_opt('new-tzdb-timezone', 'Europe/Zurich') # 60 and not reserved srv_control.build_and_send_config_files('SSH', 'config-file') srv_control.start_srv('DHCP', 'started') misc.test_procedure() srv_msg.client_sets_value('Client', 'DUID', '00:03:00:01:f6:f5:f4:f3:f2:01') srv_msg.client_requests_option('7') srv_msg.client_requests_option('21') srv_msg.client_requests_option('23') srv_msg.client_requests_option('42') srv_msg.client_requests_option('59') srv_msg.client_does_include('Client', None, 'client-id') srv_msg.client_does_include('Client', None, 'IA-NA') srv_msg.client_send_msg('SOLICIT') misc.pass_criteria() srv_msg.send_wait_for_message('MUST', None, 'ADVERTISE') srv_msg.response_check_include_option('Response', None, '3') srv_msg.response_check_option_content('Response', '3', None, 'sub-option', '5') srv_msg.response_check_suboption_content('Response', '5', '3', None, 'addr', '3000::100') srv_msg.response_check_include_option('Response', None, '7') srv_msg.response_check_option_content('Response', '7', None, 'value', '10') srv_msg.response_check_include_option('Response', None, '59') srv_msg.response_check_option_content('Response', '59', None, 'optdata', 'http://www.kea-reserved.isc.org') srv_msg.response_check_include_option('Response', None, '21') srv_msg.response_check_option_content('Response', '21', None, 'addr', 'srv1.example.com.,srv2.isc.org.') srv_msg.response_check_include_option('Response', None, '23') srv_msg.response_check_option_content('Response', '23', None, 'addr', '2001:db8::1,2001:db8::2') srv_msg.response_check_include_option('Response', None, '42') srv_msg.response_check_option_content('Response', '42', None, 'optdata', 'Europe/Zurich') misc.test_procedure() srv_msg.client_sets_value('Client', 'DUID', '00:03:00:01:f6:f5:f4:f3:f2:21') srv_msg.client_requests_option('7') srv_msg.client_requests_option('21') srv_msg.client_requests_option('23') srv_msg.client_requests_option('59') srv_msg.client_requests_option('42') srv_msg.client_does_include('Client', None, 'client-id') srv_msg.client_does_include('Client', None, 'IA-NA') srv_msg.client_send_msg('SOLICIT') misc.pass_criteria() srv_msg.send_wait_for_message('MUST', None, 'ADVERTISE') srv_msg.response_check_include_option('Response', None, '3') srv_msg.response_check_option_content('Response', '3', None, 'sub-option', '5') srv_msg.response_check_include_option('Response', None, '7') srv_msg.response_check_option_content('Response', '7', None, 'value', '123') srv_msg.response_check_include_option('Response', None, '59') srv_msg.response_check_option_content('Response', '59', None, 'optdata', 'http://www.kea.isc.org') srv_msg.response_check_include_option('Response', None, '21') srv_msg.response_check_option_content('Response', '21', None, 'addr', 'srv4.example.com.,srv5.isc.org.') srv_msg.response_check_include_option('Response', None, '23') srv_msg.response_check_option_content('Response', '23', None, 'addr', '2001:db8::4,2001:db8::5') srv_msg.response_check_include_option('Response', None, '42') srv_msg.response_check_option_content('Response', '42', None, 'optdata', 'Europe/Zurich')
def test_v6_options_all(): misc.test_setup() srv_control.config_srv_subnet('3000::/64', '3000::1-3000::ff') srv_control.config_srv_opt('preference', '123') srv_control.config_srv_opt('sip-server-dns', 'srv1.example.com,srv2.isc.org') srv_control.config_srv_opt('dns-servers', '2001:db8::1,2001:db8::2') srv_control.config_srv_opt('domain-search', 'domain1.example.com,domain2.isc.org') srv_control.config_srv_opt('sip-server-addr', '2001:db8::1,2001:db8::2') srv_control.config_srv_opt('nisp-servers', '2001:db8::abc,3000::1,2000::1234') srv_control.config_srv_opt('nis-servers', '2001:db8::abc,3000::1,2000::1234') srv_control.config_srv_opt('nis-domain-name', 'ntp.example.com') srv_control.config_srv_opt('nisp-domain-name', 'ntp.example.com') srv_control.config_srv_opt('sntp-servers', '2001:db8::abc,3000::1,2000::1234') srv_control.config_srv_opt('information-refresh-time', '12345678') srv_control.config_srv_opt('unicast', '3000::66') srv_control.config_srv_opt('bcmcs-server-dns', 'very.good.domain.name.com') srv_control.config_srv_opt('bcmcs-server-addr', '3000::66,3000::77') srv_control.config_srv_opt('pana-agent', '3000::66,3000::77') srv_control.config_srv_opt('new-posix-timezone', 'EST5EDT4') srv_control.config_srv_opt('new-tzdb-timezone', 'Europe/Zurich') srv_control.config_srv_opt('bootfile-url', 'http://www.kea.isc.org') srv_control.config_srv_opt('bootfile-param', '000B48656C6C6F20776F726C640003666F6F') srv_control.config_srv_opt('erp-local-domain-name', 'erp-domain.isc.org') srv_control.config_srv('domain-search', 0, 'subnet.example.com') srv_control.config_srv_custom_opt('foo', 100, 'uint8', '123') srv_control.config_srv_opt_space('vendor-4491', 'tftp-servers', '2001:558:ff18:16:10:253:175:76') srv_control.config_srv_opt_space('vendor-4491', 'config-file', 'normal_erouter_v6.cm') srv_control.config_srv_opt_space('vendor-4491', 'syslog-servers', '2001:558:ff18:10:10:253:124:101') srv_control.config_srv_opt_space('vendor-4491', 'time-servers', '2001:558:ff18:16:10:253:175:76') srv_control.config_srv_opt_space('vendor-4491', 'time-offset', '-10000') srv_control.build_and_send_config_files() srv_control.start_srv('DHCP', 'started') misc.test_procedure() srv_msg.client_requests_option(7) srv_msg.client_requests_option(12) srv_msg.client_requests_option(21) srv_msg.client_requests_option(22) srv_msg.client_requests_option(23) srv_msg.client_requests_option(24) srv_msg.client_requests_option(27) srv_msg.client_requests_option(28) srv_msg.client_requests_option(29) srv_msg.client_requests_option(30) srv_msg.client_requests_option(31) srv_msg.client_requests_option(32) srv_msg.client_requests_option(33) srv_msg.client_requests_option(34) srv_msg.client_requests_option(40) srv_msg.client_requests_option(41) srv_msg.client_requests_option(42) srv_msg.client_requests_option(59) srv_msg.client_requests_option(60) srv_msg.client_requests_option(65) srv_msg.client_requests_option(100) srv_msg.client_send_msg('INFOREQUEST') misc.pass_criteria() srv_msg.send_wait_for_message('MUST', 'REPLY') srv_msg.response_check_include_option(7) srv_msg.response_check_option_content(7, 'value', 123) srv_msg.response_check_include_option(12) srv_msg.response_check_option_content(12, 'srvaddr', '3000::66') srv_msg.response_check_include_option(21) srv_msg.response_check_option_content(21, 'addresses', 'srv1.example.com.,srv2.isc.org.') srv_msg.response_check_include_option(22) srv_msg.response_check_option_content(22, 'addresses', '2001:db8::1,2001:db8::2') srv_msg.response_check_include_option(23) srv_msg.response_check_option_content(23, 'addresses', '2001:db8::1,2001:db8::2') srv_msg.response_check_include_option(24) srv_msg.response_check_include_option(27) srv_msg.response_check_option_content(27, 'addresses', '2001:db8::abc,3000::1,2000::1234') srv_msg.response_check_include_option(28) srv_msg.response_check_option_content(28, 'addresses', '2001:db8::abc,3000::1,2000::1234') srv_msg.response_check_include_option(29) srv_msg.response_check_option_content(29, 'domain', 'ntp.example.com.') srv_msg.response_check_include_option(30) srv_msg.response_check_option_content(30, 'domain', 'ntp.example.com.') srv_msg.response_check_include_option(31) srv_msg.response_check_option_content(31, 'addresses', '2001:db8::abc,3000::1,2000::1234') srv_msg.response_check_include_option(32) srv_msg.response_check_option_content(32, 'value', '12345678') srv_msg.response_check_include_option(33) srv_msg.response_check_option_content(33, 'bcmcsdomains', 'very.good.domain.name.com.') srv_msg.response_check_include_option(34) srv_msg.response_check_option_content(34, 'bcmcsservers', '3000::66,3000::77') srv_msg.response_check_include_option(40) srv_msg.response_check_option_content(40, 'paaaddr', '3000::66,3000::77') srv_msg.response_check_include_option(41) srv_msg.response_check_option_content(41, 'optdata', 'EST5EDT4') srv_msg.response_check_include_option(42) srv_msg.response_check_option_content(42, 'optdata', 'Europe/Zurich') srv_msg.response_check_include_option(59) srv_msg.response_check_option_content(59, 'optdata', 'http://www.kea.isc.org') srv_msg.response_check_include_option(65) srv_msg.response_check_option_content(65, 'erpdomain', 'erp-domain.isc.org.') misc.test_procedure() srv_msg.client_requests_option(7) srv_msg.client_requests_option(12) srv_msg.client_requests_option(21) srv_msg.client_requests_option(22) srv_msg.client_requests_option(23) srv_msg.client_requests_option(24) srv_msg.client_requests_option(27) srv_msg.client_requests_option(28) srv_msg.client_requests_option(29) srv_msg.client_requests_option(30) srv_msg.client_requests_option(31) srv_msg.client_requests_option(32) srv_msg.client_requests_option(33) srv_msg.client_requests_option(34) srv_msg.client_requests_option(40) srv_msg.client_requests_option(41) srv_msg.client_requests_option(42) srv_msg.client_requests_option(59) srv_msg.client_requests_option(60) srv_msg.client_requests_option(65) srv_msg.client_requests_option(100) srv_msg.client_sets_value('Client', 'enterprisenum', '4491') srv_msg.client_does_include('Client', 'vendor-class') srv_msg.add_vendor_suboption('Client', 1, 32) srv_msg.add_vendor_suboption('Client', 1, 33) srv_msg.add_vendor_suboption('Client', 1, 34) srv_msg.add_vendor_suboption('Client', 1, 37) srv_msg.add_vendor_suboption('Client', 1, 38) srv_msg.client_does_include('Client', 'vendor-specific-info') srv_msg.client_does_include('Client', 'client-id') srv_msg.client_does_include('Client', 'IA-NA') srv_msg.client_send_msg('SOLICIT') misc.pass_criteria() srv_msg.send_wait_for_message('MUST', 'ADVERTISE') srv_msg.response_check_include_option(17) srv_msg.response_check_option_content(17, 'sub-option', 32) srv_msg.response_check_option_content(17, 'sub-option', 33) srv_msg.response_check_option_content(17, 'sub-option', 34) srv_msg.response_check_option_content(17, 'sub-option', 37) srv_msg.response_check_option_content(17, 'sub-option', 38) srv_msg.response_check_include_option(7) srv_msg.response_check_option_content(7, 'value', 123) srv_msg.response_check_include_option(12) srv_msg.response_check_option_content(12, 'srvaddr', '3000::66') srv_msg.response_check_include_option(21) srv_msg.response_check_option_content(21, 'addresses', 'srv1.example.com.,srv2.isc.org.') srv_msg.response_check_include_option(22) srv_msg.response_check_option_content(22, 'addresses', '2001:db8::1,2001:db8::2') srv_msg.response_check_include_option(23) srv_msg.response_check_option_content(23, 'addresses', '2001:db8::1,2001:db8::2') srv_msg.response_check_include_option(24) srv_msg.response_check_option_content(24, 'domains', 'subnet.example.com.') srv_msg.response_check_include_option(27) srv_msg.response_check_option_content(27, 'addresses', '2001:db8::abc,3000::1,2000::1234') srv_msg.response_check_include_option(28) srv_msg.response_check_option_content(28, 'addresses', '2001:db8::abc,3000::1,2000::1234') srv_msg.response_check_include_option(29) srv_msg.response_check_option_content(29, 'domain', 'ntp.example.com.') srv_msg.response_check_include_option(30) srv_msg.response_check_option_content(30, 'domain', 'ntp.example.com.') srv_msg.response_check_include_option(31) srv_msg.response_check_option_content(31, 'addresses', '2001:db8::abc,3000::1,2000::1234') srv_msg.response_check_include_option(32) srv_msg.response_check_option_content(32, 'value', '12345678') srv_msg.response_check_include_option(33) srv_msg.response_check_option_content(33, 'bcmcsdomains', 'very.good.domain.name.com.') srv_msg.response_check_include_option(34) srv_msg.response_check_option_content(34, 'bcmcsservers', '3000::66,3000::77') srv_msg.response_check_include_option(40) srv_msg.response_check_option_content(40, 'paaaddr', '3000::66,3000::77') srv_msg.response_check_include_option(41) srv_msg.response_check_option_content(41, 'optdata', 'EST5EDT4') srv_msg.response_check_include_option(42) srv_msg.response_check_option_content(42, 'optdata', 'Europe/Zurich') srv_msg.response_check_include_option(59) srv_msg.response_check_option_content(59, 'optdata', 'http://www.kea.isc.org') srv_msg.response_check_include_option(65) srv_msg.response_check_option_content(65, 'erpdomain', 'erp-domain.isc.org.')