Skip to content

Commit

Permalink
Squash to "selftests/bpf: Add bpf scheduler test"
Browse files Browse the repository at this point in the history
Now ss_search() are only used by bpf_sched tests. It will be dropped
in next step.

Signed-off-by: Geliang Tang <tanggeliang@kylinos.cn>
  • Loading branch information
Geliang Tang authored and intel-lab-lkp committed Sep 3, 2024
1 parent 2b67ae5 commit 8584bbf
Showing 1 changed file with 7 additions and 1 deletion.
8 changes: 7 additions & 1 deletion tools/testing/selftests/bpf/prog_tests/mptcp.c
Original file line number Diff line number Diff line change
Expand Up @@ -487,9 +487,15 @@ static struct nstoken *sched_init(char *flags, char *sched)
return NULL;
}

static int ss_search(char *src, char *dst, char *port, char *keyword)
{
return SYS_NOFAIL("ip netns exec %s ss -enita src %s dst %s %s %d | grep -q '%s'",
NS_TEST, src, dst, port, PORT_1, keyword);
}

static int has_bytes_sent(char *dst)
{
return _ss_search(ADDR_1, dst, "sport", "bytes_sent:");
return ss_search(ADDR_1, dst, "sport", "bytes_sent:");
}

static void send_data_and_verify(char *sched, bool addr1, bool addr2)
Expand Down

0 comments on commit 8584bbf

Please sign in to comment.