-
Notifications
You must be signed in to change notification settings - Fork 0
/
integration_test.go
42 lines (37 loc) · 1.08 KB
/
integration_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
33
34
35
36
37
38
39
40
41
42
package main
import (
"github.com/stretchr/testify/assert"
"os"
"testing"
)
func TestConfig_Run_Integration(t *testing.T) {
var (
gateway = os.Getenv("BREVIS_INTEGRATION_GATEWAY")
username = os.Getenv("BREVIS_INTEGRATION_USERNAME")
password = os.Getenv("BREVIS_INTEGRATION_PASSWORD")
target = os.Getenv("BREVIS_INTEGRATION_TARGET")
ring = os.Getenv("BREVIS_INTEGRATION_RING") != ""
)
if gateway == "" || username == "" || password == "" || target == "" {
t.Skip("You need to set BREVIS_INTEGRATION_* environment for integration tests")
return
}
c := &Config{
gateway: gateway,
target: target,
targetType: "number",
ring: ring,
username: username,
password: password,
insecure: true,
checkState: "WARNING",
checkOutput: "test notification for notify-brevisone",
hostName: "brevis.one",
serviceName: "notify",
author: "icingaadmin",
comment: "comment",
date: "",
notificationType: "CUSTOM",
}
assert.NoError(t, c.Run())
}