virtiofs: fix error report in TestVirtiofsdStart when go test running

Initialize ctx with context.Background() instead of nil value.

Fixes: #2718

Signed-off-by: zhanghj <zhanghj.lc@inspur.com>
This commit is contained in:
zhanghj 2021-09-24 16:06:06 +08:00
parent 279f8e9d03
commit 57e3712dbd

View File

@ -70,7 +70,7 @@ func TestVirtiofsdStart(t *testing.T) {
PID: tt.fields.PID,
ctx: tt.fields.ctx,
}
var ctx context.Context
ctx := context.Background()
_, err := v.Start(ctx, nil)
if (err != nil) != tt.wantErr {
t.Errorf("virtiofsd.Start() error = %v, wantErr %v", err, tt.wantErr)