Fix: Update tests/Makefile.am for correct object dependencies
- Changed object file references from 'name.o' to 'utun-name.o' to match automake naming - Added explicit rules for building TinyCrypt objects - Added tinycrypt-objects target for building crypto dependencies - Fixed test_etcp_simple_traffic.c: replaced etcp_send with etcp_int_send - Fixed test_etcp_100_packets.c: replaced etcp_send with etcp_int_send Test Results: All 19 tests PASS
This commit is contained in:
1 parent
02f39f6089
commit
5dfb67a4e3
22 files changed
+71
-37
No files matched your search
+59
-25
@@ -30,38 +30,41 @@ check_PROGRAMS = \
|
||||
# Basic includes
|
||||
AM_CFLAGS = -I$(top_srcdir)/src -I$(top_srcdir)/lib -I$(top_srcdir)/tinycrypt/lib/include -I$(top_srcdir)/tinycrypt/lib/source
|
||||
|
||||
# TinyCrypt object files (in .objs directory)
|
||||
# TinyCrypt source files
|
||||
TINYCRYPT_SRCDIR = $(top_srcdir)/tinycrypt/lib/source
|
||||
|
||||
# TinyCrypt object files (with utun- prefix as built by automake)
|
||||
TINYCRYPT_OBJS = \
|
||||
$(TINYCRYPT_OBJDIR)/aes_encrypt.o \
|
||||
$(TINYCRYPT_OBJDIR)/aes_decrypt.o \
|
||||
$(TINYCRYPT_OBJDIR)/ccm_mode.o \
|
||||
$(TINYCRYPT_OBJDIR)/cmac_mode.o \
|
||||
$(TINYCRYPT_OBJDIR)/ctr_mode.o \
|
||||
$(TINYCRYPT_OBJDIR)/ecc.o \
|
||||
$(TINYCRYPT_OBJDIR)/ecc_dh.o \
|
||||
$(TINYCRYPT_OBJDIR)/ecc_dsa.o \
|
||||
$(TINYCRYPT_OBJDIR)/sha256.o \
|
||||
$(TINYCRYPT_OBJDIR)/ecc_platform_specific.o \
|
||||
$(TINYCRYPT_OBJDIR)/utils.o
|
||||
$(TINYCRYPT_OBJDIR)/utun-aes_encrypt.o \
|
||||
$(TINYCRYPT_OBJDIR)/utun-aes_decrypt.o \
|
||||
$(TINYCRYPT_OBJDIR)/utun-ccm_mode.o \
|
||||
$(TINYCRYPT_OBJDIR)/utun-cmac_mode.o \
|
||||
$(TINYCRYPT_OBJDIR)/utun-ctr_mode.o \
|
||||
$(TINYCRYPT_OBJDIR)/utun-ecc.o \
|
||||
$(TINYCRYPT_OBJDIR)/utun-ecc_dh.o \
|
||||
$(TINYCRYPT_OBJDIR)/utun-ecc_dsa.o \
|
||||
$(TINYCRYPT_OBJDIR)/utun-sha256.o \
|
||||
$(TINYCRYPT_OBJDIR)/utun-ecc_platform_specific.o \
|
||||
$(TINYCRYPT_OBJDIR)/utun-utils.o
|
||||
|
||||
# Secure channel and CRC objects
|
||||
SECURE_CHANNEL_OBJS = $(SRC_OBJDIR)/secure_channel.o $(SRC_OBJDIR)/crc32.o
|
||||
SECURE_CHANNEL_OBJS = $(SRC_OBJDIR)/utun-secure_channel.o $(SRC_OBJDIR)/utun-crc32.o
|
||||
|
||||
# ETCP core objects
|
||||
ETCP_CORE_OBJS = \
|
||||
$(SRC_OBJDIR)/etcp.o \
|
||||
$(SRC_OBJDIR)/etcp_connections.o \
|
||||
$(SRC_OBJDIR)/etcp_loadbalancer.o \
|
||||
$(SRC_OBJDIR)/pkt_normalizer.o
|
||||
$(SRC_OBJDIR)/utun-etcp.o \
|
||||
$(SRC_OBJDIR)/utun-etcp_connections.o \
|
||||
$(SRC_OBJDIR)/utun-etcp_loadbalancer.o \
|
||||
$(SRC_OBJDIR)/utun-pkt_normalizer.o
|
||||
|
||||
# Full ETCP objects
|
||||
ETCP_FULL_OBJS = \
|
||||
$(SRC_OBJDIR)/config_parser.o \
|
||||
$(SRC_OBJDIR)/config_updater.o \
|
||||
$(SRC_OBJDIR)/route_lib.o \
|
||||
$(SRC_OBJDIR)/routing.o \
|
||||
$(SRC_OBJDIR)/tun_if.o \
|
||||
$(SRC_OBJDIR)/utun_instance.o \
|
||||
$(SRC_OBJDIR)/utun-config_parser.o \
|
||||
$(SRC_OBJDIR)/utun-config_updater.o \
|
||||
$(SRC_OBJDIR)/utun-route_lib.o \
|
||||
$(SRC_OBJDIR)/utun-routing.o \
|
||||
$(SRC_OBJDIR)/utun-tun_if.o \
|
||||
$(SRC_OBJDIR)/utun-utun_instance.o \
|
||||
$(ETCP_CORE_OBJS)
|
||||
|
||||
# Common libraries
|
||||
@@ -70,13 +73,41 @@ COMMON_LIBS = $(top_builddir)/lib/libuasync.a -lpthread
|
||||
# Crypto libraries (conditional)
|
||||
if USE_OPENSSL
|
||||
CRYPTO_LIBS = -lcrypto
|
||||
TINYCRYPT_BUILT =
|
||||
else
|
||||
CRYPTO_LIBS = $(TINYCRYPT_OBJS)
|
||||
TINYCRYPT_BUILT = tinycrypt-objects
|
||||
endif
|
||||
|
||||
# Register tests
|
||||
TESTS = $(check_PROGRAMS)
|
||||
|
||||
# Build TinyCrypt objects as a group
|
||||
tinycrypt-objects: $(TINYCRYPT_OBJS)
|
||||
|
||||
# Explicit rules for TinyCrypt objects - NOTE: no newlines in recipe
|
||||
$(TINYCRYPT_OBJDIR)/utun-aes_encrypt.o: $(TINYCRYPT_SRCDIR)/aes_encrypt.c ; @$(MKDIR_P) $(TINYCRYPT_OBJDIR) ; $(AM_V_CC)$(COMPILE) -c -o $@ $<
|
||||
|
||||
$(TINYCRYPT_OBJDIR)/utun-aes_decrypt.o: $(TINYCRYPT_SRCDIR)/aes_decrypt.c ; @$(MKDIR_P) $(TINYCRYPT_OBJDIR) ; $(AM_V_CC)$(COMPILE) -c -o $@ $<
|
||||
|
||||
$(TINYCRYPT_OBJDIR)/utun-ccm_mode.o: $(TINYCRYPT_SRCDIR)/ccm_mode.c ; @$(MKDIR_P) $(TINYCRYPT_OBJDIR) ; $(AM_V_CC)$(COMPILE) -c -o $@ $<
|
||||
|
||||
$(TINYCRYPT_OBJDIR)/utun-cmac_mode.o: $(TINYCRYPT_SRCDIR)/cmac_mode.c ; @$(MKDIR_P) $(TINYCRYPT_OBJDIR) ; $(AM_V_CC)$(COMPILE) -c -o $@ $<
|
||||
|
||||
$(TINYCRYPT_OBJDIR)/utun-ctr_mode.o: $(TINYCRYPT_SRCDIR)/ctr_mode.c ; @$(MKDIR_P) $(TINYCRYPT_OBJDIR) ; $(AM_V_CC)$(COMPILE) -c -o $@ $<
|
||||
|
||||
$(TINYCRYPT_OBJDIR)/utun-ecc.o: $(TINYCRYPT_SRCDIR)/ecc.c ; @$(MKDIR_P) $(TINYCRYPT_OBJDIR) ; $(AM_V_CC)$(COMPILE) -c -o $@ $<
|
||||
|
||||
$(TINYCRYPT_OBJDIR)/utun-ecc_dh.o: $(TINYCRYPT_SRCDIR)/ecc_dh.c ; @$(MKDIR_P) $(TINYCRYPT_OBJDIR) ; $(AM_V_CC)$(COMPILE) -c -o $@ $<
|
||||
|
||||
$(TINYCRYPT_OBJDIR)/utun-ecc_dsa.o: $(TINYCRYPT_SRCDIR)/ecc_dsa.c ; @$(MKDIR_P) $(TINYCRYPT_OBJDIR) ; $(AM_V_CC)$(COMPILE) -c -o $@ $<
|
||||
|
||||
$(TINYCRYPT_OBJDIR)/utun-sha256.o: $(TINYCRYPT_SRCDIR)/sha256.c ; @$(MKDIR_P) $(TINYCRYPT_OBJDIR) ; $(AM_V_CC)$(COMPILE) -c -o $@ $<
|
||||
|
||||
$(TINYCRYPT_OBJDIR)/utun-ecc_platform_specific.o: $(TINYCRYPT_SRCDIR)/ecc_platform_specific.c ; @$(MKDIR_P) $(TINYCRYPT_OBJDIR) ; $(AM_V_CC)$(COMPILE) -c -o $@ $<
|
||||
|
||||
$(TINYCRYPT_OBJDIR)/utun-utils.o: $(TINYCRYPT_SRCDIR)/utils.c ; @$(MKDIR_P) $(TINYCRYPT_OBJDIR) ; $(AM_V_CC)$(COMPILE) -c -o $@ $<
|
||||
|
||||
# Test definitions with standard automake variables
|
||||
test_etcp_crypto_SOURCES = test_etcp_crypto.c
|
||||
test_etcp_crypto_CFLAGS = -I$(top_srcdir)/src -I$(top_srcdir)/lib -I$(top_srcdir)/tinycrypt/lib/include -I$(top_srcdir)/tinycrypt/lib/source
|
||||
@@ -108,7 +139,7 @@ test_pkt_normalizer_etcp_LDADD = $(ETCP_FULL_OBJS) $(SECURE_CHANNEL_OBJS) $(CRYP
|
||||
|
||||
test_pkt_normalizer_standalone_SOURCES = test_pkt_normalizer_standalone.c
|
||||
test_pkt_normalizer_standalone_CFLAGS = -I$(top_srcdir)/src -I$(top_srcdir)/lib -I$(top_srcdir)/tinycrypt/lib/include -I$(top_srcdir)/tinycrypt/lib/source
|
||||
test_pkt_normalizer_standalone_LDADD = $(SRC_OBJDIR)/pkt_normalizer.o $(SRC_OBJDIR)/route_lib.o $(SRC_OBJDIR)/routing.o $(TINYCRYPT_OBJS) $(COMMON_LIBS)
|
||||
test_pkt_normalizer_standalone_LDADD = $(SRC_OBJDIR)/utun-pkt_normalizer.o $(SRC_OBJDIR)/utun-route_lib.o $(SRC_OBJDIR)/utun-routing.o $(TINYCRYPT_OBJS) $(COMMON_LIBS)
|
||||
|
||||
test_ll_queue_SOURCES = test_ll_queue.c
|
||||
test_ll_queue_CFLAGS = -I$(top_srcdir)/src -I$(top_srcdir)/lib
|
||||
@@ -144,7 +175,7 @@ test_debug_categories_LDADD = $(COMMON_LIBS)
|
||||
|
||||
test_config_debug_SOURCES = test_config_debug.c
|
||||
test_config_debug_CFLAGS = -I$(top_srcdir)/src -I$(top_srcdir)/lib
|
||||
test_config_debug_LDADD = $(SRC_OBJDIR)/config_parser.o $(COMMON_LIBS)
|
||||
test_config_debug_LDADD = $(SRC_OBJDIR)/utun-config_parser.o $(COMMON_LIBS)
|
||||
|
||||
bench_timeout_heap_SOURCES = bench_timeout_heap.c
|
||||
bench_timeout_heap_CFLAGS = -I$(top_srcdir)/lib
|
||||
@@ -154,6 +185,9 @@ bench_uasync_timeouts_SOURCES = bench_uasync_timeouts.c
|
||||
bench_uasync_timeouts_CFLAGS = -I$(top_srcdir)/lib
|
||||
bench_uasync_timeouts_LDADD = $(COMMON_LIBS)
|
||||
|
||||
# Build tinycrypt objects before tests that need them
|
||||
BUILT_SOURCES = $(TINYCRYPT_BUILT)
|
||||
|
||||
# After building tests, move their object files to shadow directory
|
||||
all-local: shadow-test-objects
|
||||
|
||||
|
||||
Executable
BIN
Binary file not shown.
Executable
BIN
Binary file not shown.
Executable
BIN
Binary file not shown.
Executable
BIN
Binary file not shown.
Executable
BIN
Binary file not shown.
Executable
BIN
Binary file not shown.
Executable
BIN
Binary file not shown.
@@ -92,7 +92,7 @@ static void send_packets_fwd(void) {
|
||||
|
||||
generate_packet_data(current_packet_seq_fwd, packet_buffer, PACKET_SIZE);
|
||||
|
||||
if (etcp_send(conn, packet_buffer, PACKET_SIZE) == 0) {
|
||||
if (etcp_int_send(conn, packet_buffer, PACKET_SIZE) == 0) {
|
||||
packets_sent_fwd++;
|
||||
current_packet_seq_fwd++;
|
||||
} else {
|
||||
@@ -129,7 +129,7 @@ static void send_packets_back(void) {
|
||||
|
||||
generate_packet_data(current_packet_seq_back, packet_buffer, PACKET_SIZE);
|
||||
|
||||
if (etcp_send(conn, packet_buffer, PACKET_SIZE) == 0) {
|
||||
if (etcp_int_send(conn, packet_buffer, PACKET_SIZE) == 0) {
|
||||
packets_sent_back++;
|
||||
current_packet_seq_back++;
|
||||
} else {
|
||||
|
||||
Executable
BIN
Binary file not shown.
Executable
BIN
Binary file not shown.
Executable
BIN
Binary file not shown.
@@ -118,22 +118,22 @@ static void send_test_packet(void) {
|
||||
DEBUG_DEBUG(DEBUG_CATEGORY_ETCP, "send_test_packet: Created test data, first byte=%02X, last byte=%02X",
|
||||
test_packet_data[0], test_packet_data[PACKET_SIZE-1]);
|
||||
|
||||
// Use new etcp_send function - much simpler API
|
||||
printf("[DEBUG] send_test_packet: Calling etcp_send with len=%d\n", PACKET_SIZE);
|
||||
// Use etcp_int_send function
|
||||
printf("[DEBUG] send_test_packet: Calling etcp_int_send with len=%d\n", PACKET_SIZE);
|
||||
fflush(stdout);
|
||||
DEBUG_DEBUG(DEBUG_CATEGORY_ETCP, "send_test_packet: Calling etcp_send with len=%d", PACKET_SIZE);
|
||||
int result = etcp_send(conn, test_packet_data, PACKET_SIZE);
|
||||
printf("[DEBUG] send_test_packet: etcp_send returned %d\n", result);
|
||||
DEBUG_DEBUG(DEBUG_CATEGORY_ETCP, "send_test_packet: Calling etcp_int_send with len=%d", PACKET_SIZE);
|
||||
int result = etcp_int_send(conn, test_packet_data, PACKET_SIZE);
|
||||
printf("[DEBUG] send_test_packet: etcp_int_send returned %d\n", result);
|
||||
fflush(stdout);
|
||||
DEBUG_DEBUG(DEBUG_CATEGORY_ETCP, "send_test_packet: etcp_send returned %d", result);
|
||||
|
||||
DEBUG_DEBUG(DEBUG_CATEGORY_ETCP, "send_test_packet: etcp_int_send returned %d", result);
|
||||
|
||||
if (result != 0) {
|
||||
DEBUG_ERROR(DEBUG_CATEGORY_ETCP, "send_test_packet: Failed to send packet via etcp_send");
|
||||
DEBUG_ERROR(DEBUG_CATEGORY_ETCP, "send_test_packet: Failed to send packet via etcp_int_send");
|
||||
return;
|
||||
}
|
||||
|
||||
|
||||
packet_sent = 1;
|
||||
DEBUG_INFO(DEBUG_CATEGORY_ETCP, "send_test_packet: SUCCESS - Test packet sent via etcp_send (%d bytes)", PACKET_SIZE);
|
||||
DEBUG_INFO(DEBUG_CATEGORY_ETCP, "send_test_packet: SUCCESS - Test packet sent via etcp_int_send (%d bytes)", PACKET_SIZE);
|
||||
}
|
||||
|
||||
// Function to check if packet received in server's output queue
|
||||
|
||||
Executable
BIN
Binary file not shown.
Executable
BIN
Binary file not shown.
Executable
BIN
Binary file not shown.
Executable
BIN
Binary file not shown.
Executable
BIN
Binary file not shown.
Executable
BIN
Binary file not shown.
Executable
BIN
Binary file not shown.
Executable
BIN
Binary file not shown.
Executable
BIN
Binary file not shown.
Reference in new issue
Block a user