From 23ada5c7a5545deb496b3ac83c92dc19d26a7579 Mon Sep 17 00:00:00 2001 From: "Sergio R. Caprile" Date: Thu, 3 Oct 2024 13:46:50 -0300 Subject: [PATCH] try to get abort texts from GH --- test/mip_tap_test.c | 13 +++++++++---- 1 file changed, 9 insertions(+), 4 deletions(-) diff --git a/test/mip_tap_test.c b/test/mip_tap_test.c index d497e838..01d71cda 100644 --- a/test/mip_tap_test.c +++ b/test/mip_tap_test.c @@ -66,13 +66,16 @@ static const char *s_ca_cert = static int s_num_tests = 0; +#define ABORT() \ + usleep(500000); /* 500 ms, GH print reason */ \ + abort(); + #define ASSERT(expr) \ do { \ s_num_tests++; \ if (!(expr)) { \ printf("FAILURE %s:%d: %s\n", __FILE__, __LINE__, #expr); \ - usleep(500000); /* 500 ms, GH print reason */ \ - abort(); \ + ABORT(); \ } \ } while (0) @@ -317,18 +320,19 @@ int main(void) { ifr.ifr_flags = IFF_TAP | IFF_NO_PI; if (ioctl(fd, TUNSETIFF, (void *) &ifr) < 0) { MG_ERROR(("Failed to setup TAP interface: %s", ifr.ifr_name)); - abort(); // return EXIT_FAILURE; + ABORT(); // return EXIT_FAILURE; } #else ifr.ifr_flags = (short) (IFF_UP | IFF_BROADCAST | IFF_MULTICAST); if (ioctl(fd, TUNSIFMODE, (void *) &ifr) < 0) { MG_ERROR(("Failed to setup TAP interface: %s", ifr.ifr_name)); - abort(); // return EXIT_FAILURE; + ABORT(); // return EXIT_FAILURE; } #endif fcntl(fd, F_SETFL, fcntl(fd, F_GETFL, 0) | O_NONBLOCK); // Non-blocking mode MG_INFO(("Opened TAP interface: %s", iface)); + usleep(200000); // 200 ms // Events struct mg_mgr mgr; // Event manager @@ -361,6 +365,7 @@ int main(void) { mg_tcpip_init(&mgr, &mif); MG_INFO(("Init done, starting main loop")); + usleep(200000); // 200 ms // Stack initialization, Network configuration (DHCP lease, ...) #if MIPTAPTEST_USING_DHCP == 0