diff --git a/services/dnsagent_test.go b/services/dnsagent_test.go
index aa0e09cf3..789d5810f 100644
--- a/services/dnsagent_test.go
+++ b/services/dnsagent_test.go
@@ -43,13 +43,14 @@ func TestDNSAgentCoverage(t *testing.T) {
if srv.IsRunning() {
t.Errorf("Expected service to be down")
}
+ dns, _ := agents.NewDNSAgent(cfg, &engine.FilterS{}, nil)
srv2 := DNSAgent{
cfg: cfg,
filterSChan: filterSChan,
shdChan: shdChan,
connMgr: nil,
srvDep: srvDep,
- dns: &agents.DNSAgent{},
+ dns: dns,
}
if !srv2.IsRunning() {
@@ -59,5 +60,17 @@ func TestDNSAgentCoverage(t *testing.T) {
if err == nil || err != utils.ErrServiceAlreadyRunning {
t.Errorf("\nExpecting <%+v>,\n Received <%+v>", utils.ErrServiceAlreadyRunning, err)
}
-
+ serviceName := srv2.ServiceName()
+ if serviceName != utils.DNSAgent {
+ t.Errorf("\nExpecting <%+v>,\n Received <%+v>", utils.DNSAgent, serviceName)
+ }
+ shouldRun := srv2.ShouldRun()
+ if shouldRun != false {
+ t.Errorf("\nExpecting <%+v>,\n Received <%+v>", false, shouldRun)
+ }
+ srv2.Reload()
+ srv2.Shutdown()
+ if srv.IsRunning() {
+ t.Errorf("Expected service to be down")
+ }
}
diff --git a/services/globalvars_test.go b/services/globalvars_test.go
index 8ebae6f79..050356ceb 100644
--- a/services/globalvars_test.go
+++ b/services/globalvars_test.go
@@ -17,7 +17,14 @@ along with this program. If not, see
*/
package services
-/*
+import (
+ "reflect"
+ "testing"
+
+ "github.com/cgrates/cgrates/config"
+ "github.com/cgrates/cgrates/utils"
+)
+
func TestGlobalVarS(t *testing.T) {
cfg := config.NewDefaultCGRConfig()
@@ -45,4 +52,3 @@ func TestGlobalVarS(t *testing.T) {
t.Fatal(err)
}
}
-*/
diff --git a/services/httpagent_test.go b/services/httpagent_test.go
index afa79e0b4..b1c7b20ba 100644
--- a/services/httpagent_test.go
+++ b/services/httpagent_test.go
@@ -17,7 +17,18 @@ along with this program. If not, see
*/
package services
-/*
+import (
+ "reflect"
+ "sync"
+ "testing"
+
+ "github.com/cgrates/cgrates/config"
+ "github.com/cgrates/cgrates/cores"
+ "github.com/cgrates/cgrates/engine"
+ "github.com/cgrates/cgrates/utils"
+ "github.com/cgrates/rpcclient"
+)
+
//TestHTTPAgent for cover testing
func TestHTTPAgentCoverage(t *testing.T) {
cfg := config.NewDefaultCGRConfig()
@@ -69,4 +80,3 @@ func TestHTTPAgentCoverage(t *testing.T) {
t.Errorf("Expected service to be down")
}
}
-*/
diff --git a/services/loaders_test.go b/services/loaders_test.go
index 10ede2649..3e1aa1620 100644
--- a/services/loaders_test.go
+++ b/services/loaders_test.go
@@ -17,7 +17,19 @@ along with this program. If not, see
*/
package services
-/*
+import (
+ "reflect"
+ "sync"
+ "testing"
+
+ "github.com/cgrates/cgrates/config"
+ "github.com/cgrates/cgrates/cores"
+ "github.com/cgrates/cgrates/engine"
+ "github.com/cgrates/cgrates/loaders"
+ "github.com/cgrates/cgrates/utils"
+ "github.com/cgrates/rpcclient"
+)
+
//TestLoaderSCoverage for cover testing
func TestLoaderSCoverage(t *testing.T) {
cfg := config.NewDefaultCGRConfig()
@@ -57,4 +69,3 @@ func TestLoaderSCoverage(t *testing.T) {
}
}
-*/
diff --git a/services/responders_test.go b/services/responders_test.go
index 198f8814a..4dc704dc7 100644
--- a/services/responders_test.go
+++ b/services/responders_test.go
@@ -17,7 +17,18 @@ along with this program. If not, see
*/
package services
-/*
+import (
+ "reflect"
+ "sync"
+ "testing"
+
+ "github.com/cgrates/cgrates/config"
+ "github.com/cgrates/cgrates/cores"
+ "github.com/cgrates/cgrates/engine"
+ "github.com/cgrates/cgrates/utils"
+ "github.com/cgrates/rpcclient"
+)
+
//TestResponderCoverage for cover testing
func TestResponderCoverage(t *testing.T) {
cfg := config.NewDefaultCGRConfig()
@@ -58,4 +69,3 @@ func TestResponderCoverage(t *testing.T) {
t.Errorf("\nExpecting <%+v>,\n Received <%+v>", false, shouldRun)
}
}
-*/
diff --git a/services/stordb_test.go b/services/stordb_test.go
index a050f0c47..e146eeaad 100644
--- a/services/stordb_test.go
+++ b/services/stordb_test.go
@@ -17,7 +17,15 @@ along with this program. If not, see
*/
package services
-/*
+import (
+ "sync"
+ "testing"
+
+ "github.com/cgrates/cgrates/config"
+ "github.com/cgrates/cgrates/engine"
+ "github.com/cgrates/cgrates/utils"
+)
+
//TestStorDBServiceCoverage for cover testing
func TestStorDBServiceCoverage(t *testing.T) {
cfg := config.NewDefaultCGRConfig()
@@ -49,4 +57,3 @@ func TestStorDBServiceCoverage(t *testing.T) {
t.Errorf("\nExpecting ,\n Received <%+v>", err2)
}
}
-*/