summaryrefslogtreecommitdiffstats
path: root/tests/sla_test.go
diff options
context:
space:
mode:
authorDaniel Baumann <daniel.baumann@progress-linux.org>2024-04-13 11:41:39 +0000
committerDaniel Baumann <daniel.baumann@progress-linux.org>2024-04-13 11:41:39 +0000
commit6696b6fca647cb1fe1ce74e8127090aa61482cab (patch)
tree75c2028bfcc4d098edf4679aa5dcefcdd45da00f /tests/sla_test.go
parentAdding debian version 1.1.1-2. (diff)
downloadicingadb-6696b6fca647cb1fe1ce74e8127090aa61482cab.tar.xz
icingadb-6696b6fca647cb1fe1ce74e8127090aa61482cab.zip
Merging upstream version 1.2.0.
Signed-off-by: Daniel Baumann <daniel.baumann@progress-linux.org>
Diffstat (limited to 'tests/sla_test.go')
-rw-r--r--tests/sla_test.go13
1 files changed, 6 insertions, 7 deletions
diff --git a/tests/sla_test.go b/tests/sla_test.go
index 6fa3a0e..597f5a0 100644
--- a/tests/sla_test.go
+++ b/tests/sla_test.go
@@ -18,15 +18,14 @@ import (
)
func TestSla(t *testing.T) {
- m := it.MysqlDatabaseT(t)
- m.ImportIcingaDbSchema()
+ rdb := getDatabase(t)
r := it.RedisServerT(t)
i := it.Icinga2NodeT(t, "master")
i.EnableIcingaDb(r)
err := i.Reload()
require.NoError(t, err, "icinga2 should reload without error")
- it.IcingaDbInstanceT(t, r, m)
+ it.IcingaDbInstanceT(t, r, rdb)
client := i.ApiClient()
@@ -109,8 +108,8 @@ func TestSla(t *testing.T) {
assert.Equal(t, 3, len(stateChanges), "there should be three hard state changes")
- db, err := sqlx.Connect("mysql", m.DSN())
- require.NoError(t, err, "connecting to mysql")
+ db, err := sqlx.Connect(rdb.Driver(), rdb.DSN())
+ require.NoError(t, err, "connecting to database")
defer func() { _ = db.Close() }()
type Row struct {
@@ -248,8 +247,8 @@ func TestSla(t *testing.T) {
End int64 `db:"downtime_end"`
}
- db, err := sqlx.Connect("mysql", m.DSN())
- require.NoError(t, err, "connecting to mysql")
+ db, err := sqlx.Connect(rdb.Driver(), rdb.DSN())
+ require.NoError(t, err, "connecting to database")
defer func() { _ = db.Close() }()
if !o.Fixed {