github.com/kata-containers/runtime@v0.0.0-20210505125100-04f29832a923/virtcontainers/noop_proxy_test.go (about)

     1  // Copyright (c) 2018 HyperHQ Inc.
     2  //
     3  // SPDX-License-Identifier: Apache-2.0
     4  //
     5  
     6  package virtcontainers
     7  
     8  import (
     9  	"testing"
    10  
    11  	"github.com/stretchr/testify/assert"
    12  )
    13  
    14  func TestNoopProxy(t *testing.T) {
    15  	n := &noopProxy{}
    16  	assert := assert.New(t)
    17  
    18  	_, url, err := n.start(proxyParams{})
    19  	assert.Nil(err)
    20  	assert.Equal(url, noopProxyURL)
    21  
    22  	err = n.stop(0)
    23  	assert.Nil(err)
    24  
    25  	assert.False(n.consoleWatched())
    26  }