github.com/apptainer/singularity@v3.1.1+incompatible/pkg/sypgp/sypgp_test.go (about)

     1  // Copyright (c) 2018, Sylabs Inc. All rights reserved.
     2  // This software is licensed under a 3-clause BSD license. Please consult the
     3  // LICENSE.md file distributed with the sources of this project regarding your
     4  // rights to use or distribute this software.
     5  
     6  package sypgp
     7  
     8  import (
     9  	"log"
    10  	"os"
    11  	"testing"
    12  
    13  	"github.com/sylabs/singularity/pkg/util/user-agent"
    14  	"golang.org/x/crypto/openpgp"
    15  )
    16  
    17  const (
    18  	testName    = "Test Name"
    19  	testComment = "blah"
    20  	testEmail   = "test@test.com"
    21  )
    22  
    23  var (
    24  	testEntity *openpgp.Entity
    25  )
    26  
    27  func TestMain(m *testing.M) {
    28  	useragent.InitValue("singularity", "3.0.0-alpha.1-303-gaed8d30-dirty")
    29  
    30  	e, err := openpgp.NewEntity(testName, testComment, testEmail, nil)
    31  	if err != nil {
    32  		log.Fatalf("failed to create entity: %v", err)
    33  	}
    34  	testEntity = e
    35  
    36  	os.Exit(m.Run())
    37  }