def test_v6_options_vendor_time_servers(): # Testing server ability to configure it with vendor-specific options # and share it with user. # In this case: for vendor id vendor-4491 set option time-servers option with value 2001::76. # Send vendor class and vendor specific information option (with option request). # Vendor tests are beta version. # with client via Advertise message. # Client Server # vendor-class # specific-info-req (37) SOLICIT --> # vendor-spec-info <-- ADVERTISE # Pass Criteria: # REPLY/ADVERTISE MUST include option: # vendor specific information (code 17) with suboption # time protocol servers (code 37) misc.test_setup() srv_control.config_srv_subnet('3000::/32', '3000::1-3000::2') srv_control.config_srv_opt_space('vendor-4491', 'time-servers', '2001::76') srv_control.build_and_send_config_files() srv_control.start_srv('DHCP', 'started') srv_msg.client_sets_value('Client', 'enterprisenum', '4491') srv_msg.client_does_include('Client', 'vendor-class') srv_msg.add_vendor_suboption('Client', 1, 37) 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', 37) references.references_check('RFC3315')
def test_v6_options_vendor_time_servers(): # Testing server ability to configure it with vendor-specific options # and share it with user. # In this case: for vendor id vendor-4491 set option time-servers option with value 2001::76. # Send vendor class and vendor specific information option (with option request). # Vendor tests are beta version. # with client via Advertise message. # Client Server # vendor-class # specific-info-req (37) SOLICIT --> # vendor-spec-info <-- ADVERTISE # Pass Criteria: # REPLY/ADVERTISE MUST include option: # vendor specific information (code 17) with suboption # time protocol servers (code 37) misc.test_setup() srv_control.config_srv_subnet('3000::/32', '3000::1-3000::2') srv_control.config_srv_opt_space('vendor-4491', 'time-servers', '2001::76') srv_control.build_and_send_config_files('SSH', 'config-file') srv_control.start_srv('DHCP', 'started') srv_msg.client_sets_value('Client', 'enterprisenum', '4491') srv_msg.client_does_include('Client', None, 'vendor-class') srv_msg.add_vendor_suboption('Client', '1', '37') srv_msg.client_does_include('Client', None, 'vendor-specific-info') 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, '17') srv_msg.response_check_option_content('Response', '17', None, 'sub-option', '37') references.references_check('RFC3315')
def test_user_check_hook_vendor_options_all(): # Install the requisite user registry file onto the server and then # Configure the server with two subnets. The first subnet will be used # for registeted users, the second for unregistered users. misc.test_setup() srv_msg.send_file_to_server( 'tests/dhcpv6/kea_only/user_chk/registry_1.txt', '/tmp/user_chk_registry.txt') srv_msg.remove_file_from_server('/tmp/user_chk_outcome.txt') srv_control.config_srv_subnet('3000::/64', '3000::5-3000::20') srv_control.config_srv_another_subnet_no_interface('1000:1::/64', '1000:1::5-1000:1::5') srv_control.add_hooks('libdhcp_user_chk.so') srv_control.config_srv_opt_space('vendor-4491', 'tftp-servers', '7000::1') srv_control.config_srv_opt_space('vendor-4491', 'config-file', 'bootfile.from.server') srv_control.build_and_send_config_files('SSH', 'config-file') srv_control.start_srv('DHCP', 'started') # # Send a query from an unknown user # misc.test_procedure() srv_msg.client_sets_value('Client', 'DUID', '00:03:00:01:ff:ff:ff:ff:ff:01') srv_msg.client_sets_value('Client', 'enterprisenum', '4491') srv_msg.client_does_include('Client', None, 'vendor-class') srv_msg.add_vendor_suboption('Client', '1', '32') srv_msg.add_vendor_suboption('Client', '1', '33') srv_msg.client_does_include('Client', None, 'vendor-specific-info') 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') # We don't really care about the address value # Options should come from default user in registry srv_msg.response_check_include_option('Response', None, '17') srv_msg.response_check_option_content('Response', '17', None, 'sub-option', '32') # Response sub-option 32 from option 17 MUST contain tftp-servers 9000::1. srv_msg.response_check_option_content('Response', '17', None, 'sub-option', '33') srv_msg.response_check_suboption_content('Response', '33', '17', None, 'config-file', 'bootfile.from.default') # # Send a query from a registered user with no properties # misc.test_procedure() srv_msg.client_sets_value('Client', 'DUID', '00:03:00:01:11:02:03:04:05:06') srv_msg.client_sets_value('Client', 'enterprisenum', '4491') srv_msg.client_does_include('Client', None, 'vendor-class') srv_msg.add_vendor_suboption('Client', '1', '32') srv_msg.add_vendor_suboption('Client', '1', '33') srv_msg.client_does_include('Client', None, 'vendor-specific-info') 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') # We don't really care about the address value # Options should come from server config srv_msg.response_check_include_option('Response', None, '17') srv_msg.response_check_option_content('Response', '17', None, 'sub-option', '32') # Response sub-option 32 from option 17 MUST contain tftp-servers 7000::1. srv_msg.response_check_option_content('Response', '17', None, 'sub-option', '33') srv_msg.response_check_suboption_content('Response', '33', '17', None, 'config-file', 'bootfile.from.server') # # Send a query from a registered user who supplies only bootfile # misc.test_procedure() srv_msg.client_sets_value('Client', 'DUID', '00:03:00:01:22:02:03:04:05:06') srv_msg.client_sets_value('Client', 'enterprisenum', '4491') srv_msg.client_does_include('Client', None, 'vendor-class') srv_msg.add_vendor_suboption('Client', '1', '32') srv_msg.add_vendor_suboption('Client', '1', '33') srv_msg.client_does_include('Client', None, 'vendor-specific-info') 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') # We don't really care about the address value # bootfile should be from user, tftp server from server config srv_msg.response_check_include_option('Response', None, '17') srv_msg.response_check_option_content('Response', '17', None, 'sub-option', '32') # Response sub-option 32 from option 17 MUST contain tftp-servers 7000::1. srv_msg.response_check_option_content('Response', '17', None, 'sub-option', '33') srv_msg.response_check_suboption_content('Response', '33', '17', None, 'config-file', 'bootfile.from.user') # # Send a query from a registered user who supplies only tftp server # misc.test_procedure() srv_msg.client_sets_value('Client', 'DUID', '00:03:00:01:33:02:03:04:05:06') srv_msg.client_sets_value('Client', 'enterprisenum', '4491') srv_msg.client_does_include('Client', None, 'vendor-class') srv_msg.add_vendor_suboption('Client', '1', '32') srv_msg.add_vendor_suboption('Client', '1', '33') srv_msg.client_does_include('Client', None, 'vendor-specific-info') 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') # We don't really care about the address value # bootfile should be from server config, tftp server from user srv_msg.response_check_include_option('Response', None, '17') srv_msg.response_check_option_content('Response', '17', None, 'sub-option', '32') # Response sub-option 32 from option 17 MUST contain tftp-servers 8000::1. srv_msg.response_check_option_content('Response', '17', None, 'sub-option', '33') srv_msg.response_check_suboption_content('Response', '33', '17', None, 'config-file', 'bootfile.from.server') misc.test_procedure() # Send a query from a registered user who supplies both tftp server and bootfile srv_msg.client_sets_value('Client', 'DUID', '00:03:00:01:44:02:03:04:05:06') srv_msg.client_sets_value('Client', 'enterprisenum', '4491') srv_msg.client_does_include('Client', None, 'vendor-class') srv_msg.add_vendor_suboption('Client', '1', '32') srv_msg.add_vendor_suboption('Client', '1', '33') srv_msg.client_does_include('Client', None, 'vendor-specific-info') 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') # We don't really care about the address value # tftp server and bootfile should be from user srv_msg.response_check_include_option('Response', None, '17') srv_msg.response_check_option_content('Response', '17', None, 'sub-option', '32') # Response sub-option 32 from option 17 MUST contain tftp-servers 8002::1. srv_msg.response_check_option_content('Response', '17', None, 'sub-option', '33') srv_msg.response_check_suboption_content('Response', '33', '17', None, 'config-file', 'bootfile.from.user-2')
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.')
def test_v6_options_vendor_multiple(): # Testing server ability to configure it with vendor-specific options # and share it with user. # In this case: for vendor id vendor-4491 set option time-offset with value -18000 # and for vendor id vendor-4491 set option tftp-servers with value: 2001:558:ff18:16:10:253:175:76 # and for vendor id vendor-4491 set option config-file with value normal_erouter_v6.cm # and for vendor id vendor-4491 set option syslog-servers with address 2001:558:ff18:10:10:253:124:101 # and for vendor id vendor-4491 set option time-servers option with value 2001:558:ff18:16:10:253:175:76 # and for vendor id vendor-4491 set option time-offset with value -10000 # Send vendor class and vendor specific information option (with option request). # Vendor tests are beta version. # with client via Advertise message. # Client Server # vendor-class # specific-info-req (all codes)SOLICIT --> # vendor-spec-info <-- ADVERTISE # Pass Criteria: # REPLY/ADVERTISE MUST include option: # vendor specific information (code 17) with suboption # TFTP Server address (code 32) # Configuration file name (code 33) # sys log servers (code 34) # time offset (code 38) # time protocol servers (code 37) misc.test_setup() srv_control.config_srv_subnet('3000::/32', '3000::1-3000::2') 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') 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) references.references_check('RFC3315')
def test_v6_options_vendor_multiple(): # Testing server ability to configure it with vendor-specific options # and share it with user. # In this case: for vendor id vendor-4491 set option time-offset with value -18000 # and for vendor id vendor-4491 set option tftp-servers with value: 2001:558:ff18:16:10:253:175:76 # and for vendor id vendor-4491 set option config-file with value normal_erouter_v6.cm # and for vendor id vendor-4491 set option syslog-servers with address 2001:558:ff18:10:10:253:124:101 # and for vendor id vendor-4491 set option time-servers option with value 2001:558:ff18:16:10:253:175:76 # and for vendor id vendor-4491 set option time-offset with value -10000 # Send vendor class and vendor specific information option (with option request). # Vendor tests are beta version. # with client via Advertise message. # Client Server # vendor-class # specific-info-req (all codes)SOLICIT --> # vendor-spec-info <-- ADVERTISE # Pass Criteria: # REPLY/ADVERTISE MUST include option: # vendor specific information (code 17) with suboption # TFTP Server address (code 32) # Configuration file name (code 33) # sys log servers (code 34) # time offset (code 38) # time protocol servers (code 37) misc.test_setup() srv_control.config_srv_subnet('3000::/32', '3000::1-3000::2') 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('SSH', 'config-file') srv_control.start_srv('DHCP', 'started') srv_msg.client_sets_value('Client', 'enterprisenum', '4491') srv_msg.client_does_include('Client', None, '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', None, 'vendor-specific-info') 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, '17') srv_msg.response_check_option_content('Response', '17', None, 'sub-option', '32') srv_msg.response_check_option_content('Response', '17', None, 'sub-option', '33') srv_msg.response_check_option_content('Response', '17', None, 'sub-option', '34') srv_msg.response_check_option_content('Response', '17', None, 'sub-option', '37') srv_msg.response_check_option_content('Response', '17', None, 'sub-option', '38') references.references_check('RFC3315')
def test_user_check_hook_vendor_options_all(): # Install the requisite user registry file onto the server and then # Configure the server with two subnets. The first subnet will be used # for registeted users, the second for unregistered users. misc.test_setup() srv_msg.send_file_to_server('tests/dhcpv6/kea_only/user_chk/registry_1.txt', '/tmp/user_chk_registry.txt') srv_msg.remove_file_from_server('/tmp/user_chk_outcome.txt') srv_control.config_srv_subnet('3000::/64', '3000::5-3000::20') srv_control.config_srv_another_subnet_no_interface('1000:1::/64', '1000:1::5-1000:1::5') srv_control.add_hooks('$(SOFTWARE_INSTALL_DIR)/lib/kea/hooks/libdhcp_user_chk.so') srv_control.config_srv_opt_space('vendor-4491', 'tftp-servers', '7000::1') srv_control.config_srv_opt_space('vendor-4491', 'config-file', 'bootfile.from.server') srv_control.build_and_send_config_files('SSH', 'config-file') srv_control.start_srv('DHCP', 'started') # # Send a query from an unknown user # misc.test_procedure() srv_msg.client_sets_value('Client', 'DUID', '00:03:00:01:ff:ff:ff:ff:ff:01') srv_msg.client_sets_value('Client', 'enterprisenum', '4491') srv_msg.client_does_include('Client', None, 'vendor-class') srv_msg.add_vendor_suboption('Client', '1', '32') srv_msg.add_vendor_suboption('Client', '1', '33') srv_msg.client_does_include('Client', None, 'vendor-specific-info') 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') # We don't really care about the address value # Options should come from default user in registry srv_msg.response_check_include_option('Response', None, '17') srv_msg.response_check_option_content('Response', '17', None, 'sub-option', '32') # Response sub-option 32 from option 17 MUST contain tftp-servers 9000::1. srv_msg.response_check_option_content('Response', '17', None, 'sub-option', '33') srv_msg.response_check_suboption_content('Response', '33', '17', None, 'config-file', 'bootfile.from.default') # # Send a query from a registered user with no properties # misc.test_procedure() srv_msg.client_sets_value('Client', 'DUID', '00:03:00:01:11:02:03:04:05:06') srv_msg.client_sets_value('Client', 'enterprisenum', '4491') srv_msg.client_does_include('Client', None, 'vendor-class') srv_msg.add_vendor_suboption('Client', '1', '32') srv_msg.add_vendor_suboption('Client', '1', '33') srv_msg.client_does_include('Client', None, 'vendor-specific-info') 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') # We don't really care about the address value # Options should come from server config srv_msg.response_check_include_option('Response', None, '17') srv_msg.response_check_option_content('Response', '17', None, 'sub-option', '32') # Response sub-option 32 from option 17 MUST contain tftp-servers 7000::1. srv_msg.response_check_option_content('Response', '17', None, 'sub-option', '33') srv_msg.response_check_suboption_content('Response', '33', '17', None, 'config-file', 'bootfile.from.server') # # Send a query from a registered user who supplies only bootfile # misc.test_procedure() srv_msg.client_sets_value('Client', 'DUID', '00:03:00:01:22:02:03:04:05:06') srv_msg.client_sets_value('Client', 'enterprisenum', '4491') srv_msg.client_does_include('Client', None, 'vendor-class') srv_msg.add_vendor_suboption('Client', '1', '32') srv_msg.add_vendor_suboption('Client', '1', '33') srv_msg.client_does_include('Client', None, 'vendor-specific-info') 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') # We don't really care about the address value # bootfile should be from user, tftp server from server config srv_msg.response_check_include_option('Response', None, '17') srv_msg.response_check_option_content('Response', '17', None, 'sub-option', '32') # Response sub-option 32 from option 17 MUST contain tftp-servers 7000::1. srv_msg.response_check_option_content('Response', '17', None, 'sub-option', '33') srv_msg.response_check_suboption_content('Response', '33', '17', None, 'config-file', 'bootfile.from.user') # # Send a query from a registered user who supplies only tftp server # misc.test_procedure() srv_msg.client_sets_value('Client', 'DUID', '00:03:00:01:33:02:03:04:05:06') srv_msg.client_sets_value('Client', 'enterprisenum', '4491') srv_msg.client_does_include('Client', None, 'vendor-class') srv_msg.add_vendor_suboption('Client', '1', '32') srv_msg.add_vendor_suboption('Client', '1', '33') srv_msg.client_does_include('Client', None, 'vendor-specific-info') 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') # We don't really care about the address value # bootfile should be from server config, tftp server from user srv_msg.response_check_include_option('Response', None, '17') srv_msg.response_check_option_content('Response', '17', None, 'sub-option', '32') # Response sub-option 32 from option 17 MUST contain tftp-servers 8000::1. srv_msg.response_check_option_content('Response', '17', None, 'sub-option', '33') srv_msg.response_check_suboption_content('Response', '33', '17', None, 'config-file', 'bootfile.from.server') misc.test_procedure() # Send a query from a registered user who supplies both tftp server and bootfile srv_msg.client_sets_value('Client', 'DUID', '00:03:00:01:44:02:03:04:05:06') srv_msg.client_sets_value('Client', 'enterprisenum', '4491') srv_msg.client_does_include('Client', None, 'vendor-class') srv_msg.add_vendor_suboption('Client', '1', '32') srv_msg.add_vendor_suboption('Client', '1', '33') srv_msg.client_does_include('Client', None, 'vendor-specific-info') 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') # We don't really care about the address value # tftp server and bootfile should be from user srv_msg.response_check_include_option('Response', None, '17') srv_msg.response_check_option_content('Response', '17', None, 'sub-option', '32') # Response sub-option 32 from option 17 MUST contain tftp-servers 8002::1. srv_msg.response_check_option_content('Response', '17', None, 'sub-option', '33') srv_msg.response_check_suboption_content('Response', '33', '17', None, 'config-file', 'bootfile.from.user-2')