blob: 484a9a9cc2c8158a3881a8bafc2de421646c6c70 (
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 Yahoo. 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)
}
|