This PR is same as PR179 which has been approved, only difference is the codes are pushed from personal branch q131172019/GRS:Carl_Merge_PR167_and_PR171_Into_simulator-list-watch.
This PR is to merge PR167 and PR171 into simulator-list-watch branch to be convenient for integration test
PR167 - Should not flushall redis DB when service API starts
PR171 - Change Redis default port 6379 to new port flexibly
UT test:
ubuntu@ip-172-31-8-82:~/go/src/GRS/resource-management/pkg/store/redis$ go test -v
=== RUN TestNewRedisClient
--- PASS: TestNewRedisClient (0.00s)
=== RUN TestSetGettString
--- PASS: TestSetGettString (0.00s)
=== RUN TestPersistNodes
--- PASS: TestPersistNodes (0.00s)
=== RUN TestPersistNodeStoreStatus
--- PASS: TestPersistNodeStoreStatus (0.00s)
=== RUN TestPersistVirtualNodesAssignments
--- PASS: TestPersistVirtualNodesAssignments (0.00s)
=== RUN TestBatchLogicalNodeInquiry
redis_test.go:219:
First test is starting
redis_test.go:263: Scan (2) logical nodes and actually get (2) logical nodes
redis_test.go:266: Index #(0):
redis_test.go:267: =================
redis_test.go:268: Id: (0002)
redis_test.go:269: Region: (1001)
redis_test.go:270: RP: (1001)
redis_test.go:266: Index #(1):
redis_test.go:267: =================
redis_test.go:268: Id: (0003)
redis_test.go:269: Region: (1002)
redis_test.go:270: RP: (1002)
redis_test.go:272:
First test is OK
redis_test.go:275:
Second test is starting
redis_test.go:320: Scan (10) logical nodes and actually get (10) logical nodes
redis_test.go:321:
Second test is OK
redis_test.go:324:
Third test is starting
redis_test.go:336: Scan (1000) logical nodes and actually get (1001) logical nodes
redis_test.go:337:
Third test is OK
redis_test.go:340:
Fourth test is starting
redis_test.go:352: Scan (2000) logical nodes and actually get (2000) logical nodes
redis_test.go:353:
Fouth test is OK
redis_test.go:356:
The fifth test is starting
redis_test.go:364: Scan (20000) logical nodes and actually get (10002) logical nodes
redis_test.go:365:
Fifth test is OK
--- PASS: TestBatchLogicalNodeInquiry (3.02s)
PASS
ok global-resource-service/resource-management/pkg/store/redis 3.048s
The integration test have been done successfully in AWS environment (1 service-api and 1 region simulator)
This PR is same as PR179 which has been approved, only difference is the codes are pushed from personal branch q131172019/GRS:Carl_Merge_PR167_and_PR171_Into_simulator-list-watch.
This PR is to merge PR167 and PR171 into simulator-list-watch branch to be convenient for integration test
PR167 - Should not flushall redis DB when service API starts PR171 - Change Redis default port 6379 to new port flexibly
UT test:
The integration test have been done successfully in AWS environment (1 service-api and 1 region simulator)
-- service api
--- 1 simulator
--- redis-store