Exemple #1
0
static int pktqueue_test_init(void)
{
	START_TESTS("Packet queue");

	INIT_CALL_END(init(), test_pkt_queue_asr(), end(), "test_pkt_queue 1");
	INIT_CALL_END(init(), test_pkt_queue_ars(), end(), "test_pkt_queue 2");

	END_TESTS;
}
Exemple #2
0
static int configproto_test_init(void)
{
	START_TESTS("Packet queue");

	INIT_CALL_END(init(), basic_test(), end(), "basic test");
	INIT_CALL_END(init(), translate_nulls_mtu(), end(), "nulls mtus");

	END_TESTS;
}
Exemple #3
0
static int send_packet_test_init(void)
{
	START_TESTS("Send Packet test");

	INIT_CALL_END(init(), divide_skb6_udp(), end(), "test_send_packet IPv6 UDP fragmentation");
	INIT_CALL_END(init(), divide_skb6_icmp(), end(), "test_send_packet IPv6 ICMP fragmentation");
	INIT_CALL_END(init(), divide_skb6_tcp(), end(), "test_send_packet IPv6 TCP fragmentation");

	END_TESTS;
}
Exemple #4
0
int init_module(void)
{
	START_TESTS("Pool");

	INIT_CALL_END(init(), test_get_any_function(), destroy(), "Get simple");
	INIT_CALL_END(init(), test_return_function(), destroy(), "Get and Return");
	INIT_CALL_END(init(), test_get_similar_function(), destroy(), "Allocate functions");

	END_TESTS;
}
Exemple #5
0
static int address_mapping_test_init(void)
{
	START_TESTS("Address Mapping test");

	INIT_CALL_END(init(), add_test(), end(), "add function");
	INIT_CALL_END(init(), daniel_test(), end(), "Daniel's xlat tests");
	INIT_CALL_END(init(), anderson_test(), end(), "Tore's xlat tests");
	INIT_CALL_END(init(), remove_test(), end(), "remove function");

	END_TESTS;
}
Exemple #6
0
int init_module(void)
{
	START_TESTS("BIB-Session");

	INIT_CALL_END(init(), simple_bib(), end(), "Single BIB");
	INIT_CALL_END(init(), simple_session(), end(), "Single Session");
	INIT_CALL_END(init(), test_clean_old_sessions(), end(), "Session cleansing.");
	INIT_CALL_END(init(), test_address_filtering(), end(), "Address-dependent filtering.");
	INIT_CALL_END(init(), test_for_each(), end(), "for-each function.");

	END_TESTS;
}
Exemple #7
0
int init_module(void)
{
	START_TESTS("BIB");

	INIT_CALL_END(init(), simple_bib(), end(), "Single BIB");
	INIT_CALL_END(init(), test_allocate_ipv4_transport_address(), end(), "Allocate function.");
	INIT_CALL_END(init(), test_compare_addr6(), end(), "compare_addr6");
	INIT_CALL_END(init(), test_compare_full6(), end(), "compare_full6");
	INIT_CALL_END(init(), test_compare_addr4(), end(), "compare_addr4");

	END_TESTS;
}
Exemple #8
0
int init_module(void)
{
	START_TESTS("IPv4 Pool DB");

	/*
	 * TODO (test) This is missing a multiple-tables test.
	 * (it always does mark = 1.)
	 */

	INIT_CALL_END(init(), test_foreach_sample(), destroy(), "Sample for");
	INIT_CALL_END(init(), test_add(), destroy(), "Add");
	INIT_CALL_END(init(), test_rm(), destroy(), "Rm");
	INIT_CALL_END(init(), test_flush(), destroy(), "Flush");

	END_TESTS;
}
Exemple #9
0
int init_module(void)
{
	START_TESTS("Session table");

	INIT_CALL_END(init(), test_foreach(), end(), "Foreach");

	END_TESTS;
}
Exemple #10
0
int init_module(void)
{
	START_TESTS("Session");

	INIT_CALL_END(init(), simple_session(), end(), "Single Session");

	END_TESTS;
}
Exemple #11
0
int init_module(void)
{
	START_TESTS("IPv4 Pool");

	INIT_CALL_END(init(), test_get_match_function_udp(), destroy(), "Get match-UDP");
	INIT_CALL_END(init(), test_get_match_function_tcp(), destroy(), "Get match-TCP");
	INIT_CALL_END(init(), test_get_match_function_icmp(), destroy(), "Get match-ICMP");
	INIT_CALL_END(init(), test_get_any_port_function_udp(), destroy(), "Get any port-UDP");
	INIT_CALL_END(init(), test_get_any_port_function_tcp(), destroy(), "Get any port-TCP");
	INIT_CALL_END(init(), test_get_any_port_function_icmp(), destroy(), "Get any port-ICMP");
	INIT_CALL_END(init(), test_get_any_addr_function_udp(), destroy(), "Get any addr-UDP");
	INIT_CALL_END(init(), test_get_any_addr_function_tcp(), destroy(), "Get any addr-TCP");
	INIT_CALL_END(init(), test_get_any_addr_function_icmp(), destroy(), "Get any addr-ICMP");
	INIT_CALL_END(init(), test_return_function(), destroy(), "Return function");

	END_TESTS;
}
int __init filtering_test_init(void)
{
    START_TESTS("Filtering and Updating");
    
    log_debug("\n\n\n");
    log_debug("\n\nNAT64 %s TEST module inserted!", "filtering_test");

    // Initialize the NAT configuration for the tests.
    if ( !config_init() )
		return -EINVAL;

    /*      UDP & ICMP      */
    CALL_TEST(test_transport_address_ipv4(), "test_transport_address_ipv4");
    CALL_TEST(test_transport_address_ipv6(), "test_transport_address_ipv6");
    CALL_TEST(test_extract_ipv4_from_ipv6(), "test_extract_ipv4_from_ipv6");
    CALL_TEST(test_embed_ipv4_in_ipv6(), "test_embed_ipv4_in_ipv6");
    CALL_TEST(test_allocate_ipv4_transport_address(), "test_allocate_ipv4_transport_address");
    CALL_TEST(test_allocate_ipv4_transport_address_digger(), "test_allocate_ipv4_transport_address_digger");
    INIT_CALL_END(init_full(), test_ipv6_udp(), end_full(), "test_ipv6_udp");
    INIT_CALL_END(init_full(), test_ipv4_udp(), end_full(), "test_ipv4_udp");
    INIT_CALL_END(init_full(), test_ipv6_icmp6(), end_full(), "test_ipv6_icmp6");
    INIT_CALL_END(init_full(), test_ipv4_icmp4(), end_full(), "test_ipv4_icmp4");
    //~ CALL_TEST(test_send_icmp_error_message(), "test_send_icmp_error_message"); // Not implemented yet!
    INIT_CALL_END(init_full(), test_filtering_and_updating(), end_full(), "test_filtering_and_updating");

    /*      TCP      */
    CALL_TEST(test_packet_is_ipv4(), "test_packet_is_ipv4");
    CALL_TEST(test_packet_is_ipv6(), "test_packet_is_ipv6");
    CALL_TEST(test_packet_is_v4_syn(), "test_packet_is_v4_syn");
    CALL_TEST(test_packet_is_v6_syn(), "test_packet_is_v6_syn");
    CALL_TEST(test_packet_is_v4_fin(), "test_packet_is_v4_fin");
    CALL_TEST(test_packet_is_v6_fin(), "test_packet_is_v6_fin");
    CALL_TEST(test_packet_is_v4_rst(), "test_packet_is_v4_rst");
    CALL_TEST(test_packet_is_v6_rst(), "test_packet_is_v6_rst");
    CALL_TEST(test_send_probe_packet(), "test_send_probe_packet");
    INIT_CALL_END(init_full(), test_tcp_closed_state_handle_6(), end_full(), "test_tcp_closed_state_handle_6");
    INIT_CALL_END(init_full(), test_tcp_closed_state_handle_4(), end_full(), "test_tcp_closed_state_handle_4");
    CALL_TEST(test_tcp_v4_init_state_handle(), "test_tcp_v4_init_state_handle");
    CALL_TEST(test_tcp_v6_init_state_handle(), "test_tcp_v6_init_state_handle");
    CALL_TEST(test_tcp_established_state_handle(), "test_tcp_established_state_handle");
    CALL_TEST(test_tcp_v4_fin_rcv_state_handle(), "test_tcp_v4_fin_rcv_state_handle");
    CALL_TEST(test_tcp_v6_fin_rcv_state_handle(), "test_tcp_v6_fin_rcv_state_handle");
    CALL_TEST(test_tcp_trans_state_handle(), "test_tcp_trans_state_handle");
    INIT_CALL_END(init_full(), test_tcp(), end_full(), "test_tcp");

	config_destroy();
    /* A non 0 return means a test failed; module can't be loaded. */
    END_TESTS;
}
Exemple #13
0
int init_module(void)
{
    START_TESTS("Pool");

    INIT_CALL_END(init(), test_get_any_function_udp(), destroy(), "Get simple-UDP");
    INIT_CALL_END(init(), test_get_any_function_tcp(), destroy(), "Get simple-TCP");
    INIT_CALL_END(init(), test_get_any_function_icmp(), destroy(), "Get simple-ICMP");
    INIT_CALL_END(init(), test_get_similar_function_udp(), destroy(), "Get similar-UDP");
    INIT_CALL_END(init(), test_get_similar_function_tcp(), destroy(), "Get similar-TCP");
    INIT_CALL_END(init(), test_get_similar_function_icmp(), destroy(), "Get similar-ICMP");
    INIT_CALL_END(init(), test_return_function(), destroy(), "Return function");

    END_TESTS;
}
Exemple #14
0
int init_module(void)
{
	START_TESTS("Session");

	INIT_CALL_END(init(), simple_session(), end(), "Single Session");
	INIT_CALL_END(init(), test_address_filtering(), end(), "Address-dependent filtering.");
	INIT_CALL_END(init(), test_compare_session4(), end(), "compare_session4()");

	INIT_CALL_END(init(), test_tcp_v4_init_state_handle_v6syn(), end(), "TCP-V4 INIT-V6 syn");
	INIT_CALL_END(init(), test_tcp_v4_init_state_handle_else(), end(), "TCP-V4 INIT-else");
	INIT_CALL_END(init(), test_tcp_v6_init_state_handle_v6syn(), end(), "TCP-V6 INIT-V6 SYN");
	INIT_CALL_END(init(), test_tcp_v6_init_state_handle_v4syn(), end(), "TCP-V6 INIT-V4 SYN");
	INIT_CALL_END(init(), test_tcp_v6_init_state_handle_else(), end(), "TCP-V6 INIT-else");
	INIT_CALL_END(init(), test_tcp_established_state_handle_v4fin(), end(), "TCP-established-V4 fin");
	INIT_CALL_END(init(), test_tcp_established_state_handle_v6fin(), end(), "TCP-established-V6 fin");
	INIT_CALL_END(init(), test_tcp_established_state_handle_v4rst(), end(), "TCP-established-V4 rst");
	INIT_CALL_END(init(), test_tcp_established_state_handle_v6rst(), end(), "TCP-established-V6 rst");
	INIT_CALL_END(init(), test_tcp_established_state_handle_else(), end(), "TCP-established-else");
	INIT_CALL_END(init(), test_tcp_v4_fin_rcv_state_handle_v6fin(), end(), "TCP-V4 FIN RCV-V6 fin");
	INIT_CALL_END(init(), test_tcp_v4_fin_rcv_state_handle_else(), end(), "TCP-V4 FIN RCV-else");
	INIT_CALL_END(init(), test_tcp_v6_fin_rcv_state_handle_v4fin(), end(), "TCP-V6 FIN RCV-v4fin");
	INIT_CALL_END(init(), test_tcp_v6_fin_rcv_state_handle_else(), end(), "TCP-V6 FIN RCV-else");
	INIT_CALL_END(init(), test_tcp_trans_state_handle_v6rst(), end(), "TCP-TRANS-V6 rst");
	INIT_CALL_END(init(), test_tcp_trans_state_handle_v4rst(), end(), "TCP-TRANS-V4 rst");
	INIT_CALL_END(init(), test_tcp_trans_state_handle_else(), end(), "TCP-TRANS-else");

	END_TESTS;
}