go.etcd.io/etcd@v3.3.27+incompatible/tests/e2e/main_test.go (about)

     1  // Copyright 2013 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  package e2e
     6  
     7  import (
     8  	"flag"
     9  	"os"
    10  	"runtime"
    11  	"testing"
    12  
    13  	"github.com/coreos/etcd/pkg/testutil"
    14  )
    15  
    16  var (
    17  	binDir  string
    18  	certDir string
    19  
    20  	certPath       string
    21  	privateKeyPath string
    22  	caPath         string
    23  
    24  	certPath2       string
    25  	privateKeyPath2 string
    26  
    27  	certPath3       string
    28  	privateKeyPath3 string
    29  
    30  	crlPath               string
    31  	revokedCertPath       string
    32  	revokedPrivateKeyPath string
    33  )
    34  
    35  func TestMain(m *testing.M) {
    36  	os.Setenv("ETCD_UNSUPPORTED_ARCH", runtime.GOARCH)
    37  	os.Unsetenv("ETCDCTL_API")
    38  
    39  	flag.StringVar(&binDir, "bin-dir", "../../bin", "The directory for store etcd and etcdctl binaries.")
    40  	flag.StringVar(&certDir, "cert-dir", "../../integration/fixtures", "The directory for store certificate files.")
    41  	flag.Parse()
    42  
    43  	binPath = binDir + "/etcd"
    44  	ctlBinPath = binDir + "/etcdctl"
    45  	certPath = certDir + "/server.crt"
    46  	privateKeyPath = certDir + "/server.key.insecure"
    47  	caPath = certDir + "/ca.crt"
    48  	revokedCertPath = certDir + "/server-revoked.crt"
    49  	revokedPrivateKeyPath = certDir + "/server-revoked.key.insecure"
    50  	crlPath = certDir + "/revoke.crl"
    51  
    52  	certPath2 = certDir + "/server2.crt"
    53  	privateKeyPath2 = certDir + "/server2.key.insecure"
    54  
    55  	certPath3 = certDir + "/server3.crt"
    56  	privateKeyPath3 = certDir + "/server3.key.insecure"
    57  
    58  	v := m.Run()
    59  	if v == 0 && testutil.CheckLeakedGoroutine() {
    60  		os.Exit(1)
    61  	}
    62  	os.Exit(v)
    63  }