Skip to content

Commit

Permalink
try to get abort texts from GH
Browse files Browse the repository at this point in the history
  • Loading branch information
scaprile committed Oct 3, 2024
1 parent 97c37ef commit 23ada5c
Showing 1 changed file with 9 additions and 4 deletions.
13 changes: 9 additions & 4 deletions test/mip_tap_test.c
Original file line number Diff line number Diff line change
Expand Up @@ -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)

Expand Down Expand Up @@ -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
Expand Down Expand Up @@ -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
Expand Down

0 comments on commit 23ada5c

Please sign in to comment.