Skip to content

unit-test-client: The test fails in environments where networking is not available #802

@artyom-poptsov

Description

@artyom-poptsov

The change that was introduced in 6ae4a76 leads to test errors in environments where networking is not available (e.g. in GNU Guix build environment):

    // Invalid in TCP or RTU mode...
    modbus_t *invalid_ctx = modbus_new_tcp("1.2.3.4", 1502);
    modbus_set_response_timeout(ctx, 0, 1);
    rc = modbus_connect(invalid_ctx);
    printf("8/8 Connection timeout: ");
    ASSERT_TRUE(rc == -1 && errno == ETIMEDOUT, "");
    modbus_free(invalid_ctx);

Assertion fails due to errno being equal to 101 (ENETUNREACH) instead of 110 (ETIMEDOUT)

Currently I solved this problem by removing the code I mentioned above with a patch, but maybe we should add an option that disables such tests?

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions