diff options
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); |