github.com/google/syzkaller@v0.0.0-20251211124644-a066d2bc4b02/syz-verifier/rpcserver_test.go (about)

     1  // Copyright 2021 syzkaller project authors. All rights reserved.
     2  // Use of this source code is governed by Apache 2 LICENSE that can be found in the LICENSE file.
     3  
     4  // TODO: switch syz-verifier to use syz-fuzzer.
     5  
     6  //go:build ignore
     7  
     8  package main
     9  
    10  import (
    11  	"testing"
    12  
    13  	"github.com/google/go-cmp/cmp"
    14  	"github.com/google/syzkaller/pkg/rpctype"
    15  )
    16  
    17  func TestConnect(t *testing.T) {
    18  	vrf := createTestVerifier(t)
    19  	vrf.pools = make(map[int]*poolInfo)
    20  	vrf.pools[1] = &poolInfo{}
    21  
    22  	a := &rpctype.RunnerConnectArgs{
    23  		Pool: 1,
    24  		VM:   1,
    25  	}
    26  
    27  	r := &rpctype.RunnerConnectRes{}
    28  
    29  	if err := vrf.srv.Connect(a, r); err != nil {
    30  		t.Fatalf("srv.Connect failed: %v", err)
    31  	}
    32  
    33  	if diff := cmp.Diff(&rpctype.RunnerConnectRes{CheckUnsupportedCalls: true}, r); diff != "" {
    34  		t.Errorf("connect result mismatch (-want +got):\n%s", diff)
    35  	}
    36  }