github.com/ilhicas/nomad@v0.11.8/drivers/docker/fingerprint_test.go (about)

     1  package docker
     2  
     3  import (
     4  	"context"
     5  	"testing"
     6  
     7  	"github.com/hashicorp/nomad/client/testutil"
     8  	"github.com/hashicorp/nomad/helper/testlog"
     9  	"github.com/hashicorp/nomad/plugins/drivers"
    10  	tu "github.com/hashicorp/nomad/testutil"
    11  	"github.com/stretchr/testify/require"
    12  )
    13  
    14  // TestDockerDriver_FingerprintHealth asserts that docker reports healthy
    15  // whenever Docker is supported.
    16  //
    17  // In Linux CI and AppVeyor Windows environment, it should be enabled.
    18  func TestDockerDriver_FingerprintHealth(t *testing.T) {
    19  	if !tu.IsCI() {
    20  		t.Parallel()
    21  	}
    22  	testutil.DockerCompatible(t)
    23  
    24  	ctx, cancel := context.WithCancel(context.Background())
    25  	defer cancel()
    26  
    27  	d := NewDockerDriver(ctx, testlog.HCLogger(t)).(*Driver)
    28  
    29  	fp := d.buildFingerprint()
    30  	require.Equal(t, drivers.HealthStateHealthy, fp.Health)
    31  }