Skip to content

Fix a repeat-run failure in setsockopt10#1330

Open
Gaojuxin09 wants to merge 1 commit into
linux-test-project:masterfrom
Gaojuxin09:fix-setsockopt10-dynamic-ports
Open

Fix a repeat-run failure in setsockopt10#1330
Gaojuxin09 wants to merge 1 commit into
linux-test-project:masterfrom
Gaojuxin09:fix-setsockopt10-dynamic-ports

Conversation

@Gaojuxin09

Copy link
Copy Markdown

Fix a repeat-run failure in setsockopt10.

setsockopt10 is listed in both runtest/syscalls and runtest/cve, so a
full run or runltp -s setsockopt10 executes the same binary twice in
quick succession. The test currently binds fixed localhost ports
0x7c90/0x7c91, and the second execution can fail while the previous
connection is still in TIME_WAIT:

  address is in use, waited  10 sec
  TBROK: tst_checkpoint_wait(0, 10000) failed: ETIMEDOUT

Use TST_GET_UNUSED_PORT() for both test sockets to avoid depending on
immediate reuse of fixed ports.

Validation:

  • git diff --check
  • make -C testcases/kernel/syscalls/setsockopt setsockopt10
  • LoongArch/openEuler 6.6: ./runltp -s setsockopt10 -p -q passes both matched entries

setsockopt10 is listed both in runtest/syscalls and runtest/cve. Running the full suite, or running "runltp -s setsockopt10", executes the same test twice in quick succession.

The test currently binds fixed localhost ports 0x7c90 and 0x7c91. The second execution can then fail while the first execution's connection is still in TIME_WAIT:

    address is in use, waited  10 sec
    TBROK: tst_checkpoint_wait(0, 10000) failed: ETIMEDOUT

Use TST_GET_UNUSED_PORT() for both local TCP sockets so repeated or nearby executions do not depend on fixed ports being immediately reusable.

Signed-off-by: Juxin Gao <gaojuxin@loongson.cn>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant