(t *testing.T)
| 186 | } |
| 187 | |
| 188 | func TestEncryptIncCounterSimpleArgs(t *testing.T) { |
| 189 | defer utils.RemoveAll(PubKeyStorePath + "*") |
| 190 | log.SetLevel(log.FatalLevel) |
| 191 | addr := "127.0.0.1:0" |
| 192 | masterKey := []byte("abc") |
| 193 | server, err := NewServerWithService(ServiceMap{"Test": NewTestService()}) |
| 194 | if err != nil { |
| 195 | log.Fatal(err) |
| 196 | } |
| 197 | |
| 198 | _, _ = route.NewDHTService(PubKeyStorePath, new(consistent.KMSStorage), true) |
| 199 | _ = server.InitRPCServer(addr, "../keys/test.key", masterKey) |
| 200 | go server.Serve() |
| 201 | |
| 202 | publicKey, err := kms.GetLocalPublicKey() |
| 203 | nonce := asymmetric.GetPubKeyNonce(publicKey, 10, 100*time.Millisecond, nil) |
| 204 | serverNodeID := proto.NodeID(nonce.Hash.String()) |
| 205 | _ = kms.SetPublicKey(serverNodeID, nonce.Nonce, publicKey) |
| 206 | kms.SetLocalNodeIDNonce(nonce.Hash.CloneBytes(), &nonce.Nonce) |
| 207 | _ = route.SetNodeAddrCache(&proto.RawNodeID{Hash: nonce.Hash}, server.Listener.Addr().String()) |
| 208 | |
| 209 | client, err := rpc.DialToNodeWithPool(&nilSessionPool{}, serverNodeID, false) |
| 210 | |
| 211 | repSimple := new(int32) |
| 212 | err = client.Call("Test.IncCounterSimpleArgs", 10, repSimple) |
| 213 | if err != nil { |
| 214 | log.Fatal(err) |
| 215 | } |
| 216 | CheckNum(*repSimple, 10, t) |
| 217 | |
| 218 | _ = client.Close() |
| 219 | server.Stop() |
| 220 | } |
| 221 | |
| 222 | func TestETLSBug(t *testing.T) { |
| 223 | defer utils.RemoveAll(PubKeyStorePath + "*") |
nothing calls this directly
no test coverage detected