On Sun, Jul 4, 2021 at 12:05 PM Cong Wang <xiyou.wangcong@xxxxxxxxx> wrote: > > From: Cong Wang <cong.wang@xxxxxxxxxxxxx> > > Add two test cases to ensure redirection between udp and unix > work bidirectionally. > > Cc: John Fastabend <john.fastabend@xxxxxxxxx> > Cc: Daniel Borkmann <daniel@xxxxxxxxxxxxx> > Cc: Jakub Sitnicki <jakub@xxxxxxxxxxxxxx> > Cc: Lorenz Bauer <lmb@xxxxxxxxxxxxxx> > Signed-off-by: Cong Wang <cong.wang@xxxxxxxxxxxxx> > --- > .../selftests/bpf/prog_tests/sockmap_listen.c | 170 ++++++++++++++++++ > 1 file changed, 170 insertions(+) > [...] > + n = write(c1, "a", 1); > + if (n < 0) > + FAIL_ERRNO("%s: write", log_prefix); > + if (n == 0) > + FAIL("%s: incomplete write", log_prefix); > + if (n < 1) > + goto close; > + > + key = SK_PASS; > + err = xbpf_map_lookup_elem(verd_mapfd, &key, &pass); > + if (err) > + goto close; > + if (pass != 1) > + FAIL("%s: want pass count 1, have %d", log_prefix, pass); > + > + n = read(mode == REDIR_INGRESS ? p0 : c0, &b, 1); > + if (n < 0) > + FAIL_ERRNO("%s: read", log_prefix); Hey Cong, This test is pretty flaky and quite frequently fails in our CIs (e.g., [0]): ./test_progs-no_alu32:unix_udp_redir_to_connected:1949: egress: read: Resource temporarily unavailable unix_udp_redir_to_connected:FAIL:1949 Please send a fix to make it more reliable. Thanks! [0] https://github.com/anakryiko/libbpf/runs/3249152533?check_suite_focus=true > + if (n == 0) > + FAIL("%s: incomplete read", log_prefix); > + > +close: > + xclose(c1); > + xclose(p1); > +close_cli0: > + xclose(c0); > + xclose(p0); > + > +} > + [...]