Source file src/net/tcpconn_keepalive_conf_solaris_test.go

     1  // Copyright 2024 The Go Authors. All rights reserved.
     2  // Use of this source code is governed by a BSD-style
     3  // license that can be found in the LICENSE file.
     4  
     5  //go:build solaris && !illumos
     6  
     7  package net
     8  
     9  import (
    10  	"testing"
    11  	"time"
    12  )
    13  
    14  const (
    15  	syscall_TCP_KEEPIDLE  = sysTCP_KEEPIDLE
    16  	syscall_TCP_KEEPCNT   = sysTCP_KEEPCNT
    17  	syscall_TCP_KEEPINTVL = sysTCP_KEEPINTVL
    18  )
    19  
    20  type fdType = int
    21  
    22  func maybeSkipKeepAliveTest(_ *testing.T) {}
    23  
    24  var testConfigs = []KeepAliveConfig{
    25  	{
    26  		Enable:   true,
    27  		Idle:     20 * time.Second, // the minimum value is ten seconds on Solaris
    28  		Interval: 10 * time.Second, // ditto
    29  		Count:    10,
    30  	},
    31  	{
    32  		Enable:   true,
    33  		Idle:     0,
    34  		Interval: 0,
    35  		Count:    0,
    36  	},
    37  	{
    38  		Enable:   true,
    39  		Idle:     -1,
    40  		Interval: -1,
    41  		Count:    -1,
    42  	},
    43  	{
    44  		Enable:   true,
    45  		Idle:     -1,
    46  		Interval: 10 * time.Second,
    47  		Count:    10,
    48  	},
    49  	{
    50  		Enable:   true,
    51  		Idle:     20 * time.Second,
    52  		Interval: -1,
    53  		Count:    10,
    54  	},
    55  	{
    56  		Enable:   true,
    57  		Idle:     20 * time.Second,
    58  		Interval: 10 * time.Second,
    59  		Count:    -1,
    60  	},
    61  	{
    62  		Enable:   true,
    63  		Idle:     -1,
    64  		Interval: -1,
    65  		Count:    10,
    66  	},
    67  	{
    68  		Enable:   true,
    69  		Idle:     -1,
    70  		Interval: 10 * time.Second,
    71  		Count:    -1,
    72  	},
    73  	{
    74  		Enable:   true,
    75  		Idle:     20 * time.Second,
    76  		Interval: -1,
    77  		Count:    -1,
    78  	},
    79  	{
    80  		Enable:   true,
    81  		Idle:     0,
    82  		Interval: 10 * time.Second,
    83  		Count:    10,
    84  	},
    85  	{
    86  		Enable:   true,
    87  		Idle:     20 * time.Second,
    88  		Interval: 0,
    89  		Count:    10,
    90  	},
    91  	{
    92  		Enable:   true,
    93  		Idle:     20 * time.Second,
    94  		Interval: 10 * time.Second,
    95  		Count:    0,
    96  	},
    97  	{
    98  		Enable:   true,
    99  		Idle:     0,
   100  		Interval: 0,
   101  		Count:    10,
   102  	},
   103  	{
   104  		Enable:   true,
   105  		Idle:     0,
   106  		Interval: 10 * time.Second,
   107  		Count:    0,
   108  	},
   109  	{
   110  		Enable:   true,
   111  		Idle:     20 * time.Second,
   112  		Interval: 0,
   113  		Count:    0,
   114  	},
   115  }
   116  

View as plain text