github.com/hernad/nomad@v1.6.112/e2e/podman/podman_test.go (about)

     1  // Copyright (c) HashiCorp, Inc.
     2  // SPDX-License-Identifier: MPL-2.0
     3  
     4  package podman
     5  
     6  import (
     7  	"testing"
     8  
     9  	"github.com/hernad/nomad/e2e/e2eutil"
    10  	"github.com/hernad/nomad/helper/uuid"
    11  	"github.com/shoenig/test/must"
    12  )
    13  
    14  func TestPodman(t *testing.T) {
    15  	nomad := e2eutil.NomadClient(t)
    16  
    17  	e2eutil.WaitForLeader(t, nomad)
    18  	e2eutil.WaitForNodesReady(t, nomad, 1)
    19  
    20  	t.Run("testBasic", testBasic)
    21  }
    22  
    23  func testBasic(t *testing.T) {
    24  	nomad := e2eutil.NomadClient(t)
    25  	jobID := "podman-basic-" + uuid.Short()
    26  	jobIDs := []string{jobID}
    27  	t.Cleanup(e2eutil.CleanupJobsAndGC(t, &jobIDs))
    28  
    29  	// start job
    30  	e2eutil.RegisterAndWaitForAllocs(t, nomad, "./input/podman_basic.hcl", jobID, "")
    31  
    32  	// get alloc id
    33  	allocID := e2eutil.SingleAllocID(t, jobID, "", 0)
    34  
    35  	// check logs for redis startup
    36  	logs, err := e2eutil.AllocTaskLogs(allocID, "redis", e2eutil.LogsStdOut)
    37  	must.NoError(t, err)
    38  	must.StrContains(t, logs, "oO0OoO0OoO0Oo Redis is starting oO0OoO0OoO0Oo")
    39  }