阶段性提交

This commit is contained in:
GoEdgeLab
2020-09-13 20:37:28 +08:00
parent 84868c1a0b
commit dc79c661d7
89 changed files with 1364 additions and 12899 deletions

View File

@@ -3,9 +3,9 @@ package tests
import (
"context"
"encoding/json"
pb2 "github.com/TeaOSLab/EdgeAPI/internal/rpc/pb"
"github.com/TeaOSLab/EdgeAPI/internal/rpc/services"
pb "github.com/TeaOSLab/EdgeAPI/internal/tests/helloworld"
pb2 "github.com/TeaOSLab/EdgeCommon/pkg/rpc/pb"
"google.golang.org/grpc"
"google.golang.org/grpc/credentials"
"google.golang.org/grpc/metadata"
@@ -75,30 +75,6 @@ func TestTCPClient(t *testing.T) {
t.Log(time.Since(before).Seconds()*1000, "ms")
}
func TestTCPClient_Node(t *testing.T) {
conn, err := grpc.Dial("127.0.0.1:8001", grpc.WithInsecure())
if err != nil {
t.Fatal(err)
}
defer func() {
_ = conn.Close()
}()
c := pb2.NewNodeServiceClient(conn)
before := time.Now()
ctx := context.Background()
ctx = metadata.AppendToOutgoingContext(ctx, "name", "liu", "age", "20")
reply, err := c.Config(ctx, &pb2.ConfigRequest{
})
if err != nil {
t.Fatal(err)
}
t.Log(reply)
t.Log(time.Since(before).Seconds()*1000, "ms")
}
func TestTLSServer(t *testing.T) {
listener, err := net.Listen("tcp", ":8001")
if err != nil {