File tree Expand file tree Collapse file tree 1 file changed +18
-0
lines changed
tools/testing/selftests/hid Expand file tree Collapse file tree 1 file changed +18
-0
lines changed Original file line number Diff line number Diff line change @@ -694,6 +694,24 @@ TEST_F(hid_bpf, subprog_raw_event)
694
694
ASSERT_EQ (buf [2 ], 52 );
695
695
}
696
696
697
+ /*
698
+ * Attach hid_first_event to the given uhid device,
699
+ * attempt at re-attaching it, we should not lock and
700
+ * return an invalid struct bpf_link
701
+ */
702
+ TEST_F (hid_bpf , multiple_attach )
703
+ {
704
+ const struct test_program progs [] = {
705
+ { .name = "hid_first_event" },
706
+ };
707
+ struct bpf_link * link ;
708
+
709
+ LOAD_PROGRAMS (progs );
710
+
711
+ link = bpf_map__attach_struct_ops (self -> skel -> maps .first_event );
712
+ ASSERT_NULL (link ) TH_LOG ("unexpected return value when re-attaching the struct_ops" );
713
+ }
714
+
697
715
/*
698
716
* Ensures that we can attach/detach programs
699
717
*/
You can’t perform that action at this time.
0 commit comments