github.com/SagerNet/gvisor@v0.0.0-20210707092255-7731c139d75c/test/packetimpact/tests/BUILD (about)

     1  load("//test/packetimpact/runner:defs.bzl", "ALL_TESTS", "packetimpact_go_test", "packetimpact_testbench", "validate_all_tests")
     2  
     3  package(
     4      default_visibility = ["//test/packetimpact:__subpackages__"],
     5      licenses = ["notice"],
     6  )
     7  
     8  packetimpact_testbench(
     9      name = "fin_wait2_timeout",
    10      srcs = ["fin_wait2_timeout_test.go"],
    11      deps = [
    12          "//pkg/tcpip/header",
    13          "//test/packetimpact/testbench",
    14          "@org_golang_x_sys//unix:go_default_library",
    15      ],
    16  )
    17  
    18  packetimpact_testbench(
    19      name = "ipv4_id_uniqueness",
    20      srcs = ["ipv4_id_uniqueness_test.go"],
    21      deps = [
    22          "//pkg/abi/linux",
    23          "//pkg/tcpip/header",
    24          "//test/packetimpact/testbench",
    25          "@org_golang_x_sys//unix:go_default_library",
    26      ],
    27  )
    28  
    29  packetimpact_testbench(
    30      name = "udp_discard_mcast_source_addr",
    31      srcs = ["udp_discard_mcast_source_addr_test.go"],
    32      deps = [
    33          "//pkg/tcpip",
    34          "//pkg/tcpip/header",
    35          "//test/packetimpact/testbench",
    36          "@org_golang_x_sys//unix:go_default_library",
    37      ],
    38  )
    39  
    40  packetimpact_testbench(
    41      name = "udp_any_addr_recv_unicast",
    42      srcs = ["udp_any_addr_recv_unicast_test.go"],
    43      deps = [
    44          "//pkg/tcpip",
    45          "//test/packetimpact/testbench",
    46          "@com_github_google_go_cmp//cmp:go_default_library",
    47          "@org_golang_x_sys//unix:go_default_library",
    48      ],
    49  )
    50  
    51  packetimpact_testbench(
    52      name = "udp_icmp_error_propagation",
    53      srcs = ["udp_icmp_error_propagation_test.go"],
    54      deps = [
    55          "//pkg/tcpip",
    56          "//pkg/tcpip/header",
    57          "//test/packetimpact/testbench",
    58          "@org_golang_x_sys//unix:go_default_library",
    59      ],
    60  )
    61  
    62  packetimpact_testbench(
    63      name = "tcp_window_shrink",
    64      srcs = ["tcp_window_shrink_test.go"],
    65      deps = [
    66          "//pkg/tcpip/header",
    67          "//test/packetimpact/testbench",
    68          "@org_golang_x_sys//unix:go_default_library",
    69      ],
    70  )
    71  
    72  packetimpact_testbench(
    73      name = "tcp_zero_window_probe",
    74      srcs = ["tcp_zero_window_probe_test.go"],
    75      deps = [
    76          "//pkg/tcpip/header",
    77          "//test/packetimpact/testbench",
    78          "@org_golang_x_sys//unix:go_default_library",
    79      ],
    80  )
    81  
    82  packetimpact_testbench(
    83      name = "tcp_zero_window_probe_retransmit",
    84      srcs = ["tcp_zero_window_probe_retransmit_test.go"],
    85      deps = [
    86          "//pkg/tcpip/header",
    87          "//test/packetimpact/testbench",
    88          "@org_golang_x_sys//unix:go_default_library",
    89      ],
    90  )
    91  
    92  packetimpact_testbench(
    93      name = "tcp_zero_window_probe_usertimeout",
    94      srcs = ["tcp_zero_window_probe_usertimeout_test.go"],
    95      deps = [
    96          "//pkg/tcpip/header",
    97          "//test/packetimpact/testbench",
    98          "@org_golang_x_sys//unix:go_default_library",
    99      ],
   100  )
   101  
   102  packetimpact_testbench(
   103      name = "tcp_retransmits",
   104      srcs = ["tcp_retransmits_test.go"],
   105      deps = [
   106          "//pkg/abi/linux",
   107          "//pkg/tcpip/header",
   108          "//test/packetimpact/testbench",
   109          "@org_golang_x_sys//unix:go_default_library",
   110      ],
   111  )
   112  
   113  packetimpact_testbench(
   114      name = "tcp_outside_the_window",
   115      srcs = ["tcp_outside_the_window_test.go"],
   116      deps = [
   117          "//pkg/tcpip/header",
   118          "//pkg/tcpip/seqnum",
   119          "//test/packetimpact/testbench",
   120          "@org_golang_x_sys//unix:go_default_library",
   121      ],
   122  )
   123  
   124  packetimpact_testbench(
   125      name = "tcp_noaccept_close_rst",
   126      srcs = ["tcp_noaccept_close_rst_test.go"],
   127      deps = [
   128          "//pkg/tcpip/header",
   129          "//test/packetimpact/testbench",
   130          "@org_golang_x_sys//unix:go_default_library",
   131      ],
   132  )
   133  
   134  packetimpact_testbench(
   135      name = "tcp_send_window_sizes_piggyback",
   136      srcs = ["tcp_send_window_sizes_piggyback_test.go"],
   137      deps = [
   138          "//pkg/tcpip/header",
   139          "//test/packetimpact/testbench",
   140          "@org_golang_x_sys//unix:go_default_library",
   141      ],
   142  )
   143  
   144  packetimpact_testbench(
   145      name = "tcp_unacc_seq_ack",
   146      srcs = ["tcp_unacc_seq_ack_test.go"],
   147      deps = [
   148          "//pkg/tcpip/header",
   149          "//pkg/tcpip/seqnum",
   150          "//test/packetimpact/testbench",
   151          "@org_golang_x_sys//unix:go_default_library",
   152      ],
   153  )
   154  
   155  packetimpact_testbench(
   156      name = "tcp_paws_mechanism",
   157      srcs = ["tcp_paws_mechanism_test.go"],
   158      deps = [
   159          "//pkg/tcpip/header",
   160          "//pkg/tcpip/seqnum",
   161          "//test/packetimpact/testbench",
   162          "@org_golang_x_sys//unix:go_default_library",
   163      ],
   164  )
   165  
   166  packetimpact_testbench(
   167      name = "tcp_user_timeout",
   168      srcs = ["tcp_user_timeout_test.go"],
   169      deps = [
   170          "//pkg/tcpip/header",
   171          "//test/packetimpact/testbench",
   172          "@org_golang_x_sys//unix:go_default_library",
   173      ],
   174  )
   175  
   176  packetimpact_testbench(
   177      name = "tcp_queue_send_recv_in_syn_sent",
   178      srcs = ["tcp_queue_send_recv_in_syn_sent_test.go"],
   179      deps = [
   180          "//pkg/tcpip/header",
   181          "//test/packetimpact/testbench",
   182          "@org_golang_x_sys//unix:go_default_library",
   183      ],
   184  )
   185  
   186  packetimpact_testbench(
   187      name = "tcp_synsent_reset",
   188      srcs = ["tcp_synsent_reset_test.go"],
   189      deps = [
   190          "//pkg/abi/linux",
   191          "//pkg/tcpip/header",
   192          "//test/packetimpact/testbench",
   193          "@org_golang_x_sys//unix:go_default_library",
   194      ],
   195  )
   196  
   197  packetimpact_testbench(
   198      name = "tcp_synrcvd_reset",
   199      srcs = ["tcp_synrcvd_reset_test.go"],
   200      deps = [
   201          "//pkg/tcpip/header",
   202          "//test/packetimpact/testbench",
   203          "@org_golang_x_sys//unix:go_default_library",
   204      ],
   205  )
   206  
   207  packetimpact_testbench(
   208      name = "tcp_network_unreachable",
   209      srcs = ["tcp_network_unreachable_test.go"],
   210      deps = [
   211          "//pkg/tcpip/header",
   212          "//test/packetimpact/testbench",
   213          "@org_golang_x_sys//unix:go_default_library",
   214      ],
   215  )
   216  
   217  packetimpact_testbench(
   218      name = "tcp_cork_mss",
   219      srcs = ["tcp_cork_mss_test.go"],
   220      deps = [
   221          "//pkg/tcpip/header",
   222          "//test/packetimpact/testbench",
   223          "@org_golang_x_sys//unix:go_default_library",
   224      ],
   225  )
   226  
   227  packetimpact_testbench(
   228      name = "tcp_handshake_window_size",
   229      srcs = ["tcp_handshake_window_size_test.go"],
   230      deps = [
   231          "//pkg/tcpip/header",
   232          "//test/packetimpact/testbench",
   233          "@org_golang_x_sys//unix:go_default_library",
   234      ],
   235  )
   236  
   237  packetimpact_testbench(
   238      name = "tcp_timewait_reset",
   239      srcs = ["tcp_timewait_reset_test.go"],
   240      deps = [
   241          "//pkg/tcpip/header",
   242          "//test/packetimpact/testbench",
   243          "@org_golang_x_sys//unix:go_default_library",
   244      ],
   245  )
   246  
   247  packetimpact_testbench(
   248      name = "icmpv6_param_problem",
   249      srcs = ["icmpv6_param_problem_test.go"],
   250      deps = [
   251          "//pkg/tcpip",
   252          "//pkg/tcpip/header",
   253          "//test/packetimpact/testbench",
   254          "@org_golang_x_sys//unix:go_default_library",
   255      ],
   256  )
   257  
   258  packetimpact_testbench(
   259      name = "ipv6_unknown_options_action",
   260      srcs = ["ipv6_unknown_options_action_test.go"],
   261      deps = [
   262          "//pkg/tcpip",
   263          "//pkg/tcpip/header",
   264          "//test/packetimpact/testbench",
   265          "@org_golang_x_sys//unix:go_default_library",
   266      ],
   267  )
   268  
   269  packetimpact_testbench(
   270      name = "ipv4_fragment_reassembly",
   271      srcs = ["ipv4_fragment_reassembly_test.go"],
   272      deps = [
   273          "//pkg/tcpip/buffer",
   274          "//pkg/tcpip/header",
   275          "//test/packetimpact/testbench",
   276          "@com_github_google_go_cmp//cmp:go_default_library",
   277          "@org_golang_x_sys//unix:go_default_library",
   278      ],
   279  )
   280  
   281  packetimpact_testbench(
   282      name = "ipv6_fragment_reassembly",
   283      srcs = ["ipv6_fragment_reassembly_test.go"],
   284      deps = [
   285          "//pkg/tcpip",
   286          "//pkg/tcpip/buffer",
   287          "//pkg/tcpip/header",
   288          "//test/packetimpact/testbench",
   289          "@com_github_google_go_cmp//cmp:go_default_library",
   290          "@org_golang_x_sys//unix:go_default_library",
   291      ],
   292  )
   293  
   294  packetimpact_testbench(
   295      name = "ipv6_fragment_icmp_error",
   296      srcs = ["ipv6_fragment_icmp_error_test.go"],
   297      deps = [
   298          "//pkg/tcpip",
   299          "//pkg/tcpip/buffer",
   300          "//pkg/tcpip/header",
   301          "//pkg/tcpip/network/ipv6",
   302          "//test/packetimpact/testbench",
   303          "@com_github_google_go_cmp//cmp:go_default_library",
   304          "@org_golang_x_sys//unix:go_default_library",
   305      ],
   306  )
   307  
   308  packetimpact_testbench(
   309      name = "tcp_linger",
   310      srcs = ["tcp_linger_test.go"],
   311      deps = [
   312          "//pkg/tcpip/header",
   313          "//test/packetimpact/testbench",
   314          "@org_golang_x_sys//unix:go_default_library",
   315      ],
   316  )
   317  
   318  packetimpact_testbench(
   319      name = "tcp_rcv_buf_space",
   320      srcs = ["tcp_rcv_buf_space_test.go"],
   321      deps = [
   322          "//pkg/tcpip/header",
   323          "//test/packetimpact/testbench",
   324          "@org_golang_x_sys//unix:go_default_library",
   325      ],
   326  )
   327  
   328  packetimpact_testbench(
   329      name = "tcp_zero_receive_window",
   330      srcs = ["tcp_zero_receive_window_test.go"],
   331      deps = [
   332          "//pkg/tcpip/header",
   333          "//test/packetimpact/testbench",
   334          "@org_golang_x_sys//unix:go_default_library",
   335      ],
   336  )
   337  
   338  packetimpact_testbench(
   339      name = "tcp_rack",
   340      srcs = ["tcp_rack_test.go"],
   341      deps = [
   342          "//pkg/abi/linux",
   343          "//pkg/tcpip/header",
   344          "//pkg/tcpip/seqnum",
   345          "//test/packetimpact/testbench",
   346          "@org_golang_x_sys//unix:go_default_library",
   347      ],
   348  )
   349  
   350  packetimpact_testbench(
   351      name = "tcp_info",
   352      srcs = ["tcp_info_test.go"],
   353      deps = [
   354          "//pkg/abi/linux",
   355          "//pkg/tcpip/header",
   356          "//test/packetimpact/testbench",
   357          "@org_golang_x_sys//unix:go_default_library",
   358      ],
   359  )
   360  
   361  packetimpact_testbench(
   362      name = "tcp_fin_retransmission",
   363      srcs = ["tcp_fin_retransmission_test.go"],
   364      deps = [
   365          "//pkg/tcpip/header",
   366          "//test/packetimpact/testbench",
   367          "@org_golang_x_sys//unix:go_default_library",
   368      ],
   369  )
   370  
   371  packetimpact_testbench(
   372      name = "tcp_listen_backlog",
   373      srcs = ["tcp_listen_backlog_test.go"],
   374      deps = [
   375          "//pkg/tcpip/header",
   376          "//test/packetimpact/testbench",
   377          "@org_golang_x_sys//unix:go_default_library",
   378      ],
   379  )
   380  
   381  packetimpact_testbench(
   382      name = "tcp_syncookie",
   383      srcs = ["tcp_syncookie_test.go"],
   384      deps = [
   385          "//pkg/tcpip/header",
   386          "//test/packetimpact/testbench",
   387          "@com_github_google_go_cmp//cmp:go_default_library",
   388          "@org_golang_x_sys//unix:go_default_library",
   389      ],
   390  )
   391  
   392  packetimpact_testbench(
   393      name = "tcp_connect_icmp_error",
   394      srcs = ["tcp_connect_icmp_error_test.go"],
   395      deps = [
   396          "//pkg/tcpip/header",
   397          "//test/packetimpact/testbench",
   398          "@org_golang_x_sys//unix:go_default_library",
   399      ],
   400  )
   401  
   402  packetimpact_testbench(
   403      name = "generic_dgram_socket_send_recv",
   404      srcs = ["generic_dgram_socket_send_recv_test.go"],
   405      deps = [
   406          "//pkg/tcpip",
   407          "//pkg/tcpip/header",
   408          "//test/packetimpact/testbench",
   409          "@com_github_google_go_cmp//cmp:go_default_library",
   410          "@org_golang_x_sys//unix:go_default_library",
   411      ],
   412  )
   413  
   414  validate_all_tests()
   415  
   416  [packetimpact_go_test(
   417      name = t.name,
   418      timeout = t.timeout if hasattr(t, "timeout") else "moderate",
   419      expect_netstack_failure = hasattr(t, "expect_netstack_failure"),
   420      num_duts = t.num_duts if hasattr(t, "num_duts") else 1,
   421  ) for t in ALL_TESTS]
   422  
   423  test_suite(
   424      name = "all_tests",
   425      tags = [
   426          "local",
   427          "manual",
   428          "packetimpact",
   429      ],
   430      tests = existing_rules(),
   431  )