test environment
This commit is contained in:
snoop 2017-04-17 13:48:53 +09:00
parent 837b3070bb
commit b923860b1a
2 changed files with 18 additions and 8 deletions

View File

@ -21,8 +21,8 @@ const (
portArgsName = "-Port="
defaultPort = 50000
rootFolder = "/home/cm/"
ConfigFolder = rootFolder + "/config/" // +container
rootFolder = "/home/cm2/"
ConfigFolder = rootFolder + "/config/container/" // +container
BinaryFolder = rootFolder + "/container/"
PidFolder = rootFolder + "/pids/"
runFile = "ttnc"
@ -42,7 +42,7 @@ func init() {
g_CrawlerMananger = &CrawlerManager{portMap:make(map[string]string),pidMap:make(map[string]string), currentPort:defaultPort}
}
g_CrawlerMananger.init()
//g_CrawlerMananger.init()
}
func (c *CrawlerManager)GetClient(container string) (*grpc.ClientConn, error) {

View File

@ -11,6 +11,8 @@ import (
"strings"
"io/ioutil"
)
@ -127,6 +129,8 @@ func TestDir22(t *testing.T) {
func TestCrateDir(t *testing.T) {
cp := "/home/snoop/develop/path/go/src/loafle.com/overflow/crawler_manager_go/"
var configPath []string;
@ -149,10 +153,7 @@ func TestCrateDir(t *testing.T) {
containerPath = append(containerPath, PidFolder)
b, _:=ioutil.ReadFile("/home/snoop/develop/path/go/src/loafle.com/overflow/crawler_go/config/example.json")
b, _:=ioutil.ReadFile(cp + "config/example.json")
for i, p := range configPath {
pp := filepath.Join(p)
@ -164,10 +165,17 @@ func TestCrateDir(t *testing.T) {
}
bbb, _:=ioutil.ReadFile(cp + "config/ttnc")
for _, p := range containerPath {
pp := filepath.Join(p)
os.MkdirAll(pp, os.ModePerm)
pp += "/"
pp += "/ttnc"
ioutil.WriteFile(pp, bbb, os.ModePerm)
}
}
@ -280,3 +288,5 @@ func TestErer(t *testing.T) {
t.Log(len(asdf))
}