Exemple #1
0
func (s *TestNqmRdbSuite) TearDownTest(c *C) {
	if !qtest.HasTestDbConfig() {
		return
	}

	switch c.TestName() {
	case "TestNqmRdbSuite.TestGetTargetByHost",
		"TestNqmRdbSuite.TestGetTargetById":
		qtest.ExecuteQueriesOrFailInTx(
			`DELETE FROM nqm_target WHERE tg_id IN (19201, 19202, 19203)`,
		)
	}
}
Exemple #2
0
func (s *TestNqmRdbSuite) SetUpTest(c *C) {
	if !qtest.HasDefaultOrmOnPortal(c) {
		return
	}

	switch c.TestName() {
	case "TestNqmRdbSuite.TestGetTargetByHost",
		"TestNqmRdbSuite.TestGetTargetById":
		qtest.ExecuteQueriesOrFailInTx(
			`
			INSERT INTO nqm_target(tg_id, tg_name, tg_host) VALUES
			(19201, 'target-1', '100.20.50.1'),
			(19202, 'target-2', '100.20.50.2'),
			(19203, 'target-3', '100.20.50.3')
			`,
		)
	}
}