diff options
author | Martin Willi <martin@strongswan.org> | 2006-05-31 14:23:15 +0000 |
---|---|---|
committer | Martin Willi <martin@strongswan.org> | 2006-05-31 14:23:15 +0000 |
commit | 32b6500fbfe063f3efb5589facd027f4c6cf08ed (patch) | |
tree | c434114b344ff3a134ebf245a6865ff2794da590 /src/charon/testing | |
parent | 6f2aba1322ce0061c56b9faeb979c236da926c3f (diff) | |
download | strongswan-32b6500fbfe063f3efb5589facd027f4c6cf08ed.tar.bz2 strongswan-32b6500fbfe063f3efb5589facd027f4c6cf08ed.tar.xz |
job management:
moved job code from thread_pool to job, jobs have an "execute" method now
added two new jobs: delete_child_sa & rekey_child_sa
kernel interface:
listens now for ACQUIRE & EXPIRE
supports hard and soft lifetimes
fires jobs for delete and rekey child sa
ike sa manager:
can checkout IKE SAs by requid of owned CHILD SAs
we have now the infrastructure to do the rekeying... :-)
Diffstat (limited to 'src/charon/testing')
-rw-r--r-- | src/charon/testing/Makefile.am | 1 | ||||
-rw-r--r-- | src/charon/testing/kernel_interface_test.c | 10 | ||||
-rw-r--r-- | src/charon/testing/testcases.c | 2 |
3 files changed, 10 insertions, 3 deletions
diff --git a/src/charon/testing/Makefile.am b/src/charon/testing/Makefile.am index 0957a7096..857ef067b 100644 --- a/src/charon/testing/Makefile.am +++ b/src/charon/testing/Makefile.am @@ -29,6 +29,7 @@ $(top_srcdir)/src/charon/ke_payload.o $(top_srcdir)/src/charon/unknown_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_child_sa_job.o $(top_srcdir)/src/charon/rekey_child_sa_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 \ diff --git a/src/charon/testing/kernel_interface_test.c b/src/charon/testing/kernel_interface_test.c index 86553e15e..cf01b0297 100644 --- a/src/charon/testing/kernel_interface_test.c +++ b/src/charon/testing/kernel_interface_test.c @@ -65,20 +65,26 @@ void test_kernel_interface(protected_tester_t *tester) status = kernel_interface->get_spi(kernel_interface, me, other, 50, 1234, &spi); tester->assert_true(tester, status == SUCCESS, "spi get"); - status = kernel_interface->add_sa(kernel_interface, me, other, spi, 50, 1234, ENCR_AES_CBC, enc_key,AUTH_UNDEFINED,inc_key,TRUE); + status = kernel_interface->add_sa(kernel_interface, me, other, spi, 50, 1234, 5, 10, ENCR_AES_CBC, enc_key,AUTH_UNDEFINED,inc_key,TRUE); tester->assert_true(tester, status == SUCCESS, "add sa"); left = host_create(AF_INET, "10.1.0.0", 0); right = host_create(AF_INET, "10.2.0.0", 0); status = kernel_interface->add_policy(kernel_interface, me, other, left, right, 16, 16, XFRM_POLICY_OUT, 0, TRUE, FALSE, 1234); - tester->assert_true(tester, status == SUCCESS, "add policy"); + tester->assert_true(tester, status == SUCCESS, "add policy OUT"); + status = kernel_interface->add_policy(kernel_interface, me, other, left, right, 16, 16, XFRM_POLICY_IN, 0, TRUE, FALSE, 1234); + tester->assert_true(tester, status == SUCCESS, "add policy IN"); + status = kernel_interface->add_policy(kernel_interface, me, other, left, right, 16, 16, XFRM_POLICY_FWD, 0, TRUE, FALSE, 1234); + tester->assert_true(tester, status == SUCCESS, "add policy FWD"); me->destroy(me); other->destroy(other); left->destroy(left); right->destroy(right); + sleep(15); + kernel_interface->destroy(kernel_interface); } diff --git a/src/charon/testing/testcases.c b/src/charon/testing/testcases.c index d91811e09..ebcc01b1a 100644 --- a/src/charon/testing/testcases.c +++ b/src/charon/testing/testcases.c @@ -252,7 +252,7 @@ int main() tester_t *tester = tester_create(test_output, FALSE); //tester->perform_tests(tester,all_tests); - tester->perform_test(tester,&policy_test); + tester->perform_test(tester,&kernel_interface_test); tester->destroy(tester); |