github.com/DelineaXPM/dsv-cli@v1.40.6/tests/e2e/cmd_whoami_test.go (about)

     1  //go:build endtoend
     2  // +build endtoend
     3  
     4  package e2e
     5  
     6  import (
     7  	"fmt"
     8  	"strings"
     9  	"testing"
    10  )
    11  
    12  func TestWhoami(t *testing.T) {
    13  	e := newEnv()
    14  
    15  	cmd := []string{
    16  		"whoami",
    17  		"--auth-type=password",
    18  		fmt.Sprintf("--auth-username=%s", e.username),
    19  		fmt.Sprintf("--auth-password=%s", e.password),
    20  		fmt.Sprintf("--tenant=%s", e.tenant),
    21  		fmt.Sprintf("--domain=%s", e.domain),
    22  	}
    23  	output := run(t, cmd)
    24  	if !strings.Contains(output, fmt.Sprintf("users:%s", e.username)) {
    25  		t.Fatalf("Unexpected output: \n%s\n", output)
    26  	}
    27  }