- included charons module tests to build & dist
This commit is contained in:
parent
6d5e617f7d
commit
0773bdcf3f
|
@ -141,6 +141,7 @@ AC_OUTPUT(
|
||||||
src/pluto/Makefile
|
src/pluto/Makefile
|
||||||
src/whack/Makefile
|
src/whack/Makefile
|
||||||
src/charon/Makefile
|
src/charon/Makefile
|
||||||
|
src/charon/testing/Makefile
|
||||||
src/stroke/Makefile
|
src/stroke/Makefile
|
||||||
src/ipsec/Makefile
|
src/ipsec/Makefile
|
||||||
src/starter/Makefile
|
src/starter/Makefile
|
||||||
|
|
|
@ -0,0 +1,35 @@
|
||||||
|
noinst_PROGRAMS = testing
|
||||||
|
INCLUDES = -I$(top_srcdir)/src/libstrongswan -I$(top_srcdir)/src/charon -I$(top_srcdir)/src/stroke
|
||||||
|
|
||||||
|
testing_SOURCES = \
|
||||||
|
thread_pool_test.c policy_test.c prf_plus_test.h testcases.c ike_sa_manager_test.c \
|
||||||
|
linked_list_test.c send_queue_test.h policy_test.h encryption_payload_test.c thread_pool_test.h \
|
||||||
|
child_sa_test.c linked_list_test.h packet_test.c child_sa_test.h encryption_payload_test.h packet_test.h \
|
||||||
|
diffie_hellman_test.c event_queue_test.c event_queue_test.h socket_test.c Makefile.am identification_test.c \
|
||||||
|
ike_sa_manager_test.h ike_sa_test.c diffie_hellman_test.h parser_test.c socket_test.h identification_test.h \
|
||||||
|
connection_test.c proposal_test.c ike_sa_test.h kernel_interface_test.c parser_test.h connection_test.h \
|
||||||
|
proposal_test.h kernel_interface_test.h ike_sa_id_test.c hmac_test.c leak_detective_test.c hasher_test.c \
|
||||||
|
ike_sa_id_test.h hmac_test.h leak_detective_test.h job_queue_test.c scheduler_test.c hmac_signer_test.c \
|
||||||
|
hasher_test.h sender_test.c certificate_test.c job_queue_test.h scheduler_test.h hmac_signer_test.h \
|
||||||
|
rsa_test.c sender_test.h generator_test.c aes_cbc_crypter_test.c certificate_test.h prf_plus_test.c \
|
||||||
|
rsa_test.h generator_test.h aes_cbc_crypter_test.h send_queue_test.c
|
||||||
|
|
||||||
|
testing_LDADD = $(top_builddir)/src/libstrongswan/libstrongswan.la -lgmp -lpthread \
|
||||||
|
$(top_srcdir)/src/charon/connection.o $(top_srcdir)/src/charon/local_connection_store.o $(top_srcdir)/src/charon/policy.o \
|
||||||
|
$(top_srcdir)/src/charon/local_policy_store.o $(top_srcdir)/src/charon/local_credential_store.o $(top_srcdir)/src/charon/traffic_selector.o \
|
||||||
|
$(top_srcdir)/src/charon/proposal.o $(top_srcdir)/src/charon/configuration.o $(top_srcdir)/src/charon/state.o $(top_srcdir)/src/charon/ike_sa_init_requested.o \
|
||||||
|
$(top_srcdir)/src/charon/ike_sa_init_responded.o $(top_srcdir)/src/charon/ike_sa_established.o $(top_srcdir)/src/charon/responder_init.o \
|
||||||
|
$(top_srcdir)/src/charon/initiator_init.o $(top_srcdir)/src/charon/ike_auth_requested.o $(top_srcdir)/src/charon/delete_requested.o \
|
||||||
|
$(top_srcdir)/src/charon/child_sa.o $(top_srcdir)/src/charon/ike_sa.o $(top_srcdir)/src/charon/ike_sa_manager.o $(top_srcdir)/src/charon/ike_sa_id.o \
|
||||||
|
$(top_srcdir)/src/charon/authenticator.o $(top_srcdir)/src/charon/encryption_payload.o $(top_srcdir)/src/charon/cert_payload.o \
|
||||||
|
$(top_srcdir)/src/charon/traffic_selector_substructure.o $(top_srcdir)/src/charon/transform_attribute.o $(top_srcdir)/src/charon/configuration_attribute.o \
|
||||||
|
$(top_srcdir)/src/charon/transform_substructure.o $(top_srcdir)/src/charon/auth_payload.o $(top_srcdir)/src/charon/ike_header.o $(top_srcdir)/src/charon/nonce_payload.o \
|
||||||
|
$(top_srcdir)/src/charon/eap_payload.o $(top_srcdir)/src/charon/ts_payload.o $(top_srcdir)/src/charon/notify_payload.o $(top_srcdir)/src/charon/id_payload.o \
|
||||||
|
$(top_srcdir)/src/charon/ke_payload.o $(top_srcdir)/src/charon/unknown_payload.o $(top_srcdir)/src/charon/encodings.o $(top_srcdir)/src/charon/cp_payload.o \
|
||||||
|
$(top_srcdir)/src/charon/delete_payload.o $(top_srcdir)/src/charon/sa_payload.o $(top_srcdir)/src/charon/certreq_payload.o $(top_srcdir)/src/charon/vendor_id_payload.o \
|
||||||
|
$(top_srcdir)/src/charon/proposal_substructure.o $(top_srcdir)/src/charon/payload.o $(top_srcdir)/src/charon/message.o $(top_srcdir)/src/charon/generator.o \
|
||||||
|
$(top_srcdir)/src/charon/parser.o $(top_srcdir)/src/charon/packet.o $(top_srcdir)/src/charon/socket.o $(top_srcdir)/src/charon/job.o \
|
||||||
|
$(top_srcdir)/src/charon/delete_established_ike_sa_job.o $(top_srcdir)/src/charon/incoming_packet_job.o $(top_srcdir)/src/charon/delete_half_open_ike_sa_job.o \
|
||||||
|
$(top_srcdir)/src/charon/retransmit_request_job.o $(top_srcdir)/src/charon/initiate_ike_sa_job.o $(top_srcdir)/src/charon/job_queue.o $(top_srcdir)/src/charon/event_queue.o \
|
||||||
|
$(top_srcdir)/src/charon/send_queue.o $(top_srcdir)/src/charon/kernel_interface.o $(top_srcdir)/src/charon/thread_pool.o $(top_srcdir)/src/charon/scheduler.o \
|
||||||
|
$(top_srcdir)/src/charon/sender.o $(top_srcdir)/src/charon/receiver.o $(top_srcdir)/src/charon/stroke_interface.o
|
|
@ -33,9 +33,7 @@ void test_connection(protected_tester_t *tester)
|
||||||
{
|
{
|
||||||
host_t *alice = host_create(AF_INET, "192.168.0.1", 500);
|
host_t *alice = host_create(AF_INET, "192.168.0.1", 500);
|
||||||
host_t *bob = host_create(AF_INET, "192.168.0.2", 500);
|
host_t *bob = host_create(AF_INET, "192.168.0.2", 500);
|
||||||
identification_t *alice_id = identification_create_from_string("192.168.0.1");
|
connection_t *connection = connection_create("alice-bob", TRUE, alice, bob, RSA_DIGITAL_SIGNATURE);
|
||||||
identification_t *bob_id = identification_create_from_string("192.168.0.2");
|
|
||||||
connection_t *connection = connection_create(alice, bob, alice_id, bob_id, RSA_DIGITAL_SIGNATURE);
|
|
||||||
proposal_t *prop1, *prop2, *prop3, *prop4;
|
proposal_t *prop1, *prop2, *prop3, *prop4;
|
||||||
linked_list_t *list;
|
linked_list_t *list;
|
||||||
|
|
||||||
|
|
|
@ -976,7 +976,7 @@ void test_generator_with_auth_payload(protected_tester_t *tester)
|
||||||
generator = generator_create();
|
generator = generator_create();
|
||||||
tester->assert_true(tester,(generator != NULL), "generator create check");
|
tester->assert_true(tester,(generator != NULL), "generator create check");
|
||||||
|
|
||||||
auth_payload = auth_payload_create(FALSE);
|
auth_payload = auth_payload_create();
|
||||||
|
|
||||||
|
|
||||||
auth.ptr = "123456789012";
|
auth.ptr = "123456789012";
|
||||||
|
|
|
@ -48,7 +48,7 @@ void test_policy(protected_tester_t *tester)
|
||||||
|
|
||||||
alice = identification_create_from_string("152.96.193.131");
|
alice = identification_create_from_string("152.96.193.131");
|
||||||
bob = identification_create_from_string("152.96.193.130");
|
bob = identification_create_from_string("152.96.193.130");
|
||||||
policy = policy_create(alice, bob);
|
policy = policy_create("test", alice, bob);
|
||||||
|
|
||||||
tester->assert_true(tester, (policy != NULL), "policy construction");
|
tester->assert_true(tester, (policy != NULL), "policy construction");
|
||||||
|
|
||||||
|
|
|
@ -205,7 +205,7 @@ void test_rsa(protected_tester_t *tester)
|
||||||
/* key loading */
|
/* key loading */
|
||||||
private_key = rsa_private_key_create_from_file("alice.der", NULL);
|
private_key = rsa_private_key_create_from_file("alice.der", NULL);
|
||||||
tester->assert_true(tester, private_key != NULL, "loading private key from file");
|
tester->assert_true(tester, private_key != NULL, "loading private key from file");
|
||||||
certificate = x509_create_from_file("alice-cert.der");
|
certificate = x509_create_from_file("alice-cert.der", "testcert");
|
||||||
tester->assert_true(tester, public_key != NULL, "loading certificate from file");
|
tester->assert_true(tester, public_key != NULL, "loading certificate from file");
|
||||||
public_key = certificate->get_public_key(certificate);
|
public_key = certificate->get_public_key(certificate);
|
||||||
tester->assert_true(tester, public_key != NULL, "loading public key from certificate");
|
tester->assert_true(tester, public_key != NULL, "loading public key from certificate");
|
||||||
|
|
|
@ -67,7 +67,7 @@ static void test_send_queue_sender(send_queue_test_t * testinfo)
|
||||||
int i;
|
int i;
|
||||||
for (i = 0; i < testinfo->insert_item_count; i++)
|
for (i = 0; i < testinfo->insert_item_count; i++)
|
||||||
{
|
{
|
||||||
packet_t *packet = packet_create(AF_INET);
|
packet_t *packet = packet_create();
|
||||||
testinfo->tester->assert_true(testinfo->tester,(packet != NULL), "create packet call check");
|
testinfo->tester->assert_true(testinfo->tester,(packet != NULL), "create packet call check");
|
||||||
testinfo->send_queue->add(testinfo->send_queue,packet);
|
testinfo->send_queue->add(testinfo->send_queue,packet);
|
||||||
}
|
}
|
||||||
|
|
|
@ -64,7 +64,7 @@ void test_sender(protected_tester_t *tester)
|
||||||
|
|
||||||
for (i = 0; i < NUMBER_OF_PACKETS_TO_SEND; i++)
|
for (i = 0; i < NUMBER_OF_PACKETS_TO_SEND; i++)
|
||||||
{
|
{
|
||||||
packet = packet_create(AF_INET);
|
packet = packet_create();
|
||||||
packet->set_destination(packet, host_create(AF_INET, "127.0.0.1", 500));
|
packet->set_destination(packet, host_create(AF_INET, "127.0.0.1", 500));
|
||||||
packet->set_source(packet, host_create(AF_INET, "127.0.0.1", 500));
|
packet->set_source(packet, host_create(AF_INET, "127.0.0.1", 500));
|
||||||
packet->set_data(packet, chunk_clone(data));
|
packet->set_data(packet, chunk_clone(data));
|
||||||
|
|
|
@ -36,7 +36,7 @@ void test_socket(protected_tester_t *tester)
|
||||||
int packet_count = 10;
|
int packet_count = 10;
|
||||||
int current;
|
int current;
|
||||||
socket_t *skt = socket_create(500);
|
socket_t *skt = socket_create(500);
|
||||||
packet_t *pkt = packet_create(AF_INET);
|
packet_t *pkt = packet_create();
|
||||||
char test_data[] = {
|
char test_data[] = {
|
||||||
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x03, /* spi */
|
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x03, /* spi */
|
||||||
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x05, /* spi */
|
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x05, /* spi */
|
||||||
|
|
|
@ -251,8 +251,8 @@ int main()
|
||||||
|
|
||||||
tester_t *tester = tester_create(test_output, FALSE);
|
tester_t *tester = tester_create(test_output, FALSE);
|
||||||
|
|
||||||
tester->perform_tests(tester,all_tests);
|
//tester->perform_tests(tester,all_tests);
|
||||||
//tester->perform_test(tester,&sender_test);
|
tester->perform_test(tester,&policy_test);
|
||||||
|
|
||||||
|
|
||||||
tester->destroy(tester);
|
tester->destroy(tester);
|
||||||
|
|
Loading…
Reference in New Issue