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
commitfcfb5e62f95d625836328131cc5ca851182bcae4 (patch)
tree5309ef2284a82d61ece838d1dd1c97c09df152b8 /tests/sla_test.go
parentAdding upstream version 1.1.1. (diff)
downloadicingadb-fcfb5e62f95d625836328131cc5ca851182bcae4.tar.xz
icingadb-fcfb5e62f95d625836328131cc5ca851182bcae4.zip
Adding upstream version 1.2.0.upstream/1.2.0upstream
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 {