aboutsummaryrefslogtreecommitdiffstats
path: root/client/go/internal/vespa/find_user_test.go
blob: 4dbc97ba1c514daab2e09e6ef2122351c8d19b36 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
// Copyright Vespa.ai. Licensed under the terms of the Apache 2.0 license. See LICENSE in the project root.
package vespa

import (
	"testing"

	"github.com/stretchr/testify/assert"
)

func TestFindVespaUser(t *testing.T) {
	var uName string

	t.Setenv("VESPA_USER", "nobody")
	uName = FindVespaUser()
	assert.Equal(t, "nobody", uName)

	t.Setenv("VESPA_USER", "")
	uName = FindVespaUser()
	assert.NotEqual(t, "", uName)
}

func TestFindVespaUidAndGid(t *testing.T) {
	uid, gid := FindVespaUidAndGid()
	t.Log("INFO: result from FindVespaUidAndGid() is", uid, "and", gid)
}