From 6017827059671bc880f5c11f01a2a3439e403ba1 Mon Sep 17 00:00:00 2001 From: DanB Date: Tue, 18 Mar 2014 14:55:46 +0000 Subject: [PATCH] Small tweaks to make local tests running with vagrant --- cdrc/cdrc_local_test.go | 7 +++++++ data/conf/samples/apier_local_test.cfg | 2 +- data/tutorials/fs_json/cgrates/etc/init.d/cgrates | 2 +- 3 files changed, 9 insertions(+), 2 deletions(-) diff --git a/cdrc/cdrc_local_test.go b/cdrc/cdrc_local_test.go index 71e480cf3..f5c6c82a7 100644 --- a/cdrc/cdrc_local_test.go +++ b/cdrc/cdrc_local_test.go @@ -27,6 +27,7 @@ import ( "github.com/cgrates/cgrates/utils" "io/ioutil" "os/exec" + "os" "path" "testing" "time" @@ -119,6 +120,12 @@ func TestCreateCdrFiles(t *testing.T) { if !*testLocal { return } + if err := os.RemoveAll(cfg.CdrcCdrInDir); err != nil { + t.Fatal("Error removing folder: ", cfg.CdrcCdrInDir, err) + } + if err := os.MkdirAll(cfg.CdrcCdrInDir, 0755); err != nil { + t.Fatal("Error creating folder: ", cfg.CdrcCdrInDir, err) + } if err := ioutil.WriteFile(path.Join(cfg.CdrcCdrInDir, "file1.csv"), []byte(fileContent1), 0644); err != nil { t.Fatal(err.Error) } diff --git a/data/conf/samples/apier_local_test.cfg b/data/conf/samples/apier_local_test.cfg index 99ccb7e56..cd2b0f2d5 100644 --- a/data/conf/samples/apier_local_test.cfg +++ b/data/conf/samples/apier_local_test.cfg @@ -15,7 +15,7 @@ enabled = true # Start the CDR Server service: . mediator = internal # Address where to reach the Mediator. Empty for disabling mediation. <""|internal> [cdre] -export_dir = /tmp/cgrates/cdr/cdrexport/csv # Path where the exported CDRs will be placed +export_dir = /tmp/cgrates/cdr/cdre/csv # Path where the exported CDRs will be placed [cdrc] cdr_in_dir = /tmp/cgrates/cdr/cdrc/in # Absolute path towards the directory where the CDRs are stored. diff --git a/data/tutorials/fs_json/cgrates/etc/init.d/cgrates b/data/tutorials/fs_json/cgrates/etc/init.d/cgrates index 54bbb073b..237ab9b7a 100755 --- a/data/tutorials/fs_json/cgrates/etc/init.d/cgrates +++ b/data/tutorials/fs_json/cgrates/etc/init.d/cgrates @@ -23,7 +23,7 @@ DAEMON=/usr/bin/cgr-engine USER=cgrates GROUP=cgrates TUTFOLDER=/usr/share/cgrates/tutorials/fs_json/cgrates -ENGINE_OPTS=-config=$TUTFOLDER/etc/cgrates/cgrates.cfg +ENGINE_OPTS="-config=$TUTFOLDER/etc/cgrates/cgrates.cfg" PIDFILE=/tmp/cgr-engine_tutfsjson.pid SCRIPTNAME=$TUTFOLDER/etc/init.d/$NAME DEFAULTS=$TUTFOLDER/etc/default/$NAME