forked from shwuandwing/spiffe-helper
-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathconfig_test.go
32 lines (27 loc) · 986 Bytes
/
config_test.go
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
26
27
28
29
30
31
32
package main
import (
"github.com/stretchr/testify/assert"
"testing"
)
func TestParseConfig(t *testing.T) {
c, err := ParseConfig("./test/fixture/config/helper.conf")
assert.NoError(t, err)
expectedAgentAddress := "/tmp/agent.sock"
expectedCmd := "hot-restarter.py"
expectedCmdArgs := "start_envoy.sh"
expectedCertDir := "certs"
expectedRenewSignal := "SIGHUP"
expectedSvidFileName := "svid.pem"
expectedKeyFileName := "svid_key.pem"
expectedSvidBundleFileName := "svid_bundle.pem"
expectedTimeOut := "10s"
assert.Equal(t, expectedAgentAddress, c.AgentAddress)
assert.Equal(t, expectedCmd, c.Cmd)
assert.Equal(t, expectedCmdArgs, c.CmdArgs)
assert.Equal(t, expectedCertDir, c.CertDir)
assert.Equal(t, expectedRenewSignal, c.RenewSignal)
assert.Equal(t, expectedSvidFileName, c.SvidFileName)
assert.Equal(t, expectedKeyFileName, c.SvidKeyFileName)
assert.Equal(t, expectedSvidBundleFileName, c.SvidBundleFileName)
assert.Equal(t, expectedTimeOut, c.Timeout)
}