Skip to content
Snippets Groups Projects
Select Git revision
  • 5b57c8b792ab5a2abe61a7547db499954e93cfd7
  • master default protected
  • v1.14.7
  • v1.14.6
  • v1.14.5
  • v1.14.4
  • v1.14.3
  • v1.14.2
  • v1.14.1
  • v1.14.0
  • v1.13.2
  • v1.13.1
  • v1.13.0
  • v1.12.1
  • v1.12.0
  • v1.11.1
  • v1.11.0
  • v1.10.0
  • v1.9.2
  • v1.9.1
  • v1.9.0
  • v1.8.4
22 results

ipahost.py

Blame
  • pod_test.go 5.09 KiB
    //go:build e2e
    // +build e2e
    
    package test
    
    import (
    	"fmt"
    	"strings"
    	"testing"
    	"time"
    
    	"github.com/kelseyhightower/envconfig"
    	"github.com/stretchr/testify/suite"
    )
    
    const (
    	hostPathVolumeType = "hostPath"
    	localVolumeType    = "local"
    )
    
    type PodTestSuite struct {
    	suite.Suite
    
    	config       testConfig
    	kustomizeDir string
    }
    
    func (p *PodTestSuite) SetupSuite() {
    	err := envconfig.Process("test", &p.config)
    	if err != nil {
    		panic(err)
    	}
    
    	p.T().Logf("using test config: %+v", p.config)
    
    	p.TearDownSuite()
    
    	//kind load docker-image "$image"
    	cmds := []string{
    		fmt.Sprintf("kind create cluster --config=%s --wait=120s", testdataFile("kind-cluster.yaml")),
    		fmt.Sprintf("kind load docker-image %s", p.config.IMAGE),
    	}
    	for _, cmd := range cmds {
    		_, err = runCmd(
    			p.T(),
    			cmd,
    			"",
    			p.config.envs(),
    			nil,
    		)
    		if err != nil {
    			p.FailNow("", "failed to create the cluster or load image", err)
    		}
    	}
    }
    
    func (p *PodTestSuite) TearDownSuite() {
    	err := deleteCluster(
    		p.T(),
    		p.config.envs(),
    	)
    	if err != nil {
    		p.Failf("", "failed to delete the cluster: %v", err)
    	}
    }
    
    func (p *PodTestSuite) TearDownTest() {
    	err := deleteKustomizeDeployment(
    		p.T(),
    		p.kustomizeDir,