From 604a9dd673adda5cf826f3d8a848312dbfb47a7c Mon Sep 17 00:00:00 2001 From: Beraldo Leal Date: Fri, 15 Sep 2023 10:10:37 -0400 Subject: [PATCH 1/2] protocol: remove gogoprotobuff tests This is part of a bigger effort to drop gogoprotobuff from our code base. IIUC, those options are basically used by *pb_test.go, and since we are dropping gogoprotobuff and those are auto generated tests, let's just remove it. Fixes #7978. Signed-off-by: Beraldo Leal --- src/libs/protocols/protos/csi.proto | 6 - src/libs/protocols/protos/health.proto | 7 - src/libs/protocols/protos/oci.proto | 6 - .../pkg/agent/protocols/grpc/csi.pb.go | 267 +- .../pkg/agent/protocols/grpc/csipb_test.go | 585 -- .../pkg/agent/protocols/grpc/health.pb.go | 234 +- .../pkg/agent/protocols/grpc/healthpb_test.go | 585 -- .../pkg/agent/protocols/grpc/oci.pb.go | 2424 +------ .../pkg/agent/protocols/grpc/ocipb_test.go | 5821 ----------------- 9 files changed, 180 insertions(+), 9755 deletions(-) delete mode 100644 src/runtime/virtcontainers/pkg/agent/protocols/grpc/csipb_test.go delete mode 100644 src/runtime/virtcontainers/pkg/agent/protocols/grpc/healthpb_test.go delete mode 100644 src/runtime/virtcontainers/pkg/agent/protocols/grpc/ocipb_test.go diff --git a/src/libs/protocols/protos/csi.proto b/src/libs/protocols/protos/csi.proto index e6da50c8b8..94a9603b12 100644 --- a/src/libs/protocols/protos/csi.proto +++ b/src/libs/protocols/protos/csi.proto @@ -7,12 +7,6 @@ syntax = "proto3"; option go_package = "github.com/kata-containers/kata-containers/src/runtime/virtcontainers/pkg/agent/protocols/grpc"; package grpc; -import "gogo/protobuf/gogoproto/gogo.proto"; - -option (gogoproto.equal_all) = true; -option (gogoproto.populate_all) = true; -option (gogoproto.testgen_all) = true; -option (gogoproto.benchgen_all) = true; // This should be kept in sync with CSI NodeGetVolumeStatsResponse (https://github.com/container-storage-interface/spec/blob/v1.5.0/csi.proto) message VolumeStatsResponse { diff --git a/src/libs/protocols/protos/health.proto b/src/libs/protocols/protos/health.proto index e8a6601598..da72ff32e9 100644 --- a/src/libs/protocols/protos/health.proto +++ b/src/libs/protocols/protos/health.proto @@ -11,13 +11,6 @@ option go_package = "github.com/kata-containers/kata-containers/src/runtime/virt package grpc; -import "gogo/protobuf/gogoproto/gogo.proto"; - -option (gogoproto.equal_all) = true; -option (gogoproto.populate_all) = true; -option (gogoproto.testgen_all) = true; -option (gogoproto.benchgen_all) = true; - message CheckRequest { string service = 1; } diff --git a/src/libs/protocols/protos/oci.proto b/src/libs/protocols/protos/oci.proto index 081915c042..85c4ba5c3c 100644 --- a/src/libs/protocols/protos/oci.proto +++ b/src/libs/protocols/protos/oci.proto @@ -9,12 +9,6 @@ syntax = "proto3"; option go_package = "github.com/kata-containers/kata-containers/src/runtime/virtcontainers/pkg/agent/protocols/grpc"; package grpc; -import "gogo/protobuf/gogoproto/gogo.proto"; - -option (gogoproto.equal_all) = true; -option (gogoproto.populate_all) = true; -option (gogoproto.testgen_all) = true; -option (gogoproto.benchgen_all) = true; message Spec { // Version of the Open Container Initiative Runtime Specification with which the bundle complies. diff --git a/src/runtime/virtcontainers/pkg/agent/protocols/grpc/csi.pb.go b/src/runtime/virtcontainers/pkg/agent/protocols/grpc/csi.pb.go index 3fc66aec1e..56d66ac012 100644 --- a/src/runtime/virtcontainers/pkg/agent/protocols/grpc/csi.pb.go +++ b/src/runtime/virtcontainers/pkg/agent/protocols/grpc/csi.pb.go @@ -4,9 +4,7 @@ package grpc import ( - bytes "bytes" fmt "fmt" - _ "github.com/gogo/protobuf/gogoproto" proto "github.com/gogo/protobuf/proto" io "io" math "math" @@ -205,136 +203,33 @@ func init() { func init() { proto.RegisterFile("csi.proto", fileDescriptor_e099a7ef79268152) } var fileDescriptor_e099a7ef79268152 = []byte{ - // 410 bytes of a gzipped FileDescriptorProto - 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0x64, 0x92, 0xcf, 0x6b, 0xd4, 0x40, - 0x14, 0xc7, 0xf7, 0xb5, 0xd9, 0xb6, 0xfb, 0x16, 0xec, 0x3a, 0xfe, 0x20, 0x14, 0x19, 0x96, 0x5c, - 0x0c, 0x05, 0x13, 0x58, 0xff, 0x01, 0xa9, 0x16, 0x11, 0x21, 0x85, 0x59, 0x57, 0xd1, 0x83, 0x32, - 0x49, 0xc7, 0x38, 0x34, 0x99, 0x09, 0x99, 0x49, 0xce, 0x3d, 0xfa, 0xa7, 0x78, 0xf1, 0xee, 0xd1, - 0x63, 0x8f, 0x1e, 0x3d, 0xba, 0xf9, 0x2b, 0x3c, 0x4a, 0x26, 0x54, 0xd7, 0xee, 0xed, 0x7d, 0xbe, - 0xdf, 0x37, 0xef, 0x17, 0x83, 0x93, 0xcc, 0xc8, 0xa8, 0xaa, 0xb5, 0xd5, 0xc4, 0xcb, 0xeb, 0x2a, - 0x3b, 0x0a, 0x72, 0x9d, 0xeb, 0xd8, 0x29, 0x69, 0xf3, 0x31, 0xee, 0xc9, 0x81, 0x8b, 0x86, 0xcc, - 0xe0, 0x12, 0xf0, 0xce, 0x6b, 0x5d, 0x34, 0xa5, 0x58, 0x5a, 0x6e, 0x0d, 0x13, 0xa6, 0xd2, 0xca, - 0x08, 0xf2, 0x10, 0xc7, 0x8d, 0xe1, 0xb9, 0xf0, 0x61, 0xbe, 0x1b, 0x4e, 0x17, 0xb7, 0xa3, 0xbe, - 0x62, 0x34, 0x64, 0xae, 0x7a, 0x83, 0x0d, 0x3e, 0x79, 0x82, 0xb3, 0xd6, 0xa9, 0x1f, 0x32, 0xad, - 0xce, 0xa5, 0x95, 0x5a, 0xf9, 0x3b, 0x73, 0x08, 0xa7, 0x8b, 0x7b, 0x9b, 0x6f, 0x9e, 0x5e, 0x9b, - 0xec, 0xb0, 0xfd, 0x5f, 0x08, 0xbe, 0x02, 0x4e, 0x37, 0x0a, 0x93, 0x07, 0x38, 0xe1, 0x2d, 0x97, - 0x05, 0x4f, 0x8b, 0xbe, 0x3d, 0x84, 0x1e, 0xfb, 0x27, 0x90, 0xbb, 0x38, 0xb6, 0xda, 0xf2, 0xc2, - 0x35, 0xf1, 0xd8, 0x00, 0x84, 0xa0, 0xd7, 0x18, 0x71, 0xee, 0xef, 0x3a, 0xd1, 0xc5, 0xe4, 0x18, - 0xbd, 0x46, 0x49, 0xeb, 0x7b, 0x73, 0x08, 0x6f, 0x2d, 0xee, 0x6f, 0x6d, 0x10, 0xad, 0x94, 0xb4, - 0xcc, 0xe5, 0x04, 0xc7, 0xe8, 0xf5, 0x44, 0xa6, 0xb8, 0xbf, 0x4a, 0x5e, 0x26, 0x67, 0x6f, 0x92, - 0xd9, 0x88, 0x4c, 0x70, 0x7c, 0xf2, 0xf6, 0xd5, 0xe9, 0x72, 0x06, 0x04, 0x71, 0xef, 0x45, 0x72, - 0xf6, 0xec, 0x74, 0x39, 0xdb, 0x09, 0x9e, 0xe3, 0xe1, 0x8d, 0x9d, 0xc8, 0x11, 0x1e, 0xf0, 0x54, - 0xe9, 0xba, 0xe4, 0x85, 0x9b, 0xf8, 0x80, 0xfd, 0x65, 0xe2, 0xe3, 0x7e, 0x29, 0x8c, 0xbb, 0x65, - 0x3f, 0xf2, 0x84, 0x5d, 0xe3, 0xc9, 0x67, 0xb8, 0x5a, 0xd3, 0xd1, 0xcf, 0x35, 0x1d, 0xfd, 0x5e, - 0x53, 0xb8, 0xec, 0x28, 0x7c, 0xe9, 0x28, 0x7c, 0xeb, 0x28, 0x7c, 0xef, 0x28, 0x5c, 0x75, 0x14, - 0x7e, 0x74, 0x14, 0x7e, 0x75, 0x14, 0xde, 0xbd, 0xcf, 0xa5, 0xfd, 0xd4, 0xa4, 0x51, 0xa6, 0xcb, - 0xf8, 0x82, 0x5b, 0xfe, 0x28, 0xd3, 0xca, 0x72, 0xa9, 0x44, 0x6d, 0xb6, 0xd8, 0xd4, 0x59, 0x5c, - 0x37, 0xca, 0xca, 0x52, 0xc4, 0xad, 0xac, 0xed, 0x86, 0x55, 0x5d, 0xe4, 0x31, 0xcf, 0x85, 0xb2, - 0xc3, 0xaf, 0xc8, 0x74, 0x61, 0xe2, 0xfe, 0x2c, 0xe9, 0x9e, 0xe3, 0xc7, 0x7f, 0x02, 0x00, 0x00, - 0xff, 0xff, 0x62, 0xcb, 0xed, 0xf6, 0x44, 0x02, 0x00, 0x00, + // 374 bytes of a gzipped FileDescriptorProto + 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0x64, 0x91, 0x5d, 0xab, 0xd3, 0x30, + 0x1c, 0xc6, 0x97, 0x73, 0xba, 0x73, 0xd6, 0x7f, 0xc1, 0xd5, 0xf8, 0x42, 0x11, 0x29, 0xa3, 0x37, + 0x96, 0x81, 0x2d, 0xcc, 0x2f, 0x20, 0xd3, 0x21, 0x22, 0x74, 0x90, 0x39, 0x45, 0x2f, 0x94, 0xb4, + 0x0b, 0x35, 0xac, 0x4d, 0x4a, 0x93, 0x16, 0x2f, 0xf7, 0x85, 0xfc, 0x1e, 0xbb, 0xf4, 0xd2, 0x4b, + 0xd7, 0x4f, 0x22, 0xcd, 0x98, 0xce, 0xb3, 0xbb, 0xfc, 0x9e, 0xe7, 0x49, 0xfe, 0x2f, 0x01, 0x3b, + 0x53, 0x3c, 0xaa, 0x6a, 0xa9, 0x25, 0xb6, 0xf2, 0xba, 0xca, 0x82, 0x1d, 0x82, 0x07, 0x1f, 0x64, + 0xd1, 0x94, 0x6c, 0xa5, 0xa9, 0x56, 0x84, 0xa9, 0x4a, 0x0a, 0xc5, 0xf0, 0x33, 0x18, 0x36, 0x8a, + 0xe6, 0xcc, 0x43, 0x93, 0xeb, 0xd0, 0x99, 0xdd, 0x8f, 0xfa, 0x74, 0x74, 0x4c, 0xae, 0x7b, 0x83, + 0x1c, 0x7d, 0xfc, 0x12, 0xdc, 0xd6, 0xa8, 0x5f, 0x33, 0x29, 0x36, 0x5c, 0x73, 0x29, 0xbc, 0xab, + 0x09, 0x0a, 0x9d, 0xd9, 0xa3, 0xf3, 0x3b, 0xaf, 0x4e, 0x26, 0x19, 0xb7, 0xff, 0x0b, 0xc1, 0x0f, + 0x04, 0xce, 0xd9, 0xc3, 0xf8, 0x29, 0xd8, 0xb4, 0xa5, 0xbc, 0xa0, 0x69, 0xd1, 0x97, 0x47, 0xa1, + 0x45, 0xfe, 0x09, 0xf8, 0x21, 0x0c, 0xb5, 0xd4, 0xb4, 0x30, 0x45, 0x2c, 0x72, 0x04, 0x8c, 0xc1, + 0x6a, 0x14, 0xdb, 0x78, 0xd7, 0x46, 0x34, 0x67, 0x3c, 0x05, 0xab, 0x11, 0x5c, 0x7b, 0xd6, 0x04, + 0x85, 0xf7, 0x66, 0x8f, 0x2f, 0x26, 0x88, 0xd6, 0x82, 0x6b, 0x62, 0x32, 0xc1, 0x14, 0xac, 0x9e, + 0xb0, 0x03, 0xb7, 0xeb, 0xe4, 0x5d, 0xb2, 0xfc, 0x98, 0xb8, 0x03, 0x6c, 0xc3, 0x70, 0xfe, 0xe9, + 0xfd, 0x62, 0xe5, 0x22, 0x0c, 0x70, 0xf3, 0x36, 0x59, 0xbe, 0x5e, 0xac, 0xdc, 0xab, 0xe0, 0x0d, + 0x8c, 0xef, 0xcc, 0x84, 0x9f, 0xc0, 0x88, 0xa6, 0x42, 0xd6, 0x25, 0x2d, 0x4c, 0xc7, 0x23, 0xf2, + 0x97, 0xb1, 0x07, 0xb7, 0x25, 0x53, 0x66, 0x97, 0x7d, 0xcb, 0x36, 0x39, 0xe1, 0xfc, 0xfb, 0xfe, + 0xe0, 0x0f, 0x7e, 0x1d, 0xfc, 0xc1, 0xae, 0xf3, 0xd1, 0xbe, 0xf3, 0xd1, 0xcf, 0xce, 0x47, 0xbf, + 0x3b, 0x1f, 0x7d, 0xfe, 0x92, 0x73, 0xfd, 0xad, 0x49, 0xa3, 0x4c, 0x96, 0xf1, 0x96, 0x6a, 0xfa, + 0x3c, 0x93, 0x42, 0x53, 0x2e, 0x58, 0xad, 0x2e, 0x58, 0xd5, 0x59, 0x5c, 0x37, 0x42, 0xf3, 0x92, + 0xc5, 0x2d, 0xaf, 0xf5, 0x99, 0x55, 0x6d, 0xf3, 0x98, 0xe6, 0x4c, 0xe8, 0xd8, 0x7c, 0x79, 0x26, + 0x0b, 0x15, 0xf7, 0x5b, 0x48, 0x6f, 0x0c, 0xbf, 0xf8, 0x13, 0x00, 0x00, 0xff, 0xff, 0x33, 0x42, + 0x95, 0x9d, 0x0f, 0x02, 0x00, 0x00, } -func (this *VolumeStatsResponse) Equal(that interface{}) bool { - if that == nil { - return this == nil - } - - that1, ok := that.(*VolumeStatsResponse) - if !ok { - that2, ok := that.(VolumeStatsResponse) - if ok { - that1 = &that2 - } else { - return false - } - } - if that1 == nil { - return this == nil - } else if this == nil { - return false - } - if len(this.Usage) != len(that1.Usage) { - return false - } - for i := range this.Usage { - if !this.Usage[i].Equal(that1.Usage[i]) { - return false - } - } - if !this.VolumeCondition.Equal(that1.VolumeCondition) { - return false - } - if !bytes.Equal(this.XXX_unrecognized, that1.XXX_unrecognized) { - return false - } - return true -} -func (this *VolumeUsage) Equal(that interface{}) bool { - if that == nil { - return this == nil - } - - that1, ok := that.(*VolumeUsage) - if !ok { - that2, ok := that.(VolumeUsage) - if ok { - that1 = &that2 - } else { - return false - } - } - if that1 == nil { - return this == nil - } else if this == nil { - return false - } - if this.Available != that1.Available { - return false - } - if this.Total != that1.Total { - return false - } - if this.Used != that1.Used { - return false - } - if this.Unit != that1.Unit { - return false - } - if !bytes.Equal(this.XXX_unrecognized, that1.XXX_unrecognized) { - return false - } - return true -} -func (this *VolumeCondition) Equal(that interface{}) bool { - if that == nil { - return this == nil - } - - that1, ok := that.(*VolumeCondition) - if !ok { - that2, ok := that.(VolumeCondition) - if ok { - that1 = &that2 - } else { - return false - } - } - if that1 == nil { - return this == nil - } else if this == nil { - return false - } - if this.Abnormal != that1.Abnormal { - return false - } - if this.Message != that1.Message { - return false - } - if !bytes.Equal(this.XXX_unrecognized, that1.XXX_unrecognized) { - return false - } - return true -} func (m *VolumeStatsResponse) Marshal() (dAtA []byte, err error) { size := m.Size() dAtA = make([]byte, size) @@ -490,118 +385,6 @@ func encodeVarintCsi(dAtA []byte, offset int, v uint64) int { dAtA[offset] = uint8(v) return base } -func NewPopulatedVolumeStatsResponse(r randyCsi, easy bool) *VolumeStatsResponse { - this := &VolumeStatsResponse{} - if r.Intn(5) != 0 { - v1 := r.Intn(5) - this.Usage = make([]*VolumeUsage, v1) - for i := 0; i < v1; i++ { - this.Usage[i] = NewPopulatedVolumeUsage(r, easy) - } - } - if r.Intn(5) != 0 { - this.VolumeCondition = NewPopulatedVolumeCondition(r, easy) - } - if !easy && r.Intn(10) != 0 { - this.XXX_unrecognized = randUnrecognizedCsi(r, 3) - } - return this -} - -func NewPopulatedVolumeUsage(r randyCsi, easy bool) *VolumeUsage { - this := &VolumeUsage{} - this.Available = uint64(uint64(r.Uint32())) - this.Total = uint64(uint64(r.Uint32())) - this.Used = uint64(uint64(r.Uint32())) - this.Unit = VolumeUsage_Unit([]int32{0, 1, 2}[r.Intn(3)]) - if !easy && r.Intn(10) != 0 { - this.XXX_unrecognized = randUnrecognizedCsi(r, 5) - } - return this -} - -func NewPopulatedVolumeCondition(r randyCsi, easy bool) *VolumeCondition { - this := &VolumeCondition{} - this.Abnormal = bool(bool(r.Intn(2) == 0)) - this.Message = string(randStringCsi(r)) - if !easy && r.Intn(10) != 0 { - this.XXX_unrecognized = randUnrecognizedCsi(r, 3) - } - return this -} - -type randyCsi interface { - Float32() float32 - Float64() float64 - Int63() int64 - Int31() int32 - Uint32() uint32 - Intn(n int) int -} - -func randUTF8RuneCsi(r randyCsi) rune { - ru := r.Intn(62) - if ru < 10 { - return rune(ru + 48) - } else if ru < 36 { - return rune(ru + 55) - } - return rune(ru + 61) -} -func randStringCsi(r randyCsi) string { - v2 := r.Intn(100) - tmps := make([]rune, v2) - for i := 0; i < v2; i++ { - tmps[i] = randUTF8RuneCsi(r) - } - return string(tmps) -} -func randUnrecognizedCsi(r randyCsi, maxFieldNumber int) (dAtA []byte) { - l := r.Intn(5) - for i := 0; i < l; i++ { - wire := r.Intn(4) - if wire == 3 { - wire = 5 - } - fieldNumber := maxFieldNumber + r.Intn(100) - dAtA = randFieldCsi(dAtA, r, fieldNumber, wire) - } - return dAtA -} -func randFieldCsi(dAtA []byte, r randyCsi, fieldNumber int, wire int) []byte { - key := uint32(fieldNumber)<<3 | uint32(wire) - switch wire { - case 0: - dAtA = encodeVarintPopulateCsi(dAtA, uint64(key)) - v3 := r.Int63() - if r.Intn(2) == 0 { - v3 *= -1 - } - dAtA = encodeVarintPopulateCsi(dAtA, uint64(v3)) - case 1: - dAtA = encodeVarintPopulateCsi(dAtA, uint64(key)) - dAtA = append(dAtA, byte(r.Intn(256)), byte(r.Intn(256)), byte(r.Intn(256)), byte(r.Intn(256)), byte(r.Intn(256)), byte(r.Intn(256)), byte(r.Intn(256)), byte(r.Intn(256))) - case 2: - dAtA = encodeVarintPopulateCsi(dAtA, uint64(key)) - ll := r.Intn(100) - dAtA = encodeVarintPopulateCsi(dAtA, uint64(ll)) - for j := 0; j < ll; j++ { - dAtA = append(dAtA, byte(r.Intn(256))) - } - default: - dAtA = encodeVarintPopulateCsi(dAtA, uint64(key)) - dAtA = append(dAtA, byte(r.Intn(256)), byte(r.Intn(256)), byte(r.Intn(256)), byte(r.Intn(256))) - } - return dAtA -} -func encodeVarintPopulateCsi(dAtA []byte, v uint64) []byte { - for v >= 1<<7 { - dAtA = append(dAtA, uint8(uint64(v)&0x7f|0x80)) - v >>= 7 - } - dAtA = append(dAtA, uint8(v)) - return dAtA -} func (m *VolumeStatsResponse) Size() (n int) { if m == nil { return 0 diff --git a/src/runtime/virtcontainers/pkg/agent/protocols/grpc/csipb_test.go b/src/runtime/virtcontainers/pkg/agent/protocols/grpc/csipb_test.go deleted file mode 100644 index 5a1c81fd3b..0000000000 --- a/src/runtime/virtcontainers/pkg/agent/protocols/grpc/csipb_test.go +++ /dev/null @@ -1,585 +0,0 @@ -// Code generated by protoc-gen-gogo. DO NOT EDIT. -// source: csi.proto - -package grpc - -import ( - fmt "fmt" - _ "github.com/gogo/protobuf/gogoproto" - github_com_gogo_protobuf_jsonpb "github.com/gogo/protobuf/jsonpb" - github_com_gogo_protobuf_proto "github.com/gogo/protobuf/proto" - proto "github.com/gogo/protobuf/proto" - math "math" - math_rand "math/rand" - testing "testing" - time "time" -) - -// Reference imports to suppress errors if they are not otherwise used. -var _ = proto.Marshal -var _ = fmt.Errorf -var _ = math.Inf - -func TestVolumeStatsResponseProto(t *testing.T) { - seed := time.Now().UnixNano() - popr := math_rand.New(math_rand.NewSource(seed)) - p := NewPopulatedVolumeStatsResponse(popr, false) - dAtA, err := github_com_gogo_protobuf_proto.Marshal(p) - if err != nil { - t.Fatalf("seed = %d, err = %v", seed, err) - } - msg := &VolumeStatsResponse{} - if err := github_com_gogo_protobuf_proto.Unmarshal(dAtA, msg); err != nil { - t.Fatalf("seed = %d, err = %v", seed, err) - } - littlefuzz := make([]byte, len(dAtA)) - copy(littlefuzz, dAtA) - for i := range dAtA { - dAtA[i] = byte(popr.Intn(256)) - } - if !p.Equal(msg) { - t.Fatalf("seed = %d, %#v !Proto %#v", seed, msg, p) - } - if len(littlefuzz) > 0 { - fuzzamount := 100 - for i := 0; i < fuzzamount; i++ { - littlefuzz[popr.Intn(len(littlefuzz))] = byte(popr.Intn(256)) - littlefuzz = append(littlefuzz, byte(popr.Intn(256))) - } - // shouldn't panic - _ = github_com_gogo_protobuf_proto.Unmarshal(littlefuzz, msg) - } -} - -func TestVolumeStatsResponseMarshalTo(t *testing.T) { - seed := time.Now().UnixNano() - popr := math_rand.New(math_rand.NewSource(seed)) - p := NewPopulatedVolumeStatsResponse(popr, false) - size := p.Size() - dAtA := make([]byte, size) - for i := range dAtA { - dAtA[i] = byte(popr.Intn(256)) - } - _, err := p.MarshalTo(dAtA) - if err != nil { - t.Fatalf("seed = %d, err = %v", seed, err) - } - msg := &VolumeStatsResponse{} - if err := github_com_gogo_protobuf_proto.Unmarshal(dAtA, msg); err != nil { - t.Fatalf("seed = %d, err = %v", seed, err) - } - for i := range dAtA { - dAtA[i] = byte(popr.Intn(256)) - } - if !p.Equal(msg) { - t.Fatalf("seed = %d, %#v !Proto %#v", seed, msg, p) - } -} - -func BenchmarkVolumeStatsResponseProtoMarshal(b *testing.B) { - popr := math_rand.New(math_rand.NewSource(616)) - total := 0 - pops := make([]*VolumeStatsResponse, 10000) - for i := 0; i < 10000; i++ { - pops[i] = NewPopulatedVolumeStatsResponse(popr, false) - } - b.ResetTimer() - for i := 0; i < b.N; i++ { - dAtA, err := github_com_gogo_protobuf_proto.Marshal(pops[i%10000]) - if err != nil { - panic(err) - } - total += len(dAtA) - } - b.SetBytes(int64(total / b.N)) -} - -func BenchmarkVolumeStatsResponseProtoUnmarshal(b *testing.B) { - popr := math_rand.New(math_rand.NewSource(616)) - total := 0 - datas := make([][]byte, 10000) - for i := 0; i < 10000; i++ { - dAtA, err := github_com_gogo_protobuf_proto.Marshal(NewPopulatedVolumeStatsResponse(popr, false)) - if err != nil { - panic(err) - } - datas[i] = dAtA - } - msg := &VolumeStatsResponse{} - b.ResetTimer() - for i := 0; i < b.N; i++ { - total += len(datas[i%10000]) - if err := github_com_gogo_protobuf_proto.Unmarshal(datas[i%10000], msg); err != nil { - panic(err) - } - } - b.SetBytes(int64(total / b.N)) -} - -func TestVolumeUsageProto(t *testing.T) { - seed := time.Now().UnixNano() - popr := math_rand.New(math_rand.NewSource(seed)) - p := NewPopulatedVolumeUsage(popr, false) - dAtA, err := github_com_gogo_protobuf_proto.Marshal(p) - if err != nil { - t.Fatalf("seed = %d, err = %v", seed, err) - } - msg := &VolumeUsage{} - if err := github_com_gogo_protobuf_proto.Unmarshal(dAtA, msg); err != nil { - t.Fatalf("seed = %d, err = %v", seed, err) - } - littlefuzz := make([]byte, len(dAtA)) - copy(littlefuzz, dAtA) - for i := range dAtA { - dAtA[i] = byte(popr.Intn(256)) - } - if !p.Equal(msg) { - t.Fatalf("seed = %d, %#v !Proto %#v", seed, msg, p) - } - if len(littlefuzz) > 0 { - fuzzamount := 100 - for i := 0; i < fuzzamount; i++ { - littlefuzz[popr.Intn(len(littlefuzz))] = byte(popr.Intn(256)) - littlefuzz = append(littlefuzz, byte(popr.Intn(256))) - } - // shouldn't panic - _ = github_com_gogo_protobuf_proto.Unmarshal(littlefuzz, msg) - } -} - -func TestVolumeUsageMarshalTo(t *testing.T) { - seed := time.Now().UnixNano() - popr := math_rand.New(math_rand.NewSource(seed)) - p := NewPopulatedVolumeUsage(popr, false) - size := p.Size() - dAtA := make([]byte, size) - for i := range dAtA { - dAtA[i] = byte(popr.Intn(256)) - } - _, err := p.MarshalTo(dAtA) - if err != nil { - t.Fatalf("seed = %d, err = %v", seed, err) - } - msg := &VolumeUsage{} - if err := github_com_gogo_protobuf_proto.Unmarshal(dAtA, msg); err != nil { - t.Fatalf("seed = %d, err = %v", seed, err) - } - for i := range dAtA { - dAtA[i] = byte(popr.Intn(256)) - } - if !p.Equal(msg) { - t.Fatalf("seed = %d, %#v !Proto %#v", seed, msg, p) - } -} - -func BenchmarkVolumeUsageProtoMarshal(b *testing.B) { - popr := math_rand.New(math_rand.NewSource(616)) - total := 0 - pops := make([]*VolumeUsage, 10000) - for i := 0; i < 10000; i++ { - pops[i] = NewPopulatedVolumeUsage(popr, false) - } - b.ResetTimer() - for i := 0; i < b.N; i++ { - dAtA, err := github_com_gogo_protobuf_proto.Marshal(pops[i%10000]) - if err != nil { - panic(err) - } - total += len(dAtA) - } - b.SetBytes(int64(total / b.N)) -} - -func BenchmarkVolumeUsageProtoUnmarshal(b *testing.B) { - popr := math_rand.New(math_rand.NewSource(616)) - total := 0 - datas := make([][]byte, 10000) - for i := 0; i < 10000; i++ { - dAtA, err := github_com_gogo_protobuf_proto.Marshal(NewPopulatedVolumeUsage(popr, false)) - if err != nil { - panic(err) - } - datas[i] = dAtA - } - msg := &VolumeUsage{} - b.ResetTimer() - for i := 0; i < b.N; i++ { - total += len(datas[i%10000]) - if err := github_com_gogo_protobuf_proto.Unmarshal(datas[i%10000], msg); err != nil { - panic(err) - } - } - b.SetBytes(int64(total / b.N)) -} - -func TestVolumeConditionProto(t *testing.T) { - seed := time.Now().UnixNano() - popr := math_rand.New(math_rand.NewSource(seed)) - p := NewPopulatedVolumeCondition(popr, false) - dAtA, err := github_com_gogo_protobuf_proto.Marshal(p) - if err != nil { - t.Fatalf("seed = %d, err = %v", seed, err) - } - msg := &VolumeCondition{} - if err := github_com_gogo_protobuf_proto.Unmarshal(dAtA, msg); err != nil { - t.Fatalf("seed = %d, err = %v", seed, err) - } - littlefuzz := make([]byte, len(dAtA)) - copy(littlefuzz, dAtA) - for i := range dAtA { - dAtA[i] = byte(popr.Intn(256)) - } - if !p.Equal(msg) { - t.Fatalf("seed = %d, %#v !Proto %#v", seed, msg, p) - } - if len(littlefuzz) > 0 { - fuzzamount := 100 - for i := 0; i < fuzzamount; i++ { - littlefuzz[popr.Intn(len(littlefuzz))] = byte(popr.Intn(256)) - littlefuzz = append(littlefuzz, byte(popr.Intn(256))) - } - // shouldn't panic - _ = github_com_gogo_protobuf_proto.Unmarshal(littlefuzz, msg) - } -} - -func TestVolumeConditionMarshalTo(t *testing.T) { - seed := time.Now().UnixNano() - popr := math_rand.New(math_rand.NewSource(seed)) - p := NewPopulatedVolumeCondition(popr, false) - size := p.Size() - dAtA := make([]byte, size) - for i := range dAtA { - dAtA[i] = byte(popr.Intn(256)) - } - _, err := p.MarshalTo(dAtA) - if err != nil { - t.Fatalf("seed = %d, err = %v", seed, err) - } - msg := &VolumeCondition{} - if err := github_com_gogo_protobuf_proto.Unmarshal(dAtA, msg); err != nil { - t.Fatalf("seed = %d, err = %v", seed, err) - } - for i := range dAtA { - dAtA[i] = byte(popr.Intn(256)) - } - if !p.Equal(msg) { - t.Fatalf("seed = %d, %#v !Proto %#v", seed, msg, p) - } -} - -func BenchmarkVolumeConditionProtoMarshal(b *testing.B) { - popr := math_rand.New(math_rand.NewSource(616)) - total := 0 - pops := make([]*VolumeCondition, 10000) - for i := 0; i < 10000; i++ { - pops[i] = NewPopulatedVolumeCondition(popr, false) - } - b.ResetTimer() - for i := 0; i < b.N; i++ { - dAtA, err := github_com_gogo_protobuf_proto.Marshal(pops[i%10000]) - if err != nil { - panic(err) - } - total += len(dAtA) - } - b.SetBytes(int64(total / b.N)) -} - -func BenchmarkVolumeConditionProtoUnmarshal(b *testing.B) { - popr := math_rand.New(math_rand.NewSource(616)) - total := 0 - datas := make([][]byte, 10000) - for i := 0; i < 10000; i++ { - dAtA, err := github_com_gogo_protobuf_proto.Marshal(NewPopulatedVolumeCondition(popr, false)) - if err != nil { - panic(err) - } - datas[i] = dAtA - } - msg := &VolumeCondition{} - b.ResetTimer() - for i := 0; i < b.N; i++ { - total += len(datas[i%10000]) - if err := github_com_gogo_protobuf_proto.Unmarshal(datas[i%10000], msg); err != nil { - panic(err) - } - } - b.SetBytes(int64(total / b.N)) -} - -func TestVolumeStatsResponseJSON(t *testing.T) { - seed := time.Now().UnixNano() - popr := math_rand.New(math_rand.NewSource(seed)) - p := NewPopulatedVolumeStatsResponse(popr, true) - marshaler := github_com_gogo_protobuf_jsonpb.Marshaler{} - jsondata, err := marshaler.MarshalToString(p) - if err != nil { - t.Fatalf("seed = %d, err = %v", seed, err) - } - msg := &VolumeStatsResponse{} - err = github_com_gogo_protobuf_jsonpb.UnmarshalString(jsondata, msg) - if err != nil { - t.Fatalf("seed = %d, err = %v", seed, err) - } - if !p.Equal(msg) { - t.Fatalf("seed = %d, %#v !Json Equal %#v", seed, msg, p) - } -} -func TestVolumeUsageJSON(t *testing.T) { - seed := time.Now().UnixNano() - popr := math_rand.New(math_rand.NewSource(seed)) - p := NewPopulatedVolumeUsage(popr, true) - marshaler := github_com_gogo_protobuf_jsonpb.Marshaler{} - jsondata, err := marshaler.MarshalToString(p) - if err != nil { - t.Fatalf("seed = %d, err = %v", seed, err) - } - msg := &VolumeUsage{} - err = github_com_gogo_protobuf_jsonpb.UnmarshalString(jsondata, msg) - if err != nil { - t.Fatalf("seed = %d, err = %v", seed, err) - } - if !p.Equal(msg) { - t.Fatalf("seed = %d, %#v !Json Equal %#v", seed, msg, p) - } -} -func TestVolumeConditionJSON(t *testing.T) { - seed := time.Now().UnixNano() - popr := math_rand.New(math_rand.NewSource(seed)) - p := NewPopulatedVolumeCondition(popr, true) - marshaler := github_com_gogo_protobuf_jsonpb.Marshaler{} - jsondata, err := marshaler.MarshalToString(p) - if err != nil { - t.Fatalf("seed = %d, err = %v", seed, err) - } - msg := &VolumeCondition{} - err = github_com_gogo_protobuf_jsonpb.UnmarshalString(jsondata, msg) - if err != nil { - t.Fatalf("seed = %d, err = %v", seed, err) - } - if !p.Equal(msg) { - t.Fatalf("seed = %d, %#v !Json Equal %#v", seed, msg, p) - } -} -func TestVolumeStatsResponseProtoText(t *testing.T) { - seed := time.Now().UnixNano() - popr := math_rand.New(math_rand.NewSource(seed)) - p := NewPopulatedVolumeStatsResponse(popr, true) - dAtA := github_com_gogo_protobuf_proto.MarshalTextString(p) - msg := &VolumeStatsResponse{} - if err := github_com_gogo_protobuf_proto.UnmarshalText(dAtA, msg); err != nil { - t.Fatalf("seed = %d, err = %v", seed, err) - } - if !p.Equal(msg) { - t.Fatalf("seed = %d, %#v !Proto %#v", seed, msg, p) - } -} - -func TestVolumeStatsResponseProtoCompactText(t *testing.T) { - seed := time.Now().UnixNano() - popr := math_rand.New(math_rand.NewSource(seed)) - p := NewPopulatedVolumeStatsResponse(popr, true) - dAtA := github_com_gogo_protobuf_proto.CompactTextString(p) - msg := &VolumeStatsResponse{} - if err := github_com_gogo_protobuf_proto.UnmarshalText(dAtA, msg); err != nil { - t.Fatalf("seed = %d, err = %v", seed, err) - } - if !p.Equal(msg) { - t.Fatalf("seed = %d, %#v !Proto %#v", seed, msg, p) - } -} - -func TestVolumeUsageProtoText(t *testing.T) { - seed := time.Now().UnixNano() - popr := math_rand.New(math_rand.NewSource(seed)) - p := NewPopulatedVolumeUsage(popr, true) - dAtA := github_com_gogo_protobuf_proto.MarshalTextString(p) - msg := &VolumeUsage{} - if err := github_com_gogo_protobuf_proto.UnmarshalText(dAtA, msg); err != nil { - t.Fatalf("seed = %d, err = %v", seed, err) - } - if !p.Equal(msg) { - t.Fatalf("seed = %d, %#v !Proto %#v", seed, msg, p) - } -} - -func TestVolumeUsageProtoCompactText(t *testing.T) { - seed := time.Now().UnixNano() - popr := math_rand.New(math_rand.NewSource(seed)) - p := NewPopulatedVolumeUsage(popr, true) - dAtA := github_com_gogo_protobuf_proto.CompactTextString(p) - msg := &VolumeUsage{} - if err := github_com_gogo_protobuf_proto.UnmarshalText(dAtA, msg); err != nil { - t.Fatalf("seed = %d, err = %v", seed, err) - } - if !p.Equal(msg) { - t.Fatalf("seed = %d, %#v !Proto %#v", seed, msg, p) - } -} - -func TestVolumeConditionProtoText(t *testing.T) { - seed := time.Now().UnixNano() - popr := math_rand.New(math_rand.NewSource(seed)) - p := NewPopulatedVolumeCondition(popr, true) - dAtA := github_com_gogo_protobuf_proto.MarshalTextString(p) - msg := &VolumeCondition{} - if err := github_com_gogo_protobuf_proto.UnmarshalText(dAtA, msg); err != nil { - t.Fatalf("seed = %d, err = %v", seed, err) - } - if !p.Equal(msg) { - t.Fatalf("seed = %d, %#v !Proto %#v", seed, msg, p) - } -} - -func TestVolumeConditionProtoCompactText(t *testing.T) { - seed := time.Now().UnixNano() - popr := math_rand.New(math_rand.NewSource(seed)) - p := NewPopulatedVolumeCondition(popr, true) - dAtA := github_com_gogo_protobuf_proto.CompactTextString(p) - msg := &VolumeCondition{} - if err := github_com_gogo_protobuf_proto.UnmarshalText(dAtA, msg); err != nil { - t.Fatalf("seed = %d, err = %v", seed, err) - } - if !p.Equal(msg) { - t.Fatalf("seed = %d, %#v !Proto %#v", seed, msg, p) - } -} - -func TestVolumeStatsResponseSize(t *testing.T) { - seed := time.Now().UnixNano() - popr := math_rand.New(math_rand.NewSource(seed)) - p := NewPopulatedVolumeStatsResponse(popr, true) - size2 := github_com_gogo_protobuf_proto.Size(p) - dAtA, err := github_com_gogo_protobuf_proto.Marshal(p) - if err != nil { - t.Fatalf("seed = %d, err = %v", seed, err) - } - size := p.Size() - if len(dAtA) != size { - t.Errorf("seed = %d, size %v != marshalled size %v", seed, size, len(dAtA)) - } - if size2 != size { - t.Errorf("seed = %d, size %v != before marshal proto.Size %v", seed, size, size2) - } - size3 := github_com_gogo_protobuf_proto.Size(p) - if size3 != size { - t.Errorf("seed = %d, size %v != after marshal proto.Size %v", seed, size, size3) - } -} - -func BenchmarkVolumeStatsResponseSize(b *testing.B) { - popr := math_rand.New(math_rand.NewSource(616)) - total := 0 - pops := make([]*VolumeStatsResponse, 1000) - for i := 0; i < 1000; i++ { - pops[i] = NewPopulatedVolumeStatsResponse(popr, false) - } - b.ResetTimer() - for i := 0; i < b.N; i++ { - total += pops[i%1000].Size() - } - b.SetBytes(int64(total / b.N)) -} - -func TestVolumeUsageSize(t *testing.T) { - seed := time.Now().UnixNano() - popr := math_rand.New(math_rand.NewSource(seed)) - p := NewPopulatedVolumeUsage(popr, true) - size2 := github_com_gogo_protobuf_proto.Size(p) - dAtA, err := github_com_gogo_protobuf_proto.Marshal(p) - if err != nil { - t.Fatalf("seed = %d, err = %v", seed, err) - } - size := p.Size() - if len(dAtA) != size { - t.Errorf("seed = %d, size %v != marshalled size %v", seed, size, len(dAtA)) - } - if size2 != size { - t.Errorf("seed = %d, size %v != before marshal proto.Size %v", seed, size, size2) - } - size3 := github_com_gogo_protobuf_proto.Size(p) - if size3 != size { - t.Errorf("seed = %d, size %v != after marshal proto.Size %v", seed, size, size3) - } -} - -func BenchmarkVolumeUsageSize(b *testing.B) { - popr := math_rand.New(math_rand.NewSource(616)) - total := 0 - pops := make([]*VolumeUsage, 1000) - for i := 0; i < 1000; i++ { - pops[i] = NewPopulatedVolumeUsage(popr, false) - } - b.ResetTimer() - for i := 0; i < b.N; i++ { - total += pops[i%1000].Size() - } - b.SetBytes(int64(total / b.N)) -} - -func TestVolumeConditionSize(t *testing.T) { - seed := time.Now().UnixNano() - popr := math_rand.New(math_rand.NewSource(seed)) - p := NewPopulatedVolumeCondition(popr, true) - size2 := github_com_gogo_protobuf_proto.Size(p) - dAtA, err := github_com_gogo_protobuf_proto.Marshal(p) - if err != nil { - t.Fatalf("seed = %d, err = %v", seed, err) - } - size := p.Size() - if len(dAtA) != size { - t.Errorf("seed = %d, size %v != marshalled size %v", seed, size, len(dAtA)) - } - if size2 != size { - t.Errorf("seed = %d, size %v != before marshal proto.Size %v", seed, size, size2) - } - size3 := github_com_gogo_protobuf_proto.Size(p) - if size3 != size { - t.Errorf("seed = %d, size %v != after marshal proto.Size %v", seed, size, size3) - } -} - -func BenchmarkVolumeConditionSize(b *testing.B) { - popr := math_rand.New(math_rand.NewSource(616)) - total := 0 - pops := make([]*VolumeCondition, 1000) - for i := 0; i < 1000; i++ { - pops[i] = NewPopulatedVolumeCondition(popr, false) - } - b.ResetTimer() - for i := 0; i < b.N; i++ { - total += pops[i%1000].Size() - } - b.SetBytes(int64(total / b.N)) -} - -func TestVolumeStatsResponseStringer(t *testing.T) { - popr := math_rand.New(math_rand.NewSource(time.Now().UnixNano())) - p := NewPopulatedVolumeStatsResponse(popr, false) - s1 := p.String() - s2 := fmt.Sprintf("%v", p) - if s1 != s2 { - t.Fatalf("String want %v got %v", s1, s2) - } -} -func TestVolumeUsageStringer(t *testing.T) { - popr := math_rand.New(math_rand.NewSource(time.Now().UnixNano())) - p := NewPopulatedVolumeUsage(popr, false) - s1 := p.String() - s2 := fmt.Sprintf("%v", p) - if s1 != s2 { - t.Fatalf("String want %v got %v", s1, s2) - } -} -func TestVolumeConditionStringer(t *testing.T) { - popr := math_rand.New(math_rand.NewSource(time.Now().UnixNano())) - p := NewPopulatedVolumeCondition(popr, false) - s1 := p.String() - s2 := fmt.Sprintf("%v", p) - if s1 != s2 { - t.Fatalf("String want %v got %v", s1, s2) - } -} - -//These tests are generated by github.com/gogo/protobuf/plugin/testgen diff --git a/src/runtime/virtcontainers/pkg/agent/protocols/grpc/health.pb.go b/src/runtime/virtcontainers/pkg/agent/protocols/grpc/health.pb.go index 4fdde69e94..cf5fa6d133 100644 --- a/src/runtime/virtcontainers/pkg/agent/protocols/grpc/health.pb.go +++ b/src/runtime/virtcontainers/pkg/agent/protocols/grpc/health.pb.go @@ -4,11 +4,9 @@ package grpc import ( - bytes "bytes" context "context" fmt "fmt" github_com_containerd_ttrpc "github.com/containerd/ttrpc" - _ "github.com/gogo/protobuf/gogoproto" proto "github.com/gogo/protobuf/proto" io "io" math "math" @@ -184,117 +182,31 @@ func init() { func init() { proto.RegisterFile("health.proto", fileDescriptor_fdbebe66dda7cb29) } var fileDescriptor_fdbebe66dda7cb29 = []byte{ - // 382 bytes of a gzipped FileDescriptorProto - 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0x74, 0x52, 0x31, 0x4b, 0xc3, 0x40, - 0x18, 0xed, 0x15, 0x6d, 0xf1, 0x9a, 0x6a, 0x39, 0x1d, 0x6a, 0x87, 0x43, 0xe3, 0x60, 0x17, 0x13, - 0xa8, 0x20, 0xe8, 0x22, 0x28, 0xa2, 0x22, 0xa4, 0x90, 0x6a, 0x05, 0x87, 0x96, 0x34, 0x9c, 0x49, - 0x68, 0x9b, 0x8b, 0x77, 0x97, 0x2e, 0x2e, 0x8e, 0xce, 0xfe, 0x0a, 0x7f, 0x82, 0xa3, 0x63, 0x47, - 0x47, 0x47, 0x9b, 0x5f, 0xe1, 0x28, 0x77, 0x49, 0xa5, 0xc5, 0xba, 0xdd, 0x7b, 0xdf, 0x7b, 0xf7, - 0xbe, 0x77, 0x1c, 0xd4, 0x7c, 0xe2, 0x0c, 0x84, 0x6f, 0x44, 0x8c, 0x0a, 0x8a, 0x96, 0x3c, 0x16, - 0xb9, 0x35, 0xdd, 0xa3, 0x1e, 0x35, 0x15, 0xd3, 0x8b, 0xef, 0x4d, 0x89, 0x14, 0x50, 0xa7, 0x54, - 0xa9, 0xd7, 0xa1, 0x76, 0xea, 0x13, 0xb7, 0x6f, 0x93, 0x87, 0x98, 0x70, 0x81, 0xaa, 0xb0, 0xc8, - 0x09, 0x1b, 0x05, 0x2e, 0xa9, 0x82, 0x2d, 0x50, 0x5f, 0xb1, 0xa7, 0x50, 0x7f, 0x01, 0x70, 0xfd, - 0x42, 0x85, 0x64, 0x06, 0x1e, 0xd1, 0x90, 0x13, 0x74, 0x0c, 0x0b, 0x5c, 0x38, 0x22, 0xe6, 0xca, - 0xb0, 0xda, 0xd8, 0x35, 0x64, 0xb8, 0xb1, 0x40, 0x6a, 0xb4, 0xe4, 0x55, 0xa1, 0xd7, 0x52, 0x72, - 0x3b, 0xb3, 0xe9, 0x47, 0xb0, 0x3c, 0x37, 0x40, 0x25, 0x58, 0xbc, 0xb1, 0xae, 0xac, 0xe6, 0xad, - 0x55, 0xc9, 0x49, 0xd0, 0x3a, 0xb3, 0xdb, 0x97, 0xd6, 0x79, 0x05, 0xa0, 0x35, 0x58, 0xb2, 0x9a, - 0xd7, 0xdd, 0x29, 0x91, 0xd7, 0x3b, 0x70, 0xa3, 0x4d, 0x18, 0x0f, 0x68, 0x38, 0xbf, 0xd4, 0x36, - 0xd4, 0xe4, 0x16, 0xdd, 0x51, 0x3a, 0xcc, 0xba, 0x94, 0x24, 0x97, 0xe9, 0xd1, 0x0e, 0x2c, 0x3b, - 0x1e, 0x09, 0xc5, 0xaf, 0x26, 0xaf, 0x34, 0x9a, 0x22, 0x33, 0x51, 0xe3, 0x11, 0x16, 0xd2, 0x22, - 0xe8, 0x00, 0x2e, 0xab, 0x08, 0x84, 0xd2, 0x7e, 0xb3, 0xaf, 0x56, 0xdb, 0xfc, 0xb7, 0x33, 0x3a, - 0x84, 0xc5, 0x69, 0xe2, 0x22, 0x67, 0x2d, 0xe5, 0x16, 0x95, 0x38, 0x79, 0x06, 0xe3, 0x09, 0xce, - 0x7d, 0x4e, 0x70, 0xee, 0x7b, 0x82, 0xc1, 0x53, 0x82, 0xc1, 0x6b, 0x82, 0xc1, 0x5b, 0x82, 0xc1, - 0x7b, 0x82, 0xc1, 0x38, 0xc1, 0xe0, 0x23, 0xc1, 0xe0, 0x2b, 0xc1, 0xe0, 0xae, 0xe3, 0x05, 0xc2, - 0x8f, 0x7b, 0x86, 0x4b, 0x87, 0x66, 0xdf, 0x11, 0xce, 0x9e, 0x4b, 0x43, 0xe1, 0x04, 0x21, 0x61, - 0xfc, 0x0f, 0xe6, 0xcc, 0x35, 0x59, 0x1c, 0x8a, 0x60, 0x48, 0xcc, 0x51, 0xc0, 0xc4, 0xcc, 0x28, - 0xea, 0x7b, 0xa6, 0xea, 0x9f, 0xfe, 0x1a, 0x97, 0x0e, 0xb8, 0x29, 0xf7, 0xeb, 0x15, 0x14, 0xde, - 0xff, 0x09, 0x00, 0x00, 0xff, 0xff, 0x07, 0xad, 0xad, 0xb7, 0x67, 0x02, 0x00, 0x00, + // 351 bytes of a gzipped FileDescriptorProto + 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0x74, 0x52, 0xc1, 0x4a, 0xeb, 0x40, + 0x14, 0xed, 0x94, 0xf7, 0x5a, 0xde, 0x6d, 0xfa, 0x5e, 0x99, 0xe7, 0xa2, 0x76, 0x11, 0x34, 0x2e, + 0xec, 0xc6, 0x04, 0x2a, 0x08, 0xba, 0x11, 0x14, 0x51, 0x11, 0x52, 0x48, 0xb5, 0x82, 0x8b, 0x96, + 0x74, 0x18, 0x92, 0xd0, 0x76, 0x26, 0xce, 0x4c, 0x8a, 0xe0, 0xc6, 0x6f, 0xf0, 0xab, 0xba, 0x74, + 0xe9, 0xd2, 0xe6, 0x4b, 0x24, 0x93, 0x54, 0x5a, 0xac, 0xcb, 0x73, 0xee, 0x39, 0xf7, 0x9e, 0x33, + 0x0c, 0x18, 0x21, 0xf5, 0x27, 0x2a, 0xb4, 0x63, 0xc1, 0x15, 0xc7, 0xbf, 0x02, 0x11, 0x13, 0xab, + 0x0d, 0xc6, 0x79, 0x48, 0xc9, 0xd8, 0xa3, 0x8f, 0x09, 0x95, 0x0a, 0x37, 0xa1, 0x2a, 0xa9, 0x98, + 0x45, 0x84, 0x36, 0xd1, 0x0e, 0x6a, 0xff, 0xf1, 0x96, 0xd0, 0x7a, 0x45, 0xf0, 0xff, 0x4a, 0x2f, + 0x28, 0x0c, 0x32, 0xe6, 0x4c, 0x52, 0x7c, 0x0a, 0x15, 0xa9, 0x7c, 0x95, 0x48, 0x6d, 0xf8, 0xdb, + 0xd9, 0xb7, 0xb3, 0xc5, 0xf6, 0x06, 0xa9, 0xdd, 0xcb, 0x56, 0xb1, 0xa0, 0xa7, 0xe5, 0x5e, 0x61, + 0xb3, 0x4e, 0xa0, 0xbe, 0x36, 0xc0, 0x35, 0xa8, 0xde, 0xb9, 0x37, 0x6e, 0xf7, 0xde, 0x6d, 0x94, + 0x32, 0xd0, 0xbb, 0xf0, 0xfa, 0xd7, 0xee, 0x65, 0x03, 0xe1, 0x7f, 0x50, 0x73, 0xbb, 0xb7, 0xc3, + 0x25, 0x51, 0xb6, 0x06, 0xb0, 0xd5, 0xa7, 0x42, 0x46, 0x9c, 0xad, 0x87, 0xda, 0x05, 0x23, 0x4b, + 0x31, 0x9c, 0xe5, 0xc3, 0xa2, 0x4b, 0x2d, 0xe3, 0x0a, 0x3d, 0xde, 0x83, 0xba, 0x1f, 0x50, 0xa6, + 0xbe, 0x34, 0x65, 0xad, 0x31, 0x34, 0x59, 0x88, 0x3a, 0xcf, 0x50, 0xc9, 0x8b, 0xe0, 0x23, 0xf8, + 0xad, 0x4f, 0x60, 0x9c, 0xf7, 0x5b, 0x7d, 0xb5, 0xd6, 0xf6, 0x8f, 0x9d, 0xf1, 0x31, 0x54, 0x97, + 0x17, 0x37, 0x39, 0x5b, 0x39, 0xb7, 0xa9, 0xc4, 0xd9, 0xd3, 0x7c, 0x61, 0x96, 0xde, 0x17, 0x66, + 0xe9, 0x25, 0x35, 0xd1, 0x3c, 0x35, 0xd1, 0x5b, 0x6a, 0xa2, 0x8f, 0xd4, 0x44, 0x0f, 0x83, 0x20, + 0x52, 0x61, 0x32, 0xb2, 0x09, 0x9f, 0x3a, 0x63, 0x5f, 0xf9, 0x07, 0x84, 0x33, 0xe5, 0x47, 0x8c, + 0x0a, 0xf9, 0x0d, 0x4b, 0x41, 0x1c, 0x91, 0x30, 0x15, 0x4d, 0xa9, 0x33, 0x8b, 0x84, 0x5a, 0x19, + 0xc5, 0xe3, 0xc0, 0xd1, 0x75, 0x1d, 0xfd, 0x25, 0x08, 0x9f, 0x48, 0x27, 0x8b, 0x33, 0xaa, 0x68, + 0x7c, 0xf8, 0x19, 0x00, 0x00, 0xff, 0xff, 0x51, 0x9e, 0x56, 0xf8, 0x32, 0x02, 0x00, 0x00, } -func (this *CheckRequest) Equal(that interface{}) bool { - if that == nil { - return this == nil - } - - that1, ok := that.(*CheckRequest) - if !ok { - that2, ok := that.(CheckRequest) - if ok { - that1 = &that2 - } else { - return false - } - } - if that1 == nil { - return this == nil - } else if this == nil { - return false - } - if this.Service != that1.Service { - return false - } - if !bytes.Equal(this.XXX_unrecognized, that1.XXX_unrecognized) { - return false - } - return true -} -func (this *HealthCheckResponse) Equal(that interface{}) bool { - if that == nil { - return this == nil - } - - that1, ok := that.(*HealthCheckResponse) - if !ok { - that2, ok := that.(HealthCheckResponse) - if ok { - that1 = &that2 - } else { - return false - } - } - if that1 == nil { - return this == nil - } else if this == nil { - return false - } - if this.Status != that1.Status { - return false - } - if !bytes.Equal(this.XXX_unrecognized, that1.XXX_unrecognized) { - return false - } - return true -} -func (this *VersionCheckResponse) Equal(that interface{}) bool { - if that == nil { - return this == nil - } - - that1, ok := that.(*VersionCheckResponse) - if !ok { - that2, ok := that.(VersionCheckResponse) - if ok { - that1 = &that2 - } else { - return false - } - } - if that1 == nil { - return this == nil - } else if this == nil { - return false - } - if this.GrpcVersion != that1.GrpcVersion { - return false - } - if this.AgentVersion != that1.AgentVersion { - return false - } - if !bytes.Equal(this.XXX_unrecognized, that1.XXX_unrecognized) { - return false - } - return true -} func (m *CheckRequest) Marshal() (dAtA []byte, err error) { size := m.Size() dAtA = make([]byte, size) @@ -413,106 +325,6 @@ func encodeVarintHealth(dAtA []byte, offset int, v uint64) int { dAtA[offset] = uint8(v) return base } -func NewPopulatedCheckRequest(r randyHealth, easy bool) *CheckRequest { - this := &CheckRequest{} - this.Service = string(randStringHealth(r)) - if !easy && r.Intn(10) != 0 { - this.XXX_unrecognized = randUnrecognizedHealth(r, 2) - } - return this -} - -func NewPopulatedHealthCheckResponse(r randyHealth, easy bool) *HealthCheckResponse { - this := &HealthCheckResponse{} - this.Status = HealthCheckResponse_ServingStatus([]int32{0, 1, 2}[r.Intn(3)]) - if !easy && r.Intn(10) != 0 { - this.XXX_unrecognized = randUnrecognizedHealth(r, 2) - } - return this -} - -func NewPopulatedVersionCheckResponse(r randyHealth, easy bool) *VersionCheckResponse { - this := &VersionCheckResponse{} - this.GrpcVersion = string(randStringHealth(r)) - this.AgentVersion = string(randStringHealth(r)) - if !easy && r.Intn(10) != 0 { - this.XXX_unrecognized = randUnrecognizedHealth(r, 3) - } - return this -} - -type randyHealth interface { - Float32() float32 - Float64() float64 - Int63() int64 - Int31() int32 - Uint32() uint32 - Intn(n int) int -} - -func randUTF8RuneHealth(r randyHealth) rune { - ru := r.Intn(62) - if ru < 10 { - return rune(ru + 48) - } else if ru < 36 { - return rune(ru + 55) - } - return rune(ru + 61) -} -func randStringHealth(r randyHealth) string { - v1 := r.Intn(100) - tmps := make([]rune, v1) - for i := 0; i < v1; i++ { - tmps[i] = randUTF8RuneHealth(r) - } - return string(tmps) -} -func randUnrecognizedHealth(r randyHealth, maxFieldNumber int) (dAtA []byte) { - l := r.Intn(5) - for i := 0; i < l; i++ { - wire := r.Intn(4) - if wire == 3 { - wire = 5 - } - fieldNumber := maxFieldNumber + r.Intn(100) - dAtA = randFieldHealth(dAtA, r, fieldNumber, wire) - } - return dAtA -} -func randFieldHealth(dAtA []byte, r randyHealth, fieldNumber int, wire int) []byte { - key := uint32(fieldNumber)<<3 | uint32(wire) - switch wire { - case 0: - dAtA = encodeVarintPopulateHealth(dAtA, uint64(key)) - v2 := r.Int63() - if r.Intn(2) == 0 { - v2 *= -1 - } - dAtA = encodeVarintPopulateHealth(dAtA, uint64(v2)) - case 1: - dAtA = encodeVarintPopulateHealth(dAtA, uint64(key)) - dAtA = append(dAtA, byte(r.Intn(256)), byte(r.Intn(256)), byte(r.Intn(256)), byte(r.Intn(256)), byte(r.Intn(256)), byte(r.Intn(256)), byte(r.Intn(256)), byte(r.Intn(256))) - case 2: - dAtA = encodeVarintPopulateHealth(dAtA, uint64(key)) - ll := r.Intn(100) - dAtA = encodeVarintPopulateHealth(dAtA, uint64(ll)) - for j := 0; j < ll; j++ { - dAtA = append(dAtA, byte(r.Intn(256))) - } - default: - dAtA = encodeVarintPopulateHealth(dAtA, uint64(key)) - dAtA = append(dAtA, byte(r.Intn(256)), byte(r.Intn(256)), byte(r.Intn(256)), byte(r.Intn(256))) - } - return dAtA -} -func encodeVarintPopulateHealth(dAtA []byte, v uint64) []byte { - for v >= 1<<7 { - dAtA = append(dAtA, uint8(uint64(v)&0x7f|0x80)) - v >>= 7 - } - dAtA = append(dAtA, uint8(v)) - return dAtA -} func (m *CheckRequest) Size() (n int) { if m == nil { return 0 diff --git a/src/runtime/virtcontainers/pkg/agent/protocols/grpc/healthpb_test.go b/src/runtime/virtcontainers/pkg/agent/protocols/grpc/healthpb_test.go deleted file mode 100644 index 61a10475bf..0000000000 --- a/src/runtime/virtcontainers/pkg/agent/protocols/grpc/healthpb_test.go +++ /dev/null @@ -1,585 +0,0 @@ -// Code generated by protoc-gen-gogo. DO NOT EDIT. -// source: health.proto - -package grpc - -import ( - fmt "fmt" - _ "github.com/gogo/protobuf/gogoproto" - github_com_gogo_protobuf_jsonpb "github.com/gogo/protobuf/jsonpb" - github_com_gogo_protobuf_proto "github.com/gogo/protobuf/proto" - proto "github.com/gogo/protobuf/proto" - math "math" - math_rand "math/rand" - testing "testing" - time "time" -) - -// Reference imports to suppress errors if they are not otherwise used. -var _ = proto.Marshal -var _ = fmt.Errorf -var _ = math.Inf - -func TestCheckRequestProto(t *testing.T) { - seed := time.Now().UnixNano() - popr := math_rand.New(math_rand.NewSource(seed)) - p := NewPopulatedCheckRequest(popr, false) - dAtA, err := github_com_gogo_protobuf_proto.Marshal(p) - if err != nil { - t.Fatalf("seed = %d, err = %v", seed, err) - } - msg := &CheckRequest{} - if err := github_com_gogo_protobuf_proto.Unmarshal(dAtA, msg); err != nil { - t.Fatalf("seed = %d, err = %v", seed, err) - } - littlefuzz := make([]byte, len(dAtA)) - copy(littlefuzz, dAtA) - for i := range dAtA { - dAtA[i] = byte(popr.Intn(256)) - } - if !p.Equal(msg) { - t.Fatalf("seed = %d, %#v !Proto %#v", seed, msg, p) - } - if len(littlefuzz) > 0 { - fuzzamount := 100 - for i := 0; i < fuzzamount; i++ { - littlefuzz[popr.Intn(len(littlefuzz))] = byte(popr.Intn(256)) - littlefuzz = append(littlefuzz, byte(popr.Intn(256))) - } - // shouldn't panic - _ = github_com_gogo_protobuf_proto.Unmarshal(littlefuzz, msg) - } -} - -func TestCheckRequestMarshalTo(t *testing.T) { - seed := time.Now().UnixNano() - popr := math_rand.New(math_rand.NewSource(seed)) - p := NewPopulatedCheckRequest(popr, false) - size := p.Size() - dAtA := make([]byte, size) - for i := range dAtA { - dAtA[i] = byte(popr.Intn(256)) - } - _, err := p.MarshalTo(dAtA) - if err != nil { - t.Fatalf("seed = %d, err = %v", seed, err) - } - msg := &CheckRequest{} - if err := github_com_gogo_protobuf_proto.Unmarshal(dAtA, msg); err != nil { - t.Fatalf("seed = %d, err = %v", seed, err) - } - for i := range dAtA { - dAtA[i] = byte(popr.Intn(256)) - } - if !p.Equal(msg) { - t.Fatalf("seed = %d, %#v !Proto %#v", seed, msg, p) - } -} - -func BenchmarkCheckRequestProtoMarshal(b *testing.B) { - popr := math_rand.New(math_rand.NewSource(616)) - total := 0 - pops := make([]*CheckRequest, 10000) - for i := 0; i < 10000; i++ { - pops[i] = NewPopulatedCheckRequest(popr, false) - } - b.ResetTimer() - for i := 0; i < b.N; i++ { - dAtA, err := github_com_gogo_protobuf_proto.Marshal(pops[i%10000]) - if err != nil { - panic(err) - } - total += len(dAtA) - } - b.SetBytes(int64(total / b.N)) -} - -func BenchmarkCheckRequestProtoUnmarshal(b *testing.B) { - popr := math_rand.New(math_rand.NewSource(616)) - total := 0 - datas := make([][]byte, 10000) - for i := 0; i < 10000; i++ { - dAtA, err := github_com_gogo_protobuf_proto.Marshal(NewPopulatedCheckRequest(popr, false)) - if err != nil { - panic(err) - } - datas[i] = dAtA - } - msg := &CheckRequest{} - b.ResetTimer() - for i := 0; i < b.N; i++ { - total += len(datas[i%10000]) - if err := github_com_gogo_protobuf_proto.Unmarshal(datas[i%10000], msg); err != nil { - panic(err) - } - } - b.SetBytes(int64(total / b.N)) -} - -func TestHealthCheckResponseProto(t *testing.T) { - seed := time.Now().UnixNano() - popr := math_rand.New(math_rand.NewSource(seed)) - p := NewPopulatedHealthCheckResponse(popr, false) - dAtA, err := github_com_gogo_protobuf_proto.Marshal(p) - if err != nil { - t.Fatalf("seed = %d, err = %v", seed, err) - } - msg := &HealthCheckResponse{} - if err := github_com_gogo_protobuf_proto.Unmarshal(dAtA, msg); err != nil { - t.Fatalf("seed = %d, err = %v", seed, err) - } - littlefuzz := make([]byte, len(dAtA)) - copy(littlefuzz, dAtA) - for i := range dAtA { - dAtA[i] = byte(popr.Intn(256)) - } - if !p.Equal(msg) { - t.Fatalf("seed = %d, %#v !Proto %#v", seed, msg, p) - } - if len(littlefuzz) > 0 { - fuzzamount := 100 - for i := 0; i < fuzzamount; i++ { - littlefuzz[popr.Intn(len(littlefuzz))] = byte(popr.Intn(256)) - littlefuzz = append(littlefuzz, byte(popr.Intn(256))) - } - // shouldn't panic - _ = github_com_gogo_protobuf_proto.Unmarshal(littlefuzz, msg) - } -} - -func TestHealthCheckResponseMarshalTo(t *testing.T) { - seed := time.Now().UnixNano() - popr := math_rand.New(math_rand.NewSource(seed)) - p := NewPopulatedHealthCheckResponse(popr, false) - size := p.Size() - dAtA := make([]byte, size) - for i := range dAtA { - dAtA[i] = byte(popr.Intn(256)) - } - _, err := p.MarshalTo(dAtA) - if err != nil { - t.Fatalf("seed = %d, err = %v", seed, err) - } - msg := &HealthCheckResponse{} - if err := github_com_gogo_protobuf_proto.Unmarshal(dAtA, msg); err != nil { - t.Fatalf("seed = %d, err = %v", seed, err) - } - for i := range dAtA { - dAtA[i] = byte(popr.Intn(256)) - } - if !p.Equal(msg) { - t.Fatalf("seed = %d, %#v !Proto %#v", seed, msg, p) - } -} - -func BenchmarkHealthCheckResponseProtoMarshal(b *testing.B) { - popr := math_rand.New(math_rand.NewSource(616)) - total := 0 - pops := make([]*HealthCheckResponse, 10000) - for i := 0; i < 10000; i++ { - pops[i] = NewPopulatedHealthCheckResponse(popr, false) - } - b.ResetTimer() - for i := 0; i < b.N; i++ { - dAtA, err := github_com_gogo_protobuf_proto.Marshal(pops[i%10000]) - if err != nil { - panic(err) - } - total += len(dAtA) - } - b.SetBytes(int64(total / b.N)) -} - -func BenchmarkHealthCheckResponseProtoUnmarshal(b *testing.B) { - popr := math_rand.New(math_rand.NewSource(616)) - total := 0 - datas := make([][]byte, 10000) - for i := 0; i < 10000; i++ { - dAtA, err := github_com_gogo_protobuf_proto.Marshal(NewPopulatedHealthCheckResponse(popr, false)) - if err != nil { - panic(err) - } - datas[i] = dAtA - } - msg := &HealthCheckResponse{} - b.ResetTimer() - for i := 0; i < b.N; i++ { - total += len(datas[i%10000]) - if err := github_com_gogo_protobuf_proto.Unmarshal(datas[i%10000], msg); err != nil { - panic(err) - } - } - b.SetBytes(int64(total / b.N)) -} - -func TestVersionCheckResponseProto(t *testing.T) { - seed := time.Now().UnixNano() - popr := math_rand.New(math_rand.NewSource(seed)) - p := NewPopulatedVersionCheckResponse(popr, false) - dAtA, err := github_com_gogo_protobuf_proto.Marshal(p) - if err != nil { - t.Fatalf("seed = %d, err = %v", seed, err) - } - msg := &VersionCheckResponse{} - if err := github_com_gogo_protobuf_proto.Unmarshal(dAtA, msg); err != nil { - t.Fatalf("seed = %d, err = %v", seed, err) - } - littlefuzz := make([]byte, len(dAtA)) - copy(littlefuzz, dAtA) - for i := range dAtA { - dAtA[i] = byte(popr.Intn(256)) - } - if !p.Equal(msg) { - t.Fatalf("seed = %d, %#v !Proto %#v", seed, msg, p) - } - if len(littlefuzz) > 0 { - fuzzamount := 100 - for i := 0; i < fuzzamount; i++ { - littlefuzz[popr.Intn(len(littlefuzz))] = byte(popr.Intn(256)) - littlefuzz = append(littlefuzz, byte(popr.Intn(256))) - } - // shouldn't panic - _ = github_com_gogo_protobuf_proto.Unmarshal(littlefuzz, msg) - } -} - -func TestVersionCheckResponseMarshalTo(t *testing.T) { - seed := time.Now().UnixNano() - popr := math_rand.New(math_rand.NewSource(seed)) - p := NewPopulatedVersionCheckResponse(popr, false) - size := p.Size() - dAtA := make([]byte, size) - for i := range dAtA { - dAtA[i] = byte(popr.Intn(256)) - } - _, err := p.MarshalTo(dAtA) - if err != nil { - t.Fatalf("seed = %d, err = %v", seed, err) - } - msg := &VersionCheckResponse{} - if err := github_com_gogo_protobuf_proto.Unmarshal(dAtA, msg); err != nil { - t.Fatalf("seed = %d, err = %v", seed, err) - } - for i := range dAtA { - dAtA[i] = byte(popr.Intn(256)) - } - if !p.Equal(msg) { - t.Fatalf("seed = %d, %#v !Proto %#v", seed, msg, p) - } -} - -func BenchmarkVersionCheckResponseProtoMarshal(b *testing.B) { - popr := math_rand.New(math_rand.NewSource(616)) - total := 0 - pops := make([]*VersionCheckResponse, 10000) - for i := 0; i < 10000; i++ { - pops[i] = NewPopulatedVersionCheckResponse(popr, false) - } - b.ResetTimer() - for i := 0; i < b.N; i++ { - dAtA, err := github_com_gogo_protobuf_proto.Marshal(pops[i%10000]) - if err != nil { - panic(err) - } - total += len(dAtA) - } - b.SetBytes(int64(total / b.N)) -} - -func BenchmarkVersionCheckResponseProtoUnmarshal(b *testing.B) { - popr := math_rand.New(math_rand.NewSource(616)) - total := 0 - datas := make([][]byte, 10000) - for i := 0; i < 10000; i++ { - dAtA, err := github_com_gogo_protobuf_proto.Marshal(NewPopulatedVersionCheckResponse(popr, false)) - if err != nil { - panic(err) - } - datas[i] = dAtA - } - msg := &VersionCheckResponse{} - b.ResetTimer() - for i := 0; i < b.N; i++ { - total += len(datas[i%10000]) - if err := github_com_gogo_protobuf_proto.Unmarshal(datas[i%10000], msg); err != nil { - panic(err) - } - } - b.SetBytes(int64(total / b.N)) -} - -func TestCheckRequestJSON(t *testing.T) { - seed := time.Now().UnixNano() - popr := math_rand.New(math_rand.NewSource(seed)) - p := NewPopulatedCheckRequest(popr, true) - marshaler := github_com_gogo_protobuf_jsonpb.Marshaler{} - jsondata, err := marshaler.MarshalToString(p) - if err != nil { - t.Fatalf("seed = %d, err = %v", seed, err) - } - msg := &CheckRequest{} - err = github_com_gogo_protobuf_jsonpb.UnmarshalString(jsondata, msg) - if err != nil { - t.Fatalf("seed = %d, err = %v", seed, err) - } - if !p.Equal(msg) { - t.Fatalf("seed = %d, %#v !Json Equal %#v", seed, msg, p) - } -} -func TestHealthCheckResponseJSON(t *testing.T) { - seed := time.Now().UnixNano() - popr := math_rand.New(math_rand.NewSource(seed)) - p := NewPopulatedHealthCheckResponse(popr, true) - marshaler := github_com_gogo_protobuf_jsonpb.Marshaler{} - jsondata, err := marshaler.MarshalToString(p) - if err != nil { - t.Fatalf("seed = %d, err = %v", seed, err) - } - msg := &HealthCheckResponse{} - err = github_com_gogo_protobuf_jsonpb.UnmarshalString(jsondata, msg) - if err != nil { - t.Fatalf("seed = %d, err = %v", seed, err) - } - if !p.Equal(msg) { - t.Fatalf("seed = %d, %#v !Json Equal %#v", seed, msg, p) - } -} -func TestVersionCheckResponseJSON(t *testing.T) { - seed := time.Now().UnixNano() - popr := math_rand.New(math_rand.NewSource(seed)) - p := NewPopulatedVersionCheckResponse(popr, true) - marshaler := github_com_gogo_protobuf_jsonpb.Marshaler{} - jsondata, err := marshaler.MarshalToString(p) - if err != nil { - t.Fatalf("seed = %d, err = %v", seed, err) - } - msg := &VersionCheckResponse{} - err = github_com_gogo_protobuf_jsonpb.UnmarshalString(jsondata, msg) - if err != nil { - t.Fatalf("seed = %d, err = %v", seed, err) - } - if !p.Equal(msg) { - t.Fatalf("seed = %d, %#v !Json Equal %#v", seed, msg, p) - } -} -func TestCheckRequestProtoText(t *testing.T) { - seed := time.Now().UnixNano() - popr := math_rand.New(math_rand.NewSource(seed)) - p := NewPopulatedCheckRequest(popr, true) - dAtA := github_com_gogo_protobuf_proto.MarshalTextString(p) - msg := &CheckRequest{} - if err := github_com_gogo_protobuf_proto.UnmarshalText(dAtA, msg); err != nil { - t.Fatalf("seed = %d, err = %v", seed, err) - } - if !p.Equal(msg) { - t.Fatalf("seed = %d, %#v !Proto %#v", seed, msg, p) - } -} - -func TestCheckRequestProtoCompactText(t *testing.T) { - seed := time.Now().UnixNano() - popr := math_rand.New(math_rand.NewSource(seed)) - p := NewPopulatedCheckRequest(popr, true) - dAtA := github_com_gogo_protobuf_proto.CompactTextString(p) - msg := &CheckRequest{} - if err := github_com_gogo_protobuf_proto.UnmarshalText(dAtA, msg); err != nil { - t.Fatalf("seed = %d, err = %v", seed, err) - } - if !p.Equal(msg) { - t.Fatalf("seed = %d, %#v !Proto %#v", seed, msg, p) - } -} - -func TestHealthCheckResponseProtoText(t *testing.T) { - seed := time.Now().UnixNano() - popr := math_rand.New(math_rand.NewSource(seed)) - p := NewPopulatedHealthCheckResponse(popr, true) - dAtA := github_com_gogo_protobuf_proto.MarshalTextString(p) - msg := &HealthCheckResponse{} - if err := github_com_gogo_protobuf_proto.UnmarshalText(dAtA, msg); err != nil { - t.Fatalf("seed = %d, err = %v", seed, err) - } - if !p.Equal(msg) { - t.Fatalf("seed = %d, %#v !Proto %#v", seed, msg, p) - } -} - -func TestHealthCheckResponseProtoCompactText(t *testing.T) { - seed := time.Now().UnixNano() - popr := math_rand.New(math_rand.NewSource(seed)) - p := NewPopulatedHealthCheckResponse(popr, true) - dAtA := github_com_gogo_protobuf_proto.CompactTextString(p) - msg := &HealthCheckResponse{} - if err := github_com_gogo_protobuf_proto.UnmarshalText(dAtA, msg); err != nil { - t.Fatalf("seed = %d, err = %v", seed, err) - } - if !p.Equal(msg) { - t.Fatalf("seed = %d, %#v !Proto %#v", seed, msg, p) - } -} - -func TestVersionCheckResponseProtoText(t *testing.T) { - seed := time.Now().UnixNano() - popr := math_rand.New(math_rand.NewSource(seed)) - p := NewPopulatedVersionCheckResponse(popr, true) - dAtA := github_com_gogo_protobuf_proto.MarshalTextString(p) - msg := &VersionCheckResponse{} - if err := github_com_gogo_protobuf_proto.UnmarshalText(dAtA, msg); err != nil { - t.Fatalf("seed = %d, err = %v", seed, err) - } - if !p.Equal(msg) { - t.Fatalf("seed = %d, %#v !Proto %#v", seed, msg, p) - } -} - -func TestVersionCheckResponseProtoCompactText(t *testing.T) { - seed := time.Now().UnixNano() - popr := math_rand.New(math_rand.NewSource(seed)) - p := NewPopulatedVersionCheckResponse(popr, true) - dAtA := github_com_gogo_protobuf_proto.CompactTextString(p) - msg := &VersionCheckResponse{} - if err := github_com_gogo_protobuf_proto.UnmarshalText(dAtA, msg); err != nil { - t.Fatalf("seed = %d, err = %v", seed, err) - } - if !p.Equal(msg) { - t.Fatalf("seed = %d, %#v !Proto %#v", seed, msg, p) - } -} - -func TestCheckRequestSize(t *testing.T) { - seed := time.Now().UnixNano() - popr := math_rand.New(math_rand.NewSource(seed)) - p := NewPopulatedCheckRequest(popr, true) - size2 := github_com_gogo_protobuf_proto.Size(p) - dAtA, err := github_com_gogo_protobuf_proto.Marshal(p) - if err != nil { - t.Fatalf("seed = %d, err = %v", seed, err) - } - size := p.Size() - if len(dAtA) != size { - t.Errorf("seed = %d, size %v != marshalled size %v", seed, size, len(dAtA)) - } - if size2 != size { - t.Errorf("seed = %d, size %v != before marshal proto.Size %v", seed, size, size2) - } - size3 := github_com_gogo_protobuf_proto.Size(p) - if size3 != size { - t.Errorf("seed = %d, size %v != after marshal proto.Size %v", seed, size, size3) - } -} - -func BenchmarkCheckRequestSize(b *testing.B) { - popr := math_rand.New(math_rand.NewSource(616)) - total := 0 - pops := make([]*CheckRequest, 1000) - for i := 0; i < 1000; i++ { - pops[i] = NewPopulatedCheckRequest(popr, false) - } - b.ResetTimer() - for i := 0; i < b.N; i++ { - total += pops[i%1000].Size() - } - b.SetBytes(int64(total / b.N)) -} - -func TestHealthCheckResponseSize(t *testing.T) { - seed := time.Now().UnixNano() - popr := math_rand.New(math_rand.NewSource(seed)) - p := NewPopulatedHealthCheckResponse(popr, true) - size2 := github_com_gogo_protobuf_proto.Size(p) - dAtA, err := github_com_gogo_protobuf_proto.Marshal(p) - if err != nil { - t.Fatalf("seed = %d, err = %v", seed, err) - } - size := p.Size() - if len(dAtA) != size { - t.Errorf("seed = %d, size %v != marshalled size %v", seed, size, len(dAtA)) - } - if size2 != size { - t.Errorf("seed = %d, size %v != before marshal proto.Size %v", seed, size, size2) - } - size3 := github_com_gogo_protobuf_proto.Size(p) - if size3 != size { - t.Errorf("seed = %d, size %v != after marshal proto.Size %v", seed, size, size3) - } -} - -func BenchmarkHealthCheckResponseSize(b *testing.B) { - popr := math_rand.New(math_rand.NewSource(616)) - total := 0 - pops := make([]*HealthCheckResponse, 1000) - for i := 0; i < 1000; i++ { - pops[i] = NewPopulatedHealthCheckResponse(popr, false) - } - b.ResetTimer() - for i := 0; i < b.N; i++ { - total += pops[i%1000].Size() - } - b.SetBytes(int64(total / b.N)) -} - -func TestVersionCheckResponseSize(t *testing.T) { - seed := time.Now().UnixNano() - popr := math_rand.New(math_rand.NewSource(seed)) - p := NewPopulatedVersionCheckResponse(popr, true) - size2 := github_com_gogo_protobuf_proto.Size(p) - dAtA, err := github_com_gogo_protobuf_proto.Marshal(p) - if err != nil { - t.Fatalf("seed = %d, err = %v", seed, err) - } - size := p.Size() - if len(dAtA) != size { - t.Errorf("seed = %d, size %v != marshalled size %v", seed, size, len(dAtA)) - } - if size2 != size { - t.Errorf("seed = %d, size %v != before marshal proto.Size %v", seed, size, size2) - } - size3 := github_com_gogo_protobuf_proto.Size(p) - if size3 != size { - t.Errorf("seed = %d, size %v != after marshal proto.Size %v", seed, size, size3) - } -} - -func BenchmarkVersionCheckResponseSize(b *testing.B) { - popr := math_rand.New(math_rand.NewSource(616)) - total := 0 - pops := make([]*VersionCheckResponse, 1000) - for i := 0; i < 1000; i++ { - pops[i] = NewPopulatedVersionCheckResponse(popr, false) - } - b.ResetTimer() - for i := 0; i < b.N; i++ { - total += pops[i%1000].Size() - } - b.SetBytes(int64(total / b.N)) -} - -func TestCheckRequestStringer(t *testing.T) { - popr := math_rand.New(math_rand.NewSource(time.Now().UnixNano())) - p := NewPopulatedCheckRequest(popr, false) - s1 := p.String() - s2 := fmt.Sprintf("%v", p) - if s1 != s2 { - t.Fatalf("String want %v got %v", s1, s2) - } -} -func TestHealthCheckResponseStringer(t *testing.T) { - popr := math_rand.New(math_rand.NewSource(time.Now().UnixNano())) - p := NewPopulatedHealthCheckResponse(popr, false) - s1 := p.String() - s2 := fmt.Sprintf("%v", p) - if s1 != s2 { - t.Fatalf("String want %v got %v", s1, s2) - } -} -func TestVersionCheckResponseStringer(t *testing.T) { - popr := math_rand.New(math_rand.NewSource(time.Now().UnixNano())) - p := NewPopulatedVersionCheckResponse(popr, false) - s1 := p.String() - s2 := fmt.Sprintf("%v", p) - if s1 != s2 { - t.Fatalf("String want %v got %v", s1, s2) - } -} - -//These tests are generated by github.com/gogo/protobuf/plugin/testgen diff --git a/src/runtime/virtcontainers/pkg/agent/protocols/grpc/oci.pb.go b/src/runtime/virtcontainers/pkg/agent/protocols/grpc/oci.pb.go index d8dd74e6fe..f905bbb332 100644 --- a/src/runtime/virtcontainers/pkg/agent/protocols/grpc/oci.pb.go +++ b/src/runtime/virtcontainers/pkg/agent/protocols/grpc/oci.pb.go @@ -4,9 +4,7 @@ package grpc import ( - bytes "bytes" fmt "fmt" - _ "github.com/gogo/protobuf/gogoproto" proto "github.com/gogo/protobuf/proto" github_com_gogo_protobuf_sortkeys "github.com/gogo/protobuf/sortkeys" io "io" @@ -1439,7 +1437,6 @@ var xxx_messageInfo_LinuxSyscall proto.InternalMessageInfo type isLinuxSyscall_ErrnoRet interface { isLinuxSyscall_ErrnoRet() - Equal(interface{}) bool MarshalTo([]byte) (int, error) Size() int } @@ -1551,1533 +1548,140 @@ func init() { func init() { proto.RegisterFile("oci.proto", fileDescriptor_ec5cd479a36aec97) } var fileDescriptor_ec5cd479a36aec97 = []byte{ - // 2126 bytes of a gzipped FileDescriptorProto - 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xa4, 0x58, 0x4d, 0x6f, 0x1b, 0xc7, - 0xf9, 0xf7, 0x92, 0x14, 0x45, 0x0e, 0x4d, 0xd9, 0x9e, 0x38, 0xce, 0xfe, 0xfd, 0x37, 0x58, 0x65, - 0x13, 0xa4, 0x4a, 0x93, 0x4a, 0xad, 0x9c, 0x06, 0xe9, 0x2b, 0x4a, 0x51, 0xb6, 0x45, 0x44, 0x32, - 0x99, 0xa1, 0x14, 0x17, 0x39, 0x04, 0x18, 0x2d, 0x87, 0xe4, 0x44, 0xcb, 0x9d, 0xc5, 0xcc, 0x50, - 0xb2, 0x7a, 0x6a, 0x6f, 0xbd, 0xe6, 0x03, 0x14, 0x68, 0x4f, 0xed, 0xa9, 0xe7, 0x1e, 0xdb, 0x5b, - 0xd0, 0x4b, 0x0b, 0xf4, 0x52, 0xa0, 0x97, 0x5a, 0x9f, 0xa2, 0xc7, 0xe2, 0x99, 0x99, 0x5d, 0x0e, - 0x49, 0x39, 0xe9, 0xcb, 0x6d, 0x9e, 0xdf, 0xf3, 0x32, 0x2f, 0xcf, 0xeb, 0x2e, 0xaa, 0x8b, 0x98, - 0x6f, 0x67, 0x52, 0x68, 0x81, 0x2b, 0x63, 0x99, 0xc5, 0xf7, 0xa3, 0xb1, 0x18, 0x8b, 0x1d, 0x83, - 0x9c, 0xce, 0x46, 0x3b, 0x40, 0x19, 0xc2, 0xac, 0xac, 0x64, 0xf4, 0xc7, 0x32, 0xaa, 0x0c, 0x32, - 0x16, 0xe3, 0x10, 0xad, 0x7f, 0xcc, 0xa4, 0xe2, 0x22, 0x0d, 0x83, 0xcd, 0x60, 0xab, 0x4e, 0x72, - 0x12, 0x7f, 0x1d, 0xad, 0xf7, 0xa5, 0x88, 0x99, 0x52, 0x61, 0x69, 0x33, 0xd8, 0x6a, 0xec, 0x36, - 0xb7, 0xc1, 0xfc, 0xb6, 0x03, 0x49, 0xce, 0xc5, 0x2d, 0x54, 0x21, 0x42, 0xe8, 0xb0, 0x6c, 0xa4, - 0x90, 0x95, 0x02, 0x84, 0x18, 0x1c, 0xdf, 0x47, 0xb5, 0x03, 0xa1, 0x74, 0x4a, 0xa7, 0x2c, 0xac, - 0x98, 0x3d, 0x0a, 0x1a, 0xbf, 0x81, 0xaa, 0x47, 0x62, 0x96, 0x6a, 0x15, 0xae, 0x6d, 0x96, 0xb7, - 0x1a, 0xbb, 0x0d, 0xab, 0x6d, 0x30, 0xe2, 0x58, 0xf8, 0x75, 0xb4, 0x76, 0x20, 0xc4, 0x99, 0x0a, - 0xab, 0x66, 0x07, 0x27, 0x63, 0x20, 0x62, 0x39, 0xf8, 0x87, 0xa8, 0xd1, 0x4e, 0x53, 0xa1, 0xa9, - 0xe6, 0x22, 0x55, 0xe1, 0xba, 0x31, 0xf6, 0xff, 0x56, 0x10, 0xee, 0xb9, 0xed, 0x71, 0x1f, 0xa5, - 0x5a, 0x5e, 0x12, 0x5f, 0x1e, 0x76, 0x38, 0xe4, 0xe9, 0xec, 0x79, 0x58, 0xf3, 0x77, 0x30, 0x10, - 0xb1, 0x1c, 0x78, 0x8e, 0x81, 0x48, 0xa8, 0xe4, 0x2a, 0xac, 0xfb, 0xcf, 0xe1, 0x40, 0x92, 0x73, - 0x41, 0xf0, 0x19, 0x4f, 0x87, 0xe2, 0x42, 0x85, 0xc8, 0x17, 0x74, 0x20, 0xc9, 0xb9, 0xf7, 0x7f, - 0x84, 0x6e, 0x2f, 0x9f, 0x0a, 0xdf, 0x46, 0xe5, 0x33, 0x76, 0xe9, 0x5c, 0x01, 0x4b, 0x7c, 0x17, - 0xad, 0x9d, 0xd3, 0x64, 0xc6, 0x8c, 0x13, 0xea, 0xc4, 0x12, 0xdf, 0x2b, 0x7d, 0x10, 0x44, 0xbf, - 0x2b, 0x17, 0x1e, 0x82, 0x37, 0x3e, 0x66, 0x72, 0xca, 0x53, 0x9a, 0x18, 0xe5, 0x1a, 0x29, 0x68, - 0xfc, 0x0e, 0x6a, 0x74, 0x44, 0xaa, 0x44, 0xc2, 0x06, 0xfc, 0xa7, 0xcc, 0x39, 0xb3, 0x6e, 0x0f, - 0xb5, 0x27, 0x9e, 0x13, 0x9f, 0x0b, 0xce, 0x3c, 0x51, 0x4c, 0x2e, 0x3a, 0x13, 0x10, 0x62, 0x70, - 0x8c, 0x51, 0xa5, 0x2d, 0xc7, 0x2a, 0xac, 0x6c, 0x96, 0xb7, 0xea, 0xc4, 0xac, 0xe1, 0xd0, 0x8f, - 0xd2, 0x73, 0xe3, 0xc1, 0x3a, 0x81, 0x25, 0x20, 0x9d, 0x8b, 0xa1, 0xf1, 0x57, 0x9d, 0xc0, 0x12, - 0x7f, 0x1f, 0xdd, 0xec, 0xd0, 0x8c, 0x9e, 0xf2, 0x84, 0x6b, 0xce, 0xc0, 0x43, 0x60, 0xff, 0x35, - 0xef, 0xa1, 0x7d, 0x36, 0x59, 0x10, 0xc6, 0xef, 0xa0, 0x75, 0x92, 0xf0, 0x29, 0xd7, 0x2a, 0xac, - 0x19, 0xcf, 0xde, 0x71, 0xa1, 0xd8, 0x1b, 0x74, 0x7f, 0x62, 0x39, 0x24, 0x97, 0xc0, 0x5b, 0xe8, - 0xd6, 0x53, 0xf1, 0x94, 0x5d, 0xf4, 0x25, 0x3f, 0xe7, 0x09, 0x1b, 0x33, 0xeb, 0xb0, 0x1a, 0x59, - 0x86, 0x41, 0xb2, 0x9d, 0x65, 0x54, 0x4e, 0x85, 0xec, 0x4b, 0x31, 0xe2, 0x09, 0x33, 0x1e, 0xab, - 0x93, 0x65, 0x18, 0x6f, 0xa2, 0x46, 0xaf, 0x77, 0x34, 0x88, 0x85, 0x64, 0xed, 0xe1, 0x67, 0x61, - 0x63, 0x33, 0xd8, 0x2a, 0x13, 0x1f, 0xc2, 0x11, 0xba, 0x39, 0x60, 0x09, 0xdc, 0xe3, 0x90, 0x9e, - 0xb2, 0x24, 0xbc, 0x69, 0x0c, 0x2d, 0x60, 0xd1, 0x43, 0x54, 0xde, 0x13, 0xcf, 0xf1, 0x3d, 0x54, - 0x3d, 0x60, 0x7c, 0x3c, 0xd1, 0xc6, 0x53, 0x4d, 0xe2, 0x28, 0xf0, 0xf4, 0x33, 0x3e, 0xd4, 0x13, - 0xe3, 0xa1, 0x26, 0xb1, 0x44, 0x94, 0x5a, 0x87, 0xc0, 0x93, 0x9e, 0x74, 0xf7, 0x9d, 0x0a, 0x2c, - 0x01, 0x79, 0xd2, 0xdd, 0x77, 0xd2, 0xb0, 0xc4, 0x6f, 0xa1, 0x8d, 0xf6, 0x70, 0xc8, 0x21, 0x9e, - 0x68, 0xf2, 0x84, 0x0f, 0x55, 0x58, 0xde, 0x2c, 0x6f, 0x35, 0xc9, 0x12, 0x0a, 0xd1, 0x02, 0x36, - 0xfd, 0x8c, 0xcc, 0xe9, 0xe8, 0x37, 0x01, 0xba, 0xb3, 0xe2, 0x0f, 0xd0, 0xd8, 0x13, 0xb3, 0x74, - 0xc8, 0xd3, 0x71, 0x18, 0x18, 0x3f, 0x17, 0x34, 0x7e, 0x80, 0xea, 0x8f, 0x46, 0x23, 0x16, 0x6b, - 0x7e, 0x0e, 0xd1, 0x05, 0xcc, 0x39, 0x00, 0x4f, 0xd7, 0x4d, 0x27, 0x4c, 0x72, 0x4d, 0x4f, 0x13, - 0x66, 0x0e, 0x54, 0x27, 0x3e, 0x04, 0xfa, 0x7d, 0x88, 0x55, 0xad, 0xd9, 0xd0, 0xc5, 0xd5, 0x1c, - 0x80, 0x02, 0xd5, 0x9e, 0x9e, 0x72, 0x96, 0x6a, 0x17, 0x60, 0x39, 0x19, 0x75, 0x51, 0xc3, 0x0b, - 0x00, 0x88, 0xcc, 0xe3, 0xcb, 0x8c, 0xb9, 0xdc, 0x31, 0x6b, 0xc0, 0x0e, 0xa8, 0x1c, 0x9a, 0x37, - 0xaa, 0x10, 0xb3, 0x06, 0x6c, 0x20, 0x46, 0xb6, 0x5c, 0x55, 0x88, 0x59, 0x47, 0x02, 0xad, 0x99, - 0x5a, 0x03, 0xa7, 0x1d, 0x32, 0xa5, 0x79, 0x6a, 0x92, 0xd2, 0xd9, 0xf2, 0x21, 0xf0, 0x9e, 0x12, - 0x33, 0x19, 0xe7, 0x09, 0xe9, 0x28, 0x30, 0xab, 0x61, 0xfb, 0xb2, 0xdd, 0x1e, 0xd6, 0x70, 0x76, - 0x91, 0xd9, 0x8a, 0x64, 0xef, 0x95, 0x93, 0xd1, 0xfb, 0xb6, 0x66, 0x82, 0x56, 0x9f, 0xea, 0x49, - 0x7e, 0x68, 0x58, 0xc3, 0x5b, 0x13, 0x46, 0x87, 0x22, 0x4d, 0x2e, 0xcd, 0x1e, 0x35, 0x52, 0xd0, - 0xd1, 0x2f, 0x4b, 0xae, 0x16, 0xe2, 0xb7, 0x50, 0xad, 0x2f, 0x99, 0xd2, 0x54, 0x6a, 0xe3, 0x91, - 0x22, 0x59, 0x81, 0x4d, 0x0a, 0x1e, 0xde, 0x42, 0xf5, 0xbe, 0x50, 0xda, 0x0a, 0x96, 0x56, 0x04, - 0xe7, 0x4c, 0x63, 0xd1, 0x10, 0x22, 0x33, 0x6e, 0x5a, 0xb6, 0xe8, 0x78, 0xf8, 0x5b, 0xa8, 0xd9, - 0x91, 0x8c, 0x6a, 0x46, 0x66, 0xa9, 0xe6, 0x26, 0x84, 0x96, 0x85, 0x17, 0x05, 0xf0, 0x7b, 0xe8, - 0x96, 0x05, 0x3a, 0x22, 0xd5, 0x94, 0xa7, 0x4c, 0xba, 0x72, 0xef, 0xeb, 0x2c, 0x8b, 0xe0, 0x5d, - 0xb4, 0x31, 0x80, 0x83, 0xcd, 0x95, 0xaa, 0x2b, 0x4a, 0x4b, 0x12, 0xd1, 0x27, 0xa8, 0x02, 0xf8, - 0xb5, 0xef, 0x9a, 0x97, 0xae, 0xd2, 0x6a, 0xe9, 0x2a, 0xcf, 0x4b, 0x57, 0x88, 0xd6, 0x8f, 0xf9, - 0x94, 0x89, 0x99, 0x36, 0xa9, 0x51, 0x26, 0x39, 0x19, 0x7d, 0xbe, 0xe6, 0xba, 0x04, 0x7e, 0x1f, - 0x35, 0x4e, 0xba, 0xfb, 0x47, 0x34, 0xcb, 0x78, 0x3a, 0x56, 0xee, 0xf9, 0xef, 0x7a, 0xb5, 0xac, - 0x60, 0x12, 0x5f, 0x10, 0xf4, 0x9e, 0x78, 0x7a, 0xa5, 0x2f, 0xd3, 0xf3, 0x04, 0xf1, 0x0e, 0xaa, - 0x0e, 0x2e, 0x55, 0xac, 0x13, 0xe7, 0x17, 0xbf, 0x6c, 0x6e, 0x5b, 0x8e, 0x6d, 0x6a, 0x4e, 0x0c, - 0xef, 0xa2, 0x3a, 0x61, 0x36, 0x30, 0x95, 0xb9, 0xc6, 0xe2, 0x36, 0x05, 0x8f, 0xcc, 0xc5, 0x20, - 0xf4, 0x3b, 0x63, 0x29, 0x66, 0x99, 0x32, 0x2f, 0xb7, 0x66, 0x43, 0xdf, 0x83, 0xf0, 0x7b, 0x08, - 0x3d, 0xa5, 0x53, 0xa6, 0x32, 0x0a, 0x66, 0xab, 0x2b, 0xa7, 0x2f, 0x98, 0xc4, 0x93, 0x83, 0xe2, - 0xbd, 0xcf, 0xce, 0x79, 0xcc, 0xf2, 0xb6, 0x7c, 0xc7, 0x53, 0xb1, 0x1c, 0x92, 0x4b, 0xe0, 0x77, - 0xd1, 0xfa, 0x80, 0xc5, 0xb1, 0x98, 0x66, 0xae, 0x15, 0x63, 0x4f, 0xd8, 0x71, 0x48, 0x2e, 0x82, - 0xdf, 0x45, 0x77, 0x20, 0x8b, 0x46, 0xaa, 0x2f, 0x45, 0x46, 0xc7, 0x36, 0x67, 0xeb, 0xe6, 0xe0, - 0xab, 0x0c, 0xb8, 0xe0, 0x11, 0x55, 0x67, 0x6c, 0x08, 0x97, 0x81, 0xe6, 0x6c, 0x2a, 0x91, 0x07, - 0xe1, 0x37, 0x51, 0x33, 0xcf, 0x34, 0x2b, 0xd3, 0x30, 0x32, 0x8b, 0x20, 0x6e, 0x21, 0x64, 0x8a, - 0x85, 0x5f, 0xe8, 0x3d, 0x04, 0xef, 0xa0, 0x5a, 0x37, 0xd5, 0x2c, 0x21, 0x43, 0x1d, 0x36, 0xcd, - 0x25, 0x5e, 0xf1, 0x5d, 0xec, 0x58, 0xa4, 0x10, 0xba, 0xff, 0x5d, 0xd4, 0xf0, 0x9c, 0xf8, 0x1f, - 0xcd, 0x00, 0x5f, 0x2b, 0x86, 0x0d, 0x10, 0x1a, 0xce, 0xa6, 0xd3, 0x5c, 0xd1, 0x12, 0x20, 0x90, - 0x0f, 0x26, 0xd7, 0x0b, 0x7c, 0x8a, 0x36, 0x16, 0x43, 0xcf, 0xf4, 0x27, 0xa1, 0x74, 0xd1, 0x6c, - 0x1c, 0x65, 0x02, 0x24, 0x4f, 0xb4, 0xa2, 0xef, 0xf8, 0x90, 0x29, 0xad, 0x30, 0x62, 0x94, 0x0d, - 0xcb, 0xac, 0xa3, 0x0f, 0x9c, 0xfd, 0x22, 0x22, 0x5e, 0x56, 0xa8, 0x4d, 0xd4, 0x95, 0xe6, 0xf9, - 0x1a, 0xfd, 0x3a, 0x40, 0x0d, 0x2f, 0x48, 0x5e, 0x96, 0xd3, 0xc6, 0x56, 0xc9, 0xb3, 0x75, 0x17, - 0xad, 0x1d, 0xd1, 0xcf, 0x84, 0x9d, 0x61, 0xca, 0xc4, 0x12, 0x06, 0xe5, 0xa9, 0x90, 0x2e, 0xab, - 0x2d, 0x01, 0xb5, 0xf6, 0x31, 0x4f, 0xd8, 0x91, 0x18, 0x32, 0x13, 0xf1, 0x4d, 0x52, 0xd0, 0x79, - 0xc7, 0xad, 0xae, 0x74, 0xdc, 0xf5, 0xa2, 0xe3, 0x46, 0x7f, 0x2d, 0xb9, 0xeb, 0xcd, 0xf3, 0xe8, - 0xdb, 0xf3, 0x78, 0x0f, 0x56, 0xb2, 0xd5, 0x72, 0x6c, 0x52, 0xcd, 0xa3, 0xfe, 0x6d, 0x54, 0x3d, - 0x62, 0x53, 0x21, 0x2f, 0xdd, 0x70, 0xe6, 0x67, 0x88, 0x65, 0x10, 0x27, 0x80, 0x37, 0x51, 0xb9, - 0xd3, 0x3f, 0x71, 0xe3, 0xd9, 0x86, 0x3f, 0x3e, 0xf5, 0x4f, 0x08, 0xb0, 0xf0, 0x1b, 0xa8, 0xd2, - 0x87, 0xd6, 0x6f, 0xd3, 0xfe, 0x96, 0x27, 0x02, 0x30, 0x31, 0x4c, 0xc8, 0xb3, 0xbd, 0x44, 0xc4, - 0x67, 0xdd, 0x9e, 0xb9, 0xf6, 0x62, 0x9e, 0x39, 0x0e, 0xc9, 0x45, 0xf0, 0x8f, 0xd1, 0xc6, 0xc1, - 0x6c, 0xcc, 0x32, 0x3a, 0x66, 0x87, 0x76, 0x0c, 0xb3, 0xc9, 0x1f, 0x7a, 0x4a, 0x0b, 0x02, 0x64, - 0x49, 0x1e, 0xf6, 0x7b, 0xca, 0xf4, 0x85, 0x90, 0x67, 0x6e, 0xf2, 0xf3, 0xf7, 0x73, 0x1c, 0x92, - 0x8b, 0x44, 0x7f, 0xcf, 0x3d, 0xef, 0x2e, 0x7d, 0x17, 0x0a, 0xef, 0x94, 0xdb, 0x81, 0xa9, 0x4c, - 0x2c, 0x01, 0xf1, 0x48, 0x98, 0x62, 0xf2, 0xdc, 0xe6, 0x7d, 0xc9, 0x0e, 0x65, 0x1e, 0x64, 0xe2, - 0xf1, 0x82, 0x66, 0x2e, 0x10, 0xcc, 0x1a, 0xa2, 0xfb, 0x43, 0x26, 0x53, 0x96, 0xb8, 0x40, 0x70, - 0x14, 0x4c, 0x21, 0x76, 0x75, 0xdc, 0xe9, 0x9b, 0x37, 0x29, 0x93, 0x39, 0x00, 0x39, 0x0f, 0xda, - 0x19, 0x4f, 0xe1, 0x7b, 0xa8, 0x6a, 0x46, 0x07, 0x0f, 0xc1, 0xdf, 0x40, 0xb7, 0xf7, 0xb9, 0x82, - 0x71, 0xa6, 0xd7, 0x3b, 0xfa, 0x90, 0x27, 0x09, 0x93, 0xe6, 0xa2, 0x35, 0xb2, 0x82, 0x47, 0x7f, - 0x0a, 0x50, 0x2d, 0x77, 0x19, 0x1c, 0x67, 0x30, 0xa1, 0xd2, 0x04, 0x0b, 0x18, 0x75, 0x14, 0x5c, - 0xf9, 0xa3, 0x99, 0xd0, 0xd4, 0x5d, 0xcb, 0x12, 0x20, 0xdd, 0x67, 0x92, 0x8b, 0xa1, 0x9b, 0x5e, - 0x1c, 0x05, 0x93, 0x2c, 0x61, 0x34, 0x81, 0x66, 0x3b, 0x6f, 0xca, 0xa0, 0xb7, 0x0c, 0xc3, 0x88, - 0x98, 0x43, 0xce, 0xd2, 0x9a, 0xb1, 0xb4, 0x84, 0xc2, 0xd3, 0x75, 0xb2, 0x99, 0x72, 0x23, 0xbc, - 0x59, 0x03, 0x76, 0xc4, 0xa6, 0x76, 0x76, 0xaf, 0x13, 0xb3, 0x8e, 0x2e, 0xdc, 0xb4, 0xf8, 0xcc, - 0xcc, 0xb0, 0x2e, 0x53, 0x8b, 0x0c, 0x0c, 0xae, 0xcd, 0xc0, 0x92, 0x9f, 0x81, 0xf7, 0x50, 0xd5, - 0xea, 0xba, 0xaa, 0xe1, 0x28, 0x78, 0xf1, 0x43, 0x46, 0x47, 0x8e, 0x57, 0x31, 0x3c, 0x0f, 0x89, - 0x4e, 0xd0, 0x2b, 0x66, 0xe3, 0xe3, 0x89, 0x14, 0x5a, 0x27, 0xec, 0xbf, 0xd8, 0x1a, 0xa3, 0x0a, - 0xa1, 0x9a, 0xe5, 0x93, 0x20, 0xac, 0xa3, 0x3f, 0x97, 0xd1, 0x4d, 0x3f, 0x09, 0xbc, 0xf3, 0x05, - 0x5f, 0x72, 0xbe, 0xd2, 0xf2, 0xf9, 0xe0, 0x83, 0xc7, 0x7f, 0x93, 0x6b, 0x3a, 0xb7, 0xcf, 0x26, - 0x0b, 0xc2, 0xb8, 0x87, 0x5e, 0xcd, 0xef, 0x05, 0xbd, 0x67, 0x2f, 0x53, 0xce, 0x8a, 0x1d, 0xb5, - 0xfe, 0xcf, 0xb3, 0xb2, 0x78, 0x7f, 0x72, 0xbd, 0x1e, 0xfe, 0x08, 0xdd, 0xcb, 0x19, 0xcf, 0x24, - 0xd7, 0x6c, 0x6e, 0x71, 0xed, 0xab, 0x2c, 0xbe, 0x44, 0xd1, 0x37, 0x09, 0x7b, 0x75, 0x7b, 0xfd, - 0x81, 0x33, 0x59, 0xfd, 0xb7, 0x4d, 0x2e, 0x2a, 0xe2, 0x01, 0x7a, 0x6d, 0x61, 0x33, 0xcf, 0xe6, - 0xfa, 0x57, 0xd9, 0x7c, 0x99, 0x66, 0xf4, 0x3a, 0xaa, 0x17, 0xd5, 0xef, 0xfa, 0x4a, 0x12, 0xfd, - 0x3c, 0xff, 0xe6, 0xf1, 0xcb, 0x33, 0xc8, 0xb6, 0x93, 0x44, 0x5c, 0xb8, 0x0f, 0x6a, 0x4b, 0xfc, - 0xcf, 0x1d, 0xe7, 0x1e, 0xaa, 0xb6, 0x63, 0xf3, 0x57, 0xc5, 0x4e, 0x58, 0x8e, 0x8a, 0x46, 0x2e, - 0xee, 0x5c, 0x0d, 0x84, 0x39, 0xb4, 0x93, 0x50, 0xa5, 0x8a, 0x36, 0x9c, 0x93, 0xf8, 0x07, 0x08, - 0xf5, 0x25, 0x17, 0xd2, 0x7e, 0x48, 0xdb, 0x21, 0xf2, 0xc1, 0xd2, 0x84, 0x21, 0x47, 0x34, 0x66, - 0x4e, 0xea, 0x92, 0x78, 0xf2, 0xd1, 0x63, 0x84, 0x57, 0xeb, 0x35, 0xf4, 0xc1, 0x3e, 0x1d, 0x33, - 0x05, 0xdd, 0xdb, 0xf6, 0xd7, 0x82, 0x9e, 0xbf, 0x99, 0xfd, 0x8a, 0x72, 0x6f, 0x76, 0x80, 0xee, - 0x5d, 0xbf, 0x1b, 0xbc, 0x10, 0x34, 0xfb, 0xbc, 0x4f, 0xc3, 0xda, 0xd8, 0x77, 0x7c, 0x97, 0x2b, - 0x05, 0x1d, 0xfd, 0x2a, 0x70, 0x57, 0xcf, 0xc7, 0xba, 0x37, 0x51, 0x73, 0x9f, 0x8d, 0xe8, 0x2c, - 0xd1, 0xed, 0xd8, 0xfb, 0x0c, 0x5b, 0x04, 0x41, 0xaa, 0x2d, 0xe3, 0x09, 0xd7, 0x2c, 0xd6, 0x33, - 0xc9, 0xf2, 0xb9, 0x7e, 0x11, 0x84, 0xc3, 0x3f, 0x4e, 0xe8, 0x58, 0xb9, 0x11, 0xdf, 0x12, 0x78, - 0x1b, 0xd5, 0x60, 0xe2, 0xa2, 0x49, 0xa2, 0x5c, 0x4a, 0x2d, 0xcc, 0x99, 0x96, 0x45, 0x0a, 0x99, - 0x88, 0xa3, 0x5b, 0xfe, 0x09, 0xdb, 0x72, 0x0c, 0x86, 0xbb, 0xe9, 0x90, 0x3d, 0x77, 0x75, 0xdb, - 0x12, 0x80, 0x7e, 0x5c, 0x4c, 0x6a, 0x15, 0x62, 0x09, 0xb8, 0xbd, 0x59, 0x1c, 0x5f, 0x08, 0x57, - 0x6c, 0x0a, 0x1a, 0x6f, 0xa0, 0x52, 0x2f, 0x73, 0x5f, 0xe1, 0xa5, 0x5e, 0x16, 0x7d, 0x5e, 0xbc, - 0x86, 0xdd, 0x1c, 0x4c, 0x9a, 0xd9, 0xc9, 0x7d, 0x77, 0x5b, 0xc2, 0x86, 0x51, 0xd1, 0xf7, 0x4c, - 0x18, 0x99, 0x57, 0x79, 0x80, 0x6a, 0x4c, 0xca, 0x54, 0x48, 0xe6, 0x0a, 0xea, 0xc1, 0x0d, 0x52, - 0x20, 0xf8, 0x6d, 0xef, 0xef, 0x4d, 0x63, 0xf7, 0xd5, 0xd5, 0xd9, 0xba, 0x2d, 0xc7, 0xf6, 0xcb, - 0x68, 0x0f, 0xa1, 0xda, 0x23, 0x50, 0x23, 0x4c, 0x47, 0xdf, 0x41, 0xcd, 0x85, 0xd9, 0x15, 0xde, - 0xfe, 0xf0, 0x61, 0x87, 0xc6, 0x13, 0x36, 0x88, 0x27, 0x6c, 0x4a, 0x73, 0x0f, 0x2d, 0x80, 0x7b, - 0xbf, 0x08, 0xbe, 0x78, 0xd1, 0xba, 0xf1, 0xb7, 0x17, 0xad, 0x1b, 0xff, 0x7c, 0xd1, 0x0a, 0x7e, - 0x76, 0xd5, 0x0a, 0x7e, 0x7b, 0xd5, 0x0a, 0x7e, 0x7f, 0xd5, 0x0a, 0xfe, 0x70, 0xd5, 0x0a, 0xbe, - 0xb8, 0x6a, 0x05, 0x7f, 0xb9, 0x6a, 0x05, 0xff, 0xb8, 0x6a, 0x05, 0x9f, 0x7c, 0x3a, 0xe6, 0x7a, - 0x32, 0x3b, 0xdd, 0x8e, 0xc5, 0x74, 0xe7, 0x8c, 0x6a, 0xfa, 0xcd, 0x38, 0x1f, 0x2b, 0xd5, 0x0a, - 0xad, 0x64, 0xbc, 0x23, 0x6d, 0x3b, 0xdb, 0x39, 0xe7, 0x52, 0x7b, 0xac, 0xec, 0x6c, 0xbc, 0x43, - 0xc7, 0x2c, 0xd5, 0xf6, 0xf7, 0x67, 0x2c, 0x12, 0xb5, 0x03, 0x77, 0x3c, 0xad, 0x1a, 0xfa, 0xe1, - 0xbf, 0x02, 0x00, 0x00, 0xff, 0xff, 0xd5, 0x43, 0x54, 0x5a, 0x2d, 0x15, 0x00, 0x00, + // 2087 bytes of a gzipped FileDescriptorProto + 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xa4, 0x58, 0x5b, 0x6f, 0x1b, 0xc7, + 0x15, 0x36, 0x2f, 0xa2, 0xc8, 0x43, 0x53, 0xb6, 0x27, 0x8e, 0xb2, 0x75, 0x0d, 0x55, 0xd9, 0x04, + 0xa9, 0xd2, 0xa4, 0x52, 0x2b, 0xa7, 0x41, 0x7a, 0x45, 0x29, 0xca, 0xb6, 0x88, 0x48, 0x26, 0x33, + 0x94, 0xe2, 0x22, 0x0f, 0x01, 0x46, 0xcb, 0x11, 0x39, 0xd1, 0x72, 0x67, 0x31, 0x3b, 0xd4, 0xa5, + 0x4f, 0xed, 0x4f, 0xc8, 0x0f, 0x28, 0xd0, 0x3e, 0xf5, 0xad, 0xff, 0xa1, 0x6f, 0x41, 0x5f, 0x5a, + 0xa0, 0x2f, 0x05, 0xfa, 0xd2, 0xf8, 0x97, 0x14, 0x67, 0x66, 0x76, 0x39, 0x24, 0xe5, 0xb8, 0x97, + 0xb7, 0x39, 0xdf, 0xb9, 0xcc, 0xe5, 0x5c, 0x77, 0xa1, 0x21, 0x23, 0xb1, 0x9d, 0x2a, 0xa9, 0x25, + 0xa9, 0x8e, 0x54, 0x1a, 0x85, 0x7f, 0xae, 0x40, 0x75, 0x90, 0xf2, 0x88, 0x04, 0xb0, 0xfa, 0x29, + 0x57, 0x99, 0x90, 0x49, 0x50, 0xda, 0x2c, 0x6d, 0x35, 0x68, 0x4e, 0x92, 0xef, 0xc2, 0x6a, 0x5f, + 0xc9, 0x88, 0x67, 0x59, 0x50, 0xde, 0x2c, 0x6d, 0x35, 0x77, 0x5b, 0xdb, 0xa8, 0xba, 0xed, 0x40, + 0x9a, 0x73, 0xc9, 0x06, 0x54, 0xa9, 0x94, 0x3a, 0xa8, 0x18, 0x29, 0xb0, 0x52, 0x88, 0x50, 0x83, + 0x93, 0x07, 0x50, 0x3f, 0x90, 0x99, 0x4e, 0xd8, 0x84, 0x07, 0x55, 0xb3, 0x47, 0x41, 0x93, 0xb7, + 0xa0, 0x76, 0x24, 0xa7, 0x89, 0xce, 0x82, 0x95, 0xcd, 0xca, 0x56, 0x73, 0xb7, 0x69, 0xb5, 0x0d, + 0x46, 0x1d, 0x8b, 0xbc, 0x09, 0x2b, 0x07, 0x52, 0x9e, 0x67, 0x41, 0xcd, 0xec, 0xe0, 0x64, 0x0c, + 0x44, 0x2d, 0x87, 0xfc, 0x1c, 0x9a, 0xed, 0x24, 0x91, 0x9a, 0x69, 0x21, 0x93, 0x2c, 0x58, 0x35, + 0xc6, 0xbe, 0x6d, 0x05, 0xf1, 0x9e, 0xdb, 0x1e, 0xf7, 0x71, 0xa2, 0xd5, 0x35, 0xf5, 0xe5, 0x71, + 0x87, 0x43, 0x91, 0x4c, 0xaf, 0x82, 0xba, 0xbf, 0x83, 0x81, 0xa8, 0xe5, 0xe0, 0x73, 0x0c, 0x64, + 0xcc, 0x94, 0xc8, 0x82, 0x86, 0xff, 0x1c, 0x0e, 0xa4, 0x39, 0x17, 0x05, 0x9f, 0x8b, 0x64, 0x28, + 0x2f, 0xb3, 0x00, 0x7c, 0x41, 0x07, 0xd2, 0x9c, 0xfb, 0xe0, 0x17, 0x70, 0x77, 0xf1, 0x54, 0xe4, + 0x2e, 0x54, 0xce, 0xf9, 0xb5, 0x73, 0x05, 0x2e, 0xc9, 0x7d, 0x58, 0xb9, 0x60, 0xf1, 0x94, 0x1b, + 0x27, 0x34, 0xa8, 0x25, 0x7e, 0x52, 0xfe, 0xa8, 0x14, 0xfe, 0xa9, 0x52, 0x78, 0x08, 0xdf, 0xf8, + 0x98, 0xab, 0x89, 0x48, 0x58, 0x6c, 0x94, 0xeb, 0xb4, 0xa0, 0xc9, 0x7b, 0xd0, 0xec, 0xc8, 0x24, + 0x93, 0x31, 0x1f, 0x88, 0x5f, 0x73, 0xe7, 0xcc, 0x86, 0x3d, 0xd4, 0x9e, 0xbc, 0xa2, 0x3e, 0x17, + 0x9d, 0x79, 0x92, 0x71, 0x35, 0xef, 0x4c, 0x44, 0xa8, 0xc1, 0x09, 0x81, 0x6a, 0x5b, 0x8d, 0xb2, + 0xa0, 0xba, 0x59, 0xd9, 0x6a, 0x50, 0xb3, 0xc6, 0x43, 0x3f, 0x4e, 0x2e, 0x8c, 0x07, 0x1b, 0x14, + 0x97, 0x88, 0x74, 0x2e, 0x87, 0xc6, 0x5f, 0x0d, 0x8a, 0x4b, 0xf2, 0x53, 0xb8, 0xdd, 0x61, 0x29, + 0x3b, 0x15, 0xb1, 0xd0, 0x82, 0xa3, 0x87, 0xd0, 0xfe, 0x1b, 0xde, 0x43, 0xfb, 0x6c, 0x3a, 0x27, + 0x4c, 0xde, 0x83, 0x55, 0x1a, 0x8b, 0x89, 0xd0, 0x59, 0x50, 0x37, 0x9e, 0xbd, 0xe7, 0x42, 0xb1, + 0x37, 0xe8, 0xfe, 0xca, 0x72, 0x68, 0x2e, 0x41, 0xb6, 0xe0, 0xce, 0x33, 0xf9, 0x8c, 0x5f, 0xf6, + 0x95, 0xb8, 0x10, 0x31, 0x1f, 0x71, 0xeb, 0xb0, 0x3a, 0x5d, 0x84, 0x51, 0xb2, 0x9d, 0xa6, 0x4c, + 0x4d, 0xa4, 0xea, 0x2b, 0x79, 0x26, 0x62, 0x6e, 0x3c, 0xd6, 0xa0, 0x8b, 0x30, 0xd9, 0x84, 0x66, + 0xaf, 0x77, 0x34, 0x88, 0xa4, 0xe2, 0xed, 0xe1, 0x17, 0x41, 0x73, 0xb3, 0xb4, 0x55, 0xa1, 0x3e, + 0x44, 0x42, 0xb8, 0x3d, 0xe0, 0x31, 0xde, 0xe3, 0x90, 0x9d, 0xf2, 0x38, 0xb8, 0x6d, 0x0c, 0xcd, + 0x61, 0xe1, 0x23, 0xa8, 0xec, 0xc9, 0x2b, 0xb2, 0x0e, 0xb5, 0x03, 0x2e, 0x46, 0x63, 0x6d, 0x3c, + 0xd5, 0xa2, 0x8e, 0x42, 0x4f, 0x3f, 0x17, 0x43, 0x3d, 0x36, 0x1e, 0x6a, 0x51, 0x4b, 0x84, 0x89, + 0x75, 0x08, 0x3e, 0xe9, 0x49, 0x77, 0xdf, 0xa9, 0xe0, 0x12, 0x91, 0xa7, 0xdd, 0x7d, 0x27, 0x8d, + 0x4b, 0xf2, 0x0e, 0xac, 0xb5, 0x87, 0x43, 0x81, 0xf1, 0xc4, 0xe2, 0xa7, 0x62, 0x98, 0x05, 0x95, + 0xcd, 0xca, 0x56, 0x8b, 0x2e, 0xa0, 0x18, 0x2d, 0x68, 0xd3, 0xcf, 0xc8, 0x9c, 0x0e, 0xff, 0x58, + 0x82, 0x7b, 0x4b, 0xfe, 0x40, 0x8d, 0x3d, 0x39, 0x4d, 0x86, 0x22, 0x19, 0x05, 0x25, 0xe3, 0xe7, + 0x82, 0x26, 0x0f, 0xa1, 0xf1, 0xf8, 0xec, 0x8c, 0x47, 0x5a, 0x5c, 0x60, 0x74, 0x21, 0x73, 0x06, + 0xe0, 0xd3, 0x75, 0x93, 0x31, 0x57, 0x42, 0xb3, 0xd3, 0x98, 0x9b, 0x03, 0x35, 0xa8, 0x0f, 0xa1, + 0x7e, 0x1f, 0x63, 0x55, 0x6b, 0x3e, 0x74, 0x71, 0x35, 0x03, 0xb0, 0x40, 0xb5, 0x27, 0xa7, 0x82, + 0x27, 0xda, 0x05, 0x58, 0x4e, 0x86, 0x5d, 0x68, 0x7a, 0x01, 0x80, 0x91, 0x79, 0x7c, 0x9d, 0x72, + 0x97, 0x3b, 0x66, 0x8d, 0xd8, 0x01, 0x53, 0x43, 0xf3, 0x46, 0x55, 0x6a, 0xd6, 0x88, 0x0d, 0xe4, + 0x99, 0x2d, 0x57, 0x55, 0x6a, 0xd6, 0xa1, 0x84, 0x15, 0x53, 0x6b, 0xf0, 0xb4, 0x43, 0x9e, 0x69, + 0x91, 0x98, 0xa4, 0x74, 0xb6, 0x7c, 0x08, 0xbd, 0x97, 0xc9, 0xa9, 0x8a, 0xf2, 0x84, 0x74, 0x14, + 0x9a, 0xd5, 0xb8, 0x7d, 0xc5, 0x6e, 0x8f, 0x6b, 0x3c, 0xbb, 0x4c, 0x6d, 0x45, 0xb2, 0xf7, 0xca, + 0xc9, 0xf0, 0x43, 0x5b, 0x33, 0x51, 0xab, 0xcf, 0xf4, 0x38, 0x3f, 0x34, 0xae, 0xf1, 0xad, 0x29, + 0x67, 0x43, 0x99, 0xc4, 0xd7, 0x66, 0x8f, 0x3a, 0x2d, 0xe8, 0xf0, 0x77, 0x65, 0x57, 0x0b, 0xc9, + 0x3b, 0x50, 0xef, 0x2b, 0x9e, 0x69, 0xa6, 0xb4, 0xf1, 0x48, 0x91, 0xac, 0xc8, 0xa6, 0x05, 0x8f, + 0x6c, 0x41, 0xa3, 0x2f, 0x33, 0x6d, 0x05, 0xcb, 0x4b, 0x82, 0x33, 0xa6, 0xb1, 0x68, 0x08, 0x99, + 0x1a, 0x37, 0x2d, 0x5a, 0x74, 0x3c, 0xf2, 0x03, 0x68, 0x75, 0x14, 0x67, 0x9a, 0xd3, 0x69, 0xa2, + 0x85, 0x09, 0xa1, 0x45, 0xe1, 0x79, 0x01, 0xf2, 0x01, 0xdc, 0xb1, 0x40, 0x47, 0x26, 0x9a, 0x89, + 0x84, 0x2b, 0x57, 0xee, 0x7d, 0x9d, 0x45, 0x11, 0xb2, 0x0b, 0x6b, 0x03, 0x3c, 0xd8, 0x4c, 0xa9, + 0xb6, 0xa4, 0xb4, 0x20, 0x11, 0x7e, 0x06, 0x55, 0xc4, 0x6f, 0x7c, 0xd7, 0xbc, 0x74, 0x95, 0x97, + 0x4b, 0x57, 0x65, 0x56, 0xba, 0x02, 0x58, 0x3d, 0x16, 0x13, 0x2e, 0xa7, 0xda, 0xa4, 0x46, 0x85, + 0xe6, 0x64, 0xf8, 0xe5, 0x8a, 0xeb, 0x12, 0xe4, 0x43, 0x68, 0x9e, 0x74, 0xf7, 0x8f, 0x58, 0x9a, + 0x8a, 0x64, 0x94, 0xb9, 0xe7, 0xbf, 0xef, 0xd5, 0xb2, 0x82, 0x49, 0x7d, 0x41, 0xd4, 0x7b, 0xea, + 0xe9, 0x95, 0xbf, 0x49, 0xcf, 0x13, 0x24, 0x3b, 0x50, 0x1b, 0x5c, 0x67, 0x91, 0x8e, 0x9d, 0x5f, + 0xfc, 0xb2, 0xb9, 0x6d, 0x39, 0xb6, 0xa9, 0x39, 0x31, 0xb2, 0x0b, 0x0d, 0xca, 0x6d, 0x60, 0x66, + 0xe6, 0x1a, 0xf3, 0xdb, 0x14, 0x3c, 0x3a, 0x13, 0xc3, 0xd0, 0xef, 0x8c, 0x94, 0x9c, 0xa6, 0x99, + 0x79, 0xb9, 0x15, 0x1b, 0xfa, 0x1e, 0x44, 0x3e, 0x00, 0x78, 0xc6, 0x26, 0x3c, 0x4b, 0x19, 0x9a, + 0xad, 0x2d, 0x9d, 0xbe, 0x60, 0x52, 0x4f, 0x0e, 0x8b, 0xf7, 0x3e, 0xbf, 0x10, 0x11, 0xcf, 0xdb, + 0xf2, 0x3d, 0x4f, 0xc5, 0x72, 0x68, 0x2e, 0x41, 0xde, 0x87, 0xd5, 0x01, 0x8f, 0x22, 0x39, 0x49, + 0x5d, 0x2b, 0x26, 0x9e, 0xb0, 0xe3, 0xd0, 0x5c, 0x84, 0xbc, 0x0f, 0xf7, 0x30, 0x8b, 0xce, 0xb2, + 0xbe, 0x92, 0x29, 0x1b, 0xd9, 0x9c, 0x6d, 0x98, 0x83, 0x2f, 0x33, 0xf0, 0x82, 0x47, 0x2c, 0x3b, + 0xe7, 0x43, 0xbc, 0x0c, 0x36, 0x67, 0x53, 0x89, 0x3c, 0x88, 0xbc, 0x0d, 0xad, 0x3c, 0xd3, 0xac, + 0x4c, 0xd3, 0xc8, 0xcc, 0x83, 0x64, 0x03, 0xc0, 0x14, 0x0b, 0xbf, 0xd0, 0x7b, 0x08, 0xd9, 0x81, + 0x7a, 0x37, 0xd1, 0x3c, 0xa6, 0x43, 0x1d, 0xb4, 0xcc, 0x25, 0x5e, 0xf3, 0x5d, 0xec, 0x58, 0xb4, + 0x10, 0x7a, 0xf0, 0x63, 0x68, 0x7a, 0x4e, 0xfc, 0xaf, 0x66, 0x80, 0xef, 0x14, 0xc3, 0x06, 0x0a, + 0x0d, 0xa7, 0x93, 0x49, 0xae, 0x68, 0x09, 0x14, 0xc8, 0x07, 0x93, 0x9b, 0x05, 0x3e, 0x87, 0xb5, + 0xf9, 0xd0, 0x33, 0xfd, 0x49, 0x66, 0xba, 0x68, 0x36, 0x8e, 0x32, 0x01, 0x92, 0x27, 0x5a, 0xd1, + 0x77, 0x7c, 0xc8, 0x94, 0x56, 0x1c, 0x31, 0x2a, 0x86, 0x65, 0xd6, 0xe1, 0x47, 0xce, 0x7e, 0x11, + 0x11, 0x2f, 0x2b, 0xd4, 0x26, 0xea, 0xca, 0xb3, 0x7c, 0x0d, 0xff, 0x50, 0x82, 0xa6, 0x17, 0x24, + 0x2f, 0xcb, 0x69, 0x63, 0xab, 0xec, 0xd9, 0xba, 0x0f, 0x2b, 0x47, 0xec, 0x0b, 0x69, 0x67, 0x98, + 0x0a, 0xb5, 0x84, 0x41, 0x45, 0x22, 0x95, 0xcb, 0x6a, 0x4b, 0x60, 0xad, 0x7d, 0x22, 0x62, 0x7e, + 0x24, 0x87, 0xdc, 0x44, 0x7c, 0x8b, 0x16, 0x74, 0xde, 0x71, 0x6b, 0x4b, 0x1d, 0x77, 0xb5, 0xe8, + 0xb8, 0xe1, 0xdf, 0xcb, 0xee, 0x7a, 0xb3, 0x3c, 0xfa, 0xe1, 0x2c, 0xde, 0x4b, 0x4b, 0xd9, 0x6a, + 0x39, 0x36, 0xa9, 0x66, 0x51, 0xff, 0x2e, 0xd4, 0x8e, 0xf8, 0x44, 0xaa, 0x6b, 0x37, 0x9c, 0xf9, + 0x19, 0x62, 0x19, 0xd4, 0x09, 0x90, 0x4d, 0xa8, 0x74, 0xfa, 0x27, 0x6e, 0x3c, 0x5b, 0xf3, 0xc7, + 0xa7, 0xfe, 0x09, 0x45, 0x16, 0x79, 0x0b, 0xaa, 0x7d, 0x6c, 0xfd, 0x36, 0xed, 0xef, 0x78, 0x22, + 0x08, 0x53, 0xc3, 0xc4, 0x3c, 0xdb, 0x8b, 0x65, 0x74, 0xde, 0xed, 0x99, 0x6b, 0xcf, 0xe7, 0x99, + 0xe3, 0xd0, 0x5c, 0x84, 0xfc, 0x12, 0xd6, 0x0e, 0xa6, 0x23, 0x9e, 0xb2, 0x11, 0x3f, 0xb4, 0x63, + 0x98, 0x4d, 0xfe, 0xc0, 0x53, 0x9a, 0x13, 0xa0, 0x0b, 0xf2, 0xb8, 0xdf, 0x33, 0xae, 0x2f, 0xa5, + 0x3a, 0x77, 0x93, 0x9f, 0xbf, 0x9f, 0xe3, 0xd0, 0x5c, 0x24, 0xfc, 0x67, 0xee, 0x79, 0x77, 0xe9, + 0xfb, 0x58, 0x78, 0x27, 0xc2, 0x0e, 0x4c, 0x15, 0x6a, 0x09, 0x8c, 0x47, 0xca, 0x33, 0xae, 0x2e, + 0x6c, 0xde, 0x97, 0xed, 0x50, 0xe6, 0x41, 0x26, 0x1e, 0x2f, 0x59, 0xea, 0x02, 0xc1, 0xac, 0x31, + 0xba, 0x3f, 0xe6, 0x2a, 0xe1, 0xb1, 0x0b, 0x04, 0x47, 0xe1, 0x14, 0x62, 0x57, 0xc7, 0x9d, 0xbe, + 0x79, 0x93, 0x0a, 0x9d, 0x01, 0x98, 0xf3, 0xa8, 0x9d, 0x8a, 0x04, 0xbf, 0x87, 0x6a, 0x66, 0x74, + 0xf0, 0x10, 0xf2, 0x3d, 0xb8, 0xbb, 0x2f, 0x32, 0x1c, 0x67, 0x7a, 0xbd, 0xa3, 0x8f, 0x45, 0x1c, + 0x73, 0x65, 0x2e, 0x5a, 0xa7, 0x4b, 0x78, 0xf8, 0x97, 0x12, 0xd4, 0x73, 0x97, 0xe1, 0x71, 0x06, + 0x63, 0xa6, 0x4c, 0xb0, 0xa0, 0x51, 0x47, 0xe1, 0x95, 0x3f, 0x99, 0x4a, 0xcd, 0xdc, 0xb5, 0x2c, + 0x81, 0xd2, 0x7d, 0xae, 0x84, 0x1c, 0xba, 0xe9, 0xc5, 0x51, 0x38, 0xc9, 0x52, 0xce, 0x62, 0x6c, + 0xb6, 0xb3, 0xa6, 0x8c, 0x7a, 0x8b, 0x30, 0x8e, 0x88, 0x39, 0xe4, 0x2c, 0xad, 0x18, 0x4b, 0x0b, + 0x28, 0x3e, 0x5d, 0x27, 0x9d, 0x66, 0x6e, 0x84, 0x37, 0x6b, 0xc4, 0x8e, 0xf8, 0xc4, 0xce, 0xee, + 0x0d, 0x6a, 0xd6, 0xe1, 0xa5, 0x9b, 0x16, 0x9f, 0x9b, 0x19, 0xd6, 0x65, 0x6a, 0x91, 0x81, 0xa5, + 0x1b, 0x33, 0xb0, 0xec, 0x67, 0xe0, 0x3a, 0xd4, 0xac, 0xae, 0xab, 0x1a, 0x8e, 0xc2, 0x17, 0x3f, + 0xe4, 0xec, 0xcc, 0xf1, 0xaa, 0x86, 0xe7, 0x21, 0xe1, 0x09, 0xbc, 0x66, 0x36, 0x3e, 0x1e, 0x2b, + 0xa9, 0x75, 0xcc, 0xff, 0x87, 0xad, 0x09, 0x54, 0x29, 0xd3, 0x3c, 0x9f, 0x04, 0x71, 0x1d, 0xfe, + 0xb5, 0x02, 0xb7, 0xfd, 0x24, 0xf0, 0xce, 0x57, 0xfa, 0x86, 0xf3, 0x95, 0x17, 0xcf, 0x87, 0x1f, + 0x3c, 0xfe, 0x9b, 0xdc, 0xd0, 0xb9, 0x7d, 0x36, 0x9d, 0x13, 0x26, 0x3d, 0x78, 0x3d, 0xbf, 0x17, + 0xf6, 0x9e, 0xbd, 0x34, 0x73, 0x56, 0xec, 0xa8, 0xf5, 0x2d, 0xcf, 0xca, 0xfc, 0xfd, 0xe9, 0xcd, + 0x7a, 0xe4, 0x13, 0x58, 0xcf, 0x19, 0xcf, 0x95, 0xd0, 0x7c, 0x66, 0x71, 0xe5, 0x55, 0x16, 0x5f, + 0xa2, 0xe8, 0x9b, 0xc4, 0xbd, 0xba, 0xbd, 0xfe, 0xc0, 0x99, 0xac, 0xfd, 0xc7, 0x26, 0xe7, 0x15, + 0xc9, 0x00, 0xde, 0x98, 0xdb, 0xcc, 0xb3, 0xb9, 0xfa, 0x2a, 0x9b, 0x2f, 0xd3, 0x0c, 0xdf, 0x84, + 0x46, 0x51, 0xfd, 0x6e, 0xae, 0x24, 0xe1, 0x6f, 0xf3, 0x6f, 0x1e, 0xbf, 0x3c, 0xa3, 0x6c, 0x3b, + 0x8e, 0xe5, 0xa5, 0xfb, 0xa0, 0xb6, 0xc4, 0xff, 0xdd, 0x71, 0xd6, 0xa1, 0xd6, 0x8e, 0xcc, 0x5f, + 0x15, 0x3b, 0x61, 0x39, 0x2a, 0x3c, 0x73, 0x71, 0xe7, 0x6a, 0x20, 0xce, 0xa1, 0x9d, 0x98, 0x65, + 0x59, 0xd1, 0x86, 0x73, 0x92, 0xfc, 0x0c, 0xa0, 0xaf, 0x84, 0x54, 0xf6, 0x43, 0xda, 0x0e, 0x91, + 0x0f, 0x17, 0x26, 0x0c, 0x75, 0xc6, 0x22, 0xee, 0xa4, 0xae, 0xa9, 0x27, 0x1f, 0x3e, 0x01, 0xb2, + 0x5c, 0xaf, 0xb1, 0x0f, 0xf6, 0xd9, 0x88, 0x67, 0xd8, 0xbd, 0x6d, 0x7f, 0x2d, 0xe8, 0xd9, 0x9b, + 0xd9, 0xaf, 0x28, 0xf7, 0x66, 0x07, 0xb0, 0x7e, 0xf3, 0x6e, 0xf8, 0x42, 0xd8, 0xec, 0xf3, 0x3e, + 0x8d, 0x6b, 0x63, 0xdf, 0xf1, 0x5d, 0xae, 0x14, 0x74, 0xf8, 0xfb, 0x92, 0xbb, 0x7a, 0x3e, 0xd6, + 0xbd, 0x0d, 0xad, 0x7d, 0x7e, 0xc6, 0xa6, 0xb1, 0x6e, 0x47, 0xde, 0x67, 0xd8, 0x3c, 0x88, 0x52, + 0x6d, 0x15, 0x8d, 0x85, 0xe6, 0x91, 0x9e, 0x2a, 0x9e, 0xcf, 0xf5, 0xf3, 0x20, 0x1e, 0xfe, 0x49, + 0xcc, 0x46, 0x99, 0x1b, 0xf1, 0x2d, 0x41, 0xb6, 0xa1, 0x8e, 0x13, 0x17, 0x8b, 0xe3, 0xcc, 0xa5, + 0xd4, 0xdc, 0x9c, 0x69, 0x59, 0xb4, 0x90, 0x09, 0x05, 0xdc, 0xf1, 0x4f, 0xd8, 0x56, 0x23, 0x34, + 0xdc, 0x4d, 0x86, 0xfc, 0xca, 0xd5, 0x6d, 0x4b, 0x20, 0xfa, 0x69, 0x31, 0xa9, 0x55, 0xa9, 0x25, + 0xf0, 0xf6, 0x66, 0x71, 0x7c, 0x29, 0x5d, 0xb1, 0x29, 0x68, 0xb2, 0x06, 0xe5, 0x5e, 0xea, 0xbe, + 0xc2, 0xcb, 0xbd, 0x34, 0xfc, 0xb2, 0x78, 0x0d, 0xbb, 0x39, 0x9a, 0x34, 0xb3, 0x93, 0xfb, 0xee, + 0xb6, 0x84, 0x0d, 0xa3, 0xa2, 0xef, 0x99, 0x30, 0x32, 0xaf, 0xf2, 0x10, 0xea, 0x5c, 0xa9, 0x44, + 0x2a, 0xee, 0x0a, 0xea, 0xc1, 0x2d, 0x5a, 0x20, 0xe4, 0x5d, 0xef, 0xef, 0x4d, 0x73, 0xf7, 0xf5, + 0xe5, 0xd9, 0xba, 0xad, 0x46, 0xf6, 0xcb, 0x68, 0x0f, 0xa0, 0xfe, 0x18, 0xd5, 0x28, 0xd7, 0xe1, + 0x8f, 0xa0, 0x35, 0x37, 0xbb, 0xe2, 0xdb, 0x1f, 0x3e, 0xea, 0xb0, 0x68, 0xcc, 0x07, 0xd1, 0x98, + 0x4f, 0x58, 0xee, 0xa1, 0x39, 0x70, 0xef, 0xea, 0xab, 0xaf, 0x37, 0x6e, 0xfd, 0xe3, 0xeb, 0x8d, + 0x5b, 0xbf, 0x79, 0xb1, 0x51, 0xfa, 0xea, 0xc5, 0x46, 0xe9, 0x6f, 0x2f, 0x36, 0x4a, 0xff, 0x7a, + 0xb1, 0x51, 0xfa, 0xec, 0xf3, 0x91, 0xd0, 0xe3, 0xe9, 0xe9, 0x76, 0x24, 0x27, 0x3b, 0xe7, 0x4c, + 0xb3, 0xef, 0x47, 0xf9, 0x14, 0x99, 0x2d, 0xd1, 0x99, 0x8a, 0x76, 0x94, 0xed, 0x5e, 0x3b, 0x17, + 0x42, 0x69, 0x8f, 0x95, 0x9e, 0x8f, 0x76, 0xd8, 0x88, 0x27, 0x7a, 0xc7, 0xfc, 0xdb, 0x8c, 0x64, + 0x9c, 0xed, 0xe0, 0x95, 0x4e, 0x6b, 0x86, 0x7e, 0xf4, 0xef, 0x00, 0x00, 0x00, 0xff, 0xff, 0xd6, + 0x54, 0x48, 0x2e, 0xf8, 0x14, 0x00, 0x00, } -func (this *Spec) Equal(that interface{}) bool { - if that == nil { - return this == nil - } - - that1, ok := that.(*Spec) - if !ok { - that2, ok := that.(Spec) - if ok { - that1 = &that2 - } else { - return false - } - } - if that1 == nil { - return this == nil - } else if this == nil { - return false - } - if this.Version != that1.Version { - return false - } - if !this.Process.Equal(that1.Process) { - return false - } - if !this.Root.Equal(that1.Root) { - return false - } - if this.Hostname != that1.Hostname { - return false - } - if len(this.Mounts) != len(that1.Mounts) { - return false - } - for i := range this.Mounts { - if !this.Mounts[i].Equal(that1.Mounts[i]) { - return false - } - } - if !this.Hooks.Equal(that1.Hooks) { - return false - } - if len(this.Annotations) != len(that1.Annotations) { - return false - } - for i := range this.Annotations { - if this.Annotations[i] != that1.Annotations[i] { - return false - } - } - if !this.Linux.Equal(that1.Linux) { - return false - } - if !this.Solaris.Equal(that1.Solaris) { - return false - } - if !this.Windows.Equal(that1.Windows) { - return false - } - if !bytes.Equal(this.XXX_unrecognized, that1.XXX_unrecognized) { - return false - } - return true -} -func (this *Process) Equal(that interface{}) bool { - if that == nil { - return this == nil - } - - that1, ok := that.(*Process) - if !ok { - that2, ok := that.(Process) - if ok { - that1 = &that2 - } else { - return false - } - } - if that1 == nil { - return this == nil - } else if this == nil { - return false - } - if this.Terminal != that1.Terminal { - return false - } - if !this.ConsoleSize.Equal(that1.ConsoleSize) { - return false - } - if !this.User.Equal(that1.User) { - return false - } - if len(this.Args) != len(that1.Args) { - return false - } - for i := range this.Args { - if this.Args[i] != that1.Args[i] { - return false - } - } - if len(this.Env) != len(that1.Env) { - return false - } - for i := range this.Env { - if this.Env[i] != that1.Env[i] { - return false - } - } - if this.Cwd != that1.Cwd { - return false - } - if !this.Capabilities.Equal(that1.Capabilities) { - return false - } - if len(this.Rlimits) != len(that1.Rlimits) { - return false - } - for i := range this.Rlimits { - if !this.Rlimits[i].Equal(that1.Rlimits[i]) { - return false - } - } - if this.NoNewPrivileges != that1.NoNewPrivileges { - return false - } - if this.ApparmorProfile != that1.ApparmorProfile { - return false - } - if this.OOMScoreAdj != that1.OOMScoreAdj { - return false - } - if this.SelinuxLabel != that1.SelinuxLabel { - return false - } - if !bytes.Equal(this.XXX_unrecognized, that1.XXX_unrecognized) { - return false - } - return true -} -func (this *Box) Equal(that interface{}) bool { - if that == nil { - return this == nil - } - - that1, ok := that.(*Box) - if !ok { - that2, ok := that.(Box) - if ok { - that1 = &that2 - } else { - return false - } - } - if that1 == nil { - return this == nil - } else if this == nil { - return false - } - if this.Height != that1.Height { - return false - } - if this.Width != that1.Width { - return false - } - if !bytes.Equal(this.XXX_unrecognized, that1.XXX_unrecognized) { - return false - } - return true -} -func (this *User) Equal(that interface{}) bool { - if that == nil { - return this == nil - } - - that1, ok := that.(*User) - if !ok { - that2, ok := that.(User) - if ok { - that1 = &that2 - } else { - return false - } - } - if that1 == nil { - return this == nil - } else if this == nil { - return false - } - if this.UID != that1.UID { - return false - } - if this.GID != that1.GID { - return false - } - if len(this.AdditionalGids) != len(that1.AdditionalGids) { - return false - } - for i := range this.AdditionalGids { - if this.AdditionalGids[i] != that1.AdditionalGids[i] { - return false - } - } - if this.Username != that1.Username { - return false - } - if !bytes.Equal(this.XXX_unrecognized, that1.XXX_unrecognized) { - return false - } - return true -} -func (this *LinuxCapabilities) Equal(that interface{}) bool { - if that == nil { - return this == nil - } - - that1, ok := that.(*LinuxCapabilities) - if !ok { - that2, ok := that.(LinuxCapabilities) - if ok { - that1 = &that2 - } else { - return false - } - } - if that1 == nil { - return this == nil - } else if this == nil { - return false - } - if len(this.Bounding) != len(that1.Bounding) { - return false - } - for i := range this.Bounding { - if this.Bounding[i] != that1.Bounding[i] { - return false - } - } - if len(this.Effective) != len(that1.Effective) { - return false - } - for i := range this.Effective { - if this.Effective[i] != that1.Effective[i] { - return false - } - } - if len(this.Inheritable) != len(that1.Inheritable) { - return false - } - for i := range this.Inheritable { - if this.Inheritable[i] != that1.Inheritable[i] { - return false - } - } - if len(this.Permitted) != len(that1.Permitted) { - return false - } - for i := range this.Permitted { - if this.Permitted[i] != that1.Permitted[i] { - return false - } - } - if len(this.Ambient) != len(that1.Ambient) { - return false - } - for i := range this.Ambient { - if this.Ambient[i] != that1.Ambient[i] { - return false - } - } - if !bytes.Equal(this.XXX_unrecognized, that1.XXX_unrecognized) { - return false - } - return true -} -func (this *POSIXRlimit) Equal(that interface{}) bool { - if that == nil { - return this == nil - } - - that1, ok := that.(*POSIXRlimit) - if !ok { - that2, ok := that.(POSIXRlimit) - if ok { - that1 = &that2 - } else { - return false - } - } - if that1 == nil { - return this == nil - } else if this == nil { - return false - } - if this.Type != that1.Type { - return false - } - if this.Hard != that1.Hard { - return false - } - if this.Soft != that1.Soft { - return false - } - if !bytes.Equal(this.XXX_unrecognized, that1.XXX_unrecognized) { - return false - } - return true -} -func (this *Mount) Equal(that interface{}) bool { - if that == nil { - return this == nil - } - - that1, ok := that.(*Mount) - if !ok { - that2, ok := that.(Mount) - if ok { - that1 = &that2 - } else { - return false - } - } - if that1 == nil { - return this == nil - } else if this == nil { - return false - } - if this.Destination != that1.Destination { - return false - } - if this.Source != that1.Source { - return false - } - if this.Type != that1.Type { - return false - } - if len(this.Options) != len(that1.Options) { - return false - } - for i := range this.Options { - if this.Options[i] != that1.Options[i] { - return false - } - } - if !bytes.Equal(this.XXX_unrecognized, that1.XXX_unrecognized) { - return false - } - return true -} -func (this *Root) Equal(that interface{}) bool { - if that == nil { - return this == nil - } - - that1, ok := that.(*Root) - if !ok { - that2, ok := that.(Root) - if ok { - that1 = &that2 - } else { - return false - } - } - if that1 == nil { - return this == nil - } else if this == nil { - return false - } - if this.Path != that1.Path { - return false - } - if this.Readonly != that1.Readonly { - return false - } - if !bytes.Equal(this.XXX_unrecognized, that1.XXX_unrecognized) { - return false - } - return true -} -func (this *Hooks) Equal(that interface{}) bool { - if that == nil { - return this == nil - } - - that1, ok := that.(*Hooks) - if !ok { - that2, ok := that.(Hooks) - if ok { - that1 = &that2 - } else { - return false - } - } - if that1 == nil { - return this == nil - } else if this == nil { - return false - } - if len(this.Prestart) != len(that1.Prestart) { - return false - } - for i := range this.Prestart { - if !this.Prestart[i].Equal(that1.Prestart[i]) { - return false - } - } - if len(this.Poststart) != len(that1.Poststart) { - return false - } - for i := range this.Poststart { - if !this.Poststart[i].Equal(that1.Poststart[i]) { - return false - } - } - if len(this.Poststop) != len(that1.Poststop) { - return false - } - for i := range this.Poststop { - if !this.Poststop[i].Equal(that1.Poststop[i]) { - return false - } - } - if len(this.CreateRuntime) != len(that1.CreateRuntime) { - return false - } - for i := range this.CreateRuntime { - if !this.CreateRuntime[i].Equal(that1.CreateRuntime[i]) { - return false - } - } - if len(this.CreateContainer) != len(that1.CreateContainer) { - return false - } - for i := range this.CreateContainer { - if !this.CreateContainer[i].Equal(that1.CreateContainer[i]) { - return false - } - } - if len(this.StartContainer) != len(that1.StartContainer) { - return false - } - for i := range this.StartContainer { - if !this.StartContainer[i].Equal(that1.StartContainer[i]) { - return false - } - } - if !bytes.Equal(this.XXX_unrecognized, that1.XXX_unrecognized) { - return false - } - return true -} -func (this *Hook) Equal(that interface{}) bool { - if that == nil { - return this == nil - } - - that1, ok := that.(*Hook) - if !ok { - that2, ok := that.(Hook) - if ok { - that1 = &that2 - } else { - return false - } - } - if that1 == nil { - return this == nil - } else if this == nil { - return false - } - if this.Path != that1.Path { - return false - } - if len(this.Args) != len(that1.Args) { - return false - } - for i := range this.Args { - if this.Args[i] != that1.Args[i] { - return false - } - } - if len(this.Env) != len(that1.Env) { - return false - } - for i := range this.Env { - if this.Env[i] != that1.Env[i] { - return false - } - } - if this.Timeout != that1.Timeout { - return false - } - if !bytes.Equal(this.XXX_unrecognized, that1.XXX_unrecognized) { - return false - } - return true -} -func (this *Linux) Equal(that interface{}) bool { - if that == nil { - return this == nil - } - - that1, ok := that.(*Linux) - if !ok { - that2, ok := that.(Linux) - if ok { - that1 = &that2 - } else { - return false - } - } - if that1 == nil { - return this == nil - } else if this == nil { - return false - } - if len(this.UIDMappings) != len(that1.UIDMappings) { - return false - } - for i := range this.UIDMappings { - if !this.UIDMappings[i].Equal(that1.UIDMappings[i]) { - return false - } - } - if len(this.GIDMappings) != len(that1.GIDMappings) { - return false - } - for i := range this.GIDMappings { - if !this.GIDMappings[i].Equal(that1.GIDMappings[i]) { - return false - } - } - if len(this.Sysctl) != len(that1.Sysctl) { - return false - } - for i := range this.Sysctl { - if this.Sysctl[i] != that1.Sysctl[i] { - return false - } - } - if !this.Resources.Equal(that1.Resources) { - return false - } - if this.CgroupsPath != that1.CgroupsPath { - return false - } - if len(this.Namespaces) != len(that1.Namespaces) { - return false - } - for i := range this.Namespaces { - if !this.Namespaces[i].Equal(that1.Namespaces[i]) { - return false - } - } - if len(this.Devices) != len(that1.Devices) { - return false - } - for i := range this.Devices { - if !this.Devices[i].Equal(that1.Devices[i]) { - return false - } - } - if !this.Seccomp.Equal(that1.Seccomp) { - return false - } - if this.RootfsPropagation != that1.RootfsPropagation { - return false - } - if len(this.MaskedPaths) != len(that1.MaskedPaths) { - return false - } - for i := range this.MaskedPaths { - if this.MaskedPaths[i] != that1.MaskedPaths[i] { - return false - } - } - if len(this.ReadonlyPaths) != len(that1.ReadonlyPaths) { - return false - } - for i := range this.ReadonlyPaths { - if this.ReadonlyPaths[i] != that1.ReadonlyPaths[i] { - return false - } - } - if this.MountLabel != that1.MountLabel { - return false - } - if !this.IntelRdt.Equal(that1.IntelRdt) { - return false - } - if !bytes.Equal(this.XXX_unrecognized, that1.XXX_unrecognized) { - return false - } - return true -} -func (this *Windows) Equal(that interface{}) bool { - if that == nil { - return this == nil - } - - that1, ok := that.(*Windows) - if !ok { - that2, ok := that.(Windows) - if ok { - that1 = &that2 - } else { - return false - } - } - if that1 == nil { - return this == nil - } else if this == nil { - return false - } - if this.Dummy != that1.Dummy { - return false - } - if !bytes.Equal(this.XXX_unrecognized, that1.XXX_unrecognized) { - return false - } - return true -} -func (this *Solaris) Equal(that interface{}) bool { - if that == nil { - return this == nil - } - - that1, ok := that.(*Solaris) - if !ok { - that2, ok := that.(Solaris) - if ok { - that1 = &that2 - } else { - return false - } - } - if that1 == nil { - return this == nil - } else if this == nil { - return false - } - if this.Dummy != that1.Dummy { - return false - } - if !bytes.Equal(this.XXX_unrecognized, that1.XXX_unrecognized) { - return false - } - return true -} -func (this *LinuxIDMapping) Equal(that interface{}) bool { - if that == nil { - return this == nil - } - - that1, ok := that.(*LinuxIDMapping) - if !ok { - that2, ok := that.(LinuxIDMapping) - if ok { - that1 = &that2 - } else { - return false - } - } - if that1 == nil { - return this == nil - } else if this == nil { - return false - } - if this.HostID != that1.HostID { - return false - } - if this.ContainerID != that1.ContainerID { - return false - } - if this.Size_ != that1.Size_ { - return false - } - if !bytes.Equal(this.XXX_unrecognized, that1.XXX_unrecognized) { - return false - } - return true -} -func (this *LinuxNamespace) Equal(that interface{}) bool { - if that == nil { - return this == nil - } - - that1, ok := that.(*LinuxNamespace) - if !ok { - that2, ok := that.(LinuxNamespace) - if ok { - that1 = &that2 - } else { - return false - } - } - if that1 == nil { - return this == nil - } else if this == nil { - return false - } - if this.Type != that1.Type { - return false - } - if this.Path != that1.Path { - return false - } - if !bytes.Equal(this.XXX_unrecognized, that1.XXX_unrecognized) { - return false - } - return true -} -func (this *LinuxDevice) Equal(that interface{}) bool { - if that == nil { - return this == nil - } - - that1, ok := that.(*LinuxDevice) - if !ok { - that2, ok := that.(LinuxDevice) - if ok { - that1 = &that2 - } else { - return false - } - } - if that1 == nil { - return this == nil - } else if this == nil { - return false - } - if this.Path != that1.Path { - return false - } - if this.Type != that1.Type { - return false - } - if this.Major != that1.Major { - return false - } - if this.Minor != that1.Minor { - return false - } - if this.FileMode != that1.FileMode { - return false - } - if this.UID != that1.UID { - return false - } - if this.GID != that1.GID { - return false - } - if !bytes.Equal(this.XXX_unrecognized, that1.XXX_unrecognized) { - return false - } - return true -} -func (this *LinuxResources) Equal(that interface{}) bool { - if that == nil { - return this == nil - } - - that1, ok := that.(*LinuxResources) - if !ok { - that2, ok := that.(LinuxResources) - if ok { - that1 = &that2 - } else { - return false - } - } - if that1 == nil { - return this == nil - } else if this == nil { - return false - } - if len(this.Devices) != len(that1.Devices) { - return false - } - for i := range this.Devices { - if !this.Devices[i].Equal(that1.Devices[i]) { - return false - } - } - if !this.Memory.Equal(that1.Memory) { - return false - } - if !this.CPU.Equal(that1.CPU) { - return false - } - if !this.Pids.Equal(that1.Pids) { - return false - } - if !this.BlockIO.Equal(that1.BlockIO) { - return false - } - if len(this.HugepageLimits) != len(that1.HugepageLimits) { - return false - } - for i := range this.HugepageLimits { - if !this.HugepageLimits[i].Equal(that1.HugepageLimits[i]) { - return false - } - } - if !this.Network.Equal(that1.Network) { - return false - } - if !bytes.Equal(this.XXX_unrecognized, that1.XXX_unrecognized) { - return false - } - return true -} -func (this *LinuxMemory) Equal(that interface{}) bool { - if that == nil { - return this == nil - } - - that1, ok := that.(*LinuxMemory) - if !ok { - that2, ok := that.(LinuxMemory) - if ok { - that1 = &that2 - } else { - return false - } - } - if that1 == nil { - return this == nil - } else if this == nil { - return false - } - if this.Limit != that1.Limit { - return false - } - if this.Reservation != that1.Reservation { - return false - } - if this.Swap != that1.Swap { - return false - } - if this.Kernel != that1.Kernel { - return false - } - if this.KernelTCP != that1.KernelTCP { - return false - } - if this.Swappiness != that1.Swappiness { - return false - } - if this.DisableOOMKiller != that1.DisableOOMKiller { - return false - } - if !bytes.Equal(this.XXX_unrecognized, that1.XXX_unrecognized) { - return false - } - return true -} -func (this *LinuxCPU) Equal(that interface{}) bool { - if that == nil { - return this == nil - } - - that1, ok := that.(*LinuxCPU) - if !ok { - that2, ok := that.(LinuxCPU) - if ok { - that1 = &that2 - } else { - return false - } - } - if that1 == nil { - return this == nil - } else if this == nil { - return false - } - if this.Shares != that1.Shares { - return false - } - if this.Quota != that1.Quota { - return false - } - if this.Period != that1.Period { - return false - } - if this.RealtimeRuntime != that1.RealtimeRuntime { - return false - } - if this.RealtimePeriod != that1.RealtimePeriod { - return false - } - if this.Cpus != that1.Cpus { - return false - } - if this.Mems != that1.Mems { - return false - } - if !bytes.Equal(this.XXX_unrecognized, that1.XXX_unrecognized) { - return false - } - return true -} -func (this *LinuxWeightDevice) Equal(that interface{}) bool { - if that == nil { - return this == nil - } - - that1, ok := that.(*LinuxWeightDevice) - if !ok { - that2, ok := that.(LinuxWeightDevice) - if ok { - that1 = &that2 - } else { - return false - } - } - if that1 == nil { - return this == nil - } else if this == nil { - return false - } - if this.Major != that1.Major { - return false - } - if this.Minor != that1.Minor { - return false - } - if this.Weight != that1.Weight { - return false - } - if this.LeafWeight != that1.LeafWeight { - return false - } - if !bytes.Equal(this.XXX_unrecognized, that1.XXX_unrecognized) { - return false - } - return true -} -func (this *LinuxThrottleDevice) Equal(that interface{}) bool { - if that == nil { - return this == nil - } - - that1, ok := that.(*LinuxThrottleDevice) - if !ok { - that2, ok := that.(LinuxThrottleDevice) - if ok { - that1 = &that2 - } else { - return false - } - } - if that1 == nil { - return this == nil - } else if this == nil { - return false - } - if this.Major != that1.Major { - return false - } - if this.Minor != that1.Minor { - return false - } - if this.Rate != that1.Rate { - return false - } - if !bytes.Equal(this.XXX_unrecognized, that1.XXX_unrecognized) { - return false - } - return true -} -func (this *LinuxBlockIO) Equal(that interface{}) bool { - if that == nil { - return this == nil - } - - that1, ok := that.(*LinuxBlockIO) - if !ok { - that2, ok := that.(LinuxBlockIO) - if ok { - that1 = &that2 - } else { - return false - } - } - if that1 == nil { - return this == nil - } else if this == nil { - return false - } - if this.Weight != that1.Weight { - return false - } - if this.LeafWeight != that1.LeafWeight { - return false - } - if len(this.WeightDevice) != len(that1.WeightDevice) { - return false - } - for i := range this.WeightDevice { - if !this.WeightDevice[i].Equal(that1.WeightDevice[i]) { - return false - } - } - if len(this.ThrottleReadBpsDevice) != len(that1.ThrottleReadBpsDevice) { - return false - } - for i := range this.ThrottleReadBpsDevice { - if !this.ThrottleReadBpsDevice[i].Equal(that1.ThrottleReadBpsDevice[i]) { - return false - } - } - if len(this.ThrottleWriteBpsDevice) != len(that1.ThrottleWriteBpsDevice) { - return false - } - for i := range this.ThrottleWriteBpsDevice { - if !this.ThrottleWriteBpsDevice[i].Equal(that1.ThrottleWriteBpsDevice[i]) { - return false - } - } - if len(this.ThrottleReadIOPSDevice) != len(that1.ThrottleReadIOPSDevice) { - return false - } - for i := range this.ThrottleReadIOPSDevice { - if !this.ThrottleReadIOPSDevice[i].Equal(that1.ThrottleReadIOPSDevice[i]) { - return false - } - } - if len(this.ThrottleWriteIOPSDevice) != len(that1.ThrottleWriteIOPSDevice) { - return false - } - for i := range this.ThrottleWriteIOPSDevice { - if !this.ThrottleWriteIOPSDevice[i].Equal(that1.ThrottleWriteIOPSDevice[i]) { - return false - } - } - if !bytes.Equal(this.XXX_unrecognized, that1.XXX_unrecognized) { - return false - } - return true -} -func (this *LinuxPids) Equal(that interface{}) bool { - if that == nil { - return this == nil - } - - that1, ok := that.(*LinuxPids) - if !ok { - that2, ok := that.(LinuxPids) - if ok { - that1 = &that2 - } else { - return false - } - } - if that1 == nil { - return this == nil - } else if this == nil { - return false - } - if this.Limit != that1.Limit { - return false - } - if !bytes.Equal(this.XXX_unrecognized, that1.XXX_unrecognized) { - return false - } - return true -} -func (this *LinuxDeviceCgroup) Equal(that interface{}) bool { - if that == nil { - return this == nil - } - - that1, ok := that.(*LinuxDeviceCgroup) - if !ok { - that2, ok := that.(LinuxDeviceCgroup) - if ok { - that1 = &that2 - } else { - return false - } - } - if that1 == nil { - return this == nil - } else if this == nil { - return false - } - if this.Allow != that1.Allow { - return false - } - if this.Type != that1.Type { - return false - } - if this.Major != that1.Major { - return false - } - if this.Minor != that1.Minor { - return false - } - if this.Access != that1.Access { - return false - } - if !bytes.Equal(this.XXX_unrecognized, that1.XXX_unrecognized) { - return false - } - return true -} -func (this *LinuxNetwork) Equal(that interface{}) bool { - if that == nil { - return this == nil - } - - that1, ok := that.(*LinuxNetwork) - if !ok { - that2, ok := that.(LinuxNetwork) - if ok { - that1 = &that2 - } else { - return false - } - } - if that1 == nil { - return this == nil - } else if this == nil { - return false - } - if this.ClassID != that1.ClassID { - return false - } - if len(this.Priorities) != len(that1.Priorities) { - return false - } - for i := range this.Priorities { - if !this.Priorities[i].Equal(that1.Priorities[i]) { - return false - } - } - if !bytes.Equal(this.XXX_unrecognized, that1.XXX_unrecognized) { - return false - } - return true -} -func (this *LinuxHugepageLimit) Equal(that interface{}) bool { - if that == nil { - return this == nil - } - - that1, ok := that.(*LinuxHugepageLimit) - if !ok { - that2, ok := that.(LinuxHugepageLimit) - if ok { - that1 = &that2 - } else { - return false - } - } - if that1 == nil { - return this == nil - } else if this == nil { - return false - } - if this.Pagesize != that1.Pagesize { - return false - } - if this.Limit != that1.Limit { - return false - } - if !bytes.Equal(this.XXX_unrecognized, that1.XXX_unrecognized) { - return false - } - return true -} -func (this *LinuxInterfacePriority) Equal(that interface{}) bool { - if that == nil { - return this == nil - } - - that1, ok := that.(*LinuxInterfacePriority) - if !ok { - that2, ok := that.(LinuxInterfacePriority) - if ok { - that1 = &that2 - } else { - return false - } - } - if that1 == nil { - return this == nil - } else if this == nil { - return false - } - if this.Name != that1.Name { - return false - } - if this.Priority != that1.Priority { - return false - } - if !bytes.Equal(this.XXX_unrecognized, that1.XXX_unrecognized) { - return false - } - return true -} -func (this *LinuxSeccomp) Equal(that interface{}) bool { - if that == nil { - return this == nil - } - - that1, ok := that.(*LinuxSeccomp) - if !ok { - that2, ok := that.(LinuxSeccomp) - if ok { - that1 = &that2 - } else { - return false - } - } - if that1 == nil { - return this == nil - } else if this == nil { - return false - } - if this.DefaultAction != that1.DefaultAction { - return false - } - if len(this.Architectures) != len(that1.Architectures) { - return false - } - for i := range this.Architectures { - if this.Architectures[i] != that1.Architectures[i] { - return false - } - } - if len(this.Flags) != len(that1.Flags) { - return false - } - for i := range this.Flags { - if this.Flags[i] != that1.Flags[i] { - return false - } - } - if len(this.Syscalls) != len(that1.Syscalls) { - return false - } - for i := range this.Syscalls { - if !this.Syscalls[i].Equal(that1.Syscalls[i]) { - return false - } - } - if !bytes.Equal(this.XXX_unrecognized, that1.XXX_unrecognized) { - return false - } - return true -} -func (this *LinuxSeccompArg) Equal(that interface{}) bool { - if that == nil { - return this == nil - } - - that1, ok := that.(*LinuxSeccompArg) - if !ok { - that2, ok := that.(LinuxSeccompArg) - if ok { - that1 = &that2 - } else { - return false - } - } - if that1 == nil { - return this == nil - } else if this == nil { - return false - } - if this.Index != that1.Index { - return false - } - if this.Value != that1.Value { - return false - } - if this.ValueTwo != that1.ValueTwo { - return false - } - if this.Op != that1.Op { - return false - } - if !bytes.Equal(this.XXX_unrecognized, that1.XXX_unrecognized) { - return false - } - return true -} -func (this *LinuxSyscall) Equal(that interface{}) bool { - if that == nil { - return this == nil - } - - that1, ok := that.(*LinuxSyscall) - if !ok { - that2, ok := that.(LinuxSyscall) - if ok { - that1 = &that2 - } else { - return false - } - } - if that1 == nil { - return this == nil - } else if this == nil { - return false - } - if len(this.Names) != len(that1.Names) { - return false - } - for i := range this.Names { - if this.Names[i] != that1.Names[i] { - return false - } - } - if this.Action != that1.Action { - return false - } - if that1.ErrnoRet == nil { - if this.ErrnoRet != nil { - return false - } - } else if this.ErrnoRet == nil { - return false - } else if !this.ErrnoRet.Equal(that1.ErrnoRet) { - return false - } - if len(this.Args) != len(that1.Args) { - return false - } - for i := range this.Args { - if !this.Args[i].Equal(that1.Args[i]) { - return false - } - } - if !bytes.Equal(this.XXX_unrecognized, that1.XXX_unrecognized) { - return false - } - return true -} -func (this *LinuxSyscall_Errnoret) Equal(that interface{}) bool { - if that == nil { - return this == nil - } - - that1, ok := that.(*LinuxSyscall_Errnoret) - if !ok { - that2, ok := that.(LinuxSyscall_Errnoret) - if ok { - that1 = &that2 - } else { - return false - } - } - if that1 == nil { - return this == nil - } else if this == nil { - return false - } - if this.Errnoret != that1.Errnoret { - return false - } - return true -} -func (this *LinuxIntelRdt) Equal(that interface{}) bool { - if that == nil { - return this == nil - } - - that1, ok := that.(*LinuxIntelRdt) - if !ok { - that2, ok := that.(LinuxIntelRdt) - if ok { - that1 = &that2 - } else { - return false - } - } - if that1 == nil { - return this == nil - } else if this == nil { - return false - } - if this.L3CacheSchema != that1.L3CacheSchema { - return false - } - if !bytes.Equal(this.XXX_unrecognized, that1.XXX_unrecognized) { - return false - } - return true -} func (m *Spec) Marshal() (dAtA []byte, err error) { size := m.Size() dAtA = make([]byte, size) @@ -5142,770 +3746,6 @@ func encodeVarintOci(dAtA []byte, offset int, v uint64) int { dAtA[offset] = uint8(v) return base } -func NewPopulatedSpec(r randyOci, easy bool) *Spec { - this := &Spec{} - this.Version = string(randStringOci(r)) - if r.Intn(5) != 0 { - this.Process = NewPopulatedProcess(r, easy) - } - if r.Intn(5) != 0 { - this.Root = NewPopulatedRoot(r, easy) - } - this.Hostname = string(randStringOci(r)) - if r.Intn(5) != 0 { - v1 := r.Intn(5) - this.Mounts = make([]*Mount, v1) - for i := 0; i < v1; i++ { - this.Mounts[i] = NewPopulatedMount(r, easy) - } - } - if r.Intn(5) != 0 { - this.Hooks = NewPopulatedHooks(r, easy) - } - if r.Intn(5) != 0 { - v2 := r.Intn(10) - this.Annotations = make(map[string]string) - for i := 0; i < v2; i++ { - this.Annotations[randStringOci(r)] = randStringOci(r) - } - } - if r.Intn(5) != 0 { - this.Linux = NewPopulatedLinux(r, easy) - } - if r.Intn(5) != 0 { - this.Solaris = NewPopulatedSolaris(r, easy) - } - if r.Intn(5) != 0 { - this.Windows = NewPopulatedWindows(r, easy) - } - if !easy && r.Intn(10) != 0 { - this.XXX_unrecognized = randUnrecognizedOci(r, 11) - } - return this -} - -func NewPopulatedProcess(r randyOci, easy bool) *Process { - this := &Process{} - this.Terminal = bool(bool(r.Intn(2) == 0)) - if r.Intn(5) != 0 { - this.ConsoleSize = NewPopulatedBox(r, easy) - } - if r.Intn(5) != 0 { - this.User = NewPopulatedUser(r, easy) - } - v3 := r.Intn(10) - this.Args = make([]string, v3) - for i := 0; i < v3; i++ { - this.Args[i] = string(randStringOci(r)) - } - v4 := r.Intn(10) - this.Env = make([]string, v4) - for i := 0; i < v4; i++ { - this.Env[i] = string(randStringOci(r)) - } - this.Cwd = string(randStringOci(r)) - if r.Intn(5) != 0 { - this.Capabilities = NewPopulatedLinuxCapabilities(r, easy) - } - if r.Intn(5) != 0 { - v5 := r.Intn(5) - this.Rlimits = make([]*POSIXRlimit, v5) - for i := 0; i < v5; i++ { - this.Rlimits[i] = NewPopulatedPOSIXRlimit(r, easy) - } - } - this.NoNewPrivileges = bool(bool(r.Intn(2) == 0)) - this.ApparmorProfile = string(randStringOci(r)) - this.OOMScoreAdj = int64(r.Int63()) - if r.Intn(2) == 0 { - this.OOMScoreAdj *= -1 - } - this.SelinuxLabel = string(randStringOci(r)) - if !easy && r.Intn(10) != 0 { - this.XXX_unrecognized = randUnrecognizedOci(r, 13) - } - return this -} - -func NewPopulatedBox(r randyOci, easy bool) *Box { - this := &Box{} - this.Height = uint32(r.Uint32()) - this.Width = uint32(r.Uint32()) - if !easy && r.Intn(10) != 0 { - this.XXX_unrecognized = randUnrecognizedOci(r, 3) - } - return this -} - -func NewPopulatedUser(r randyOci, easy bool) *User { - this := &User{} - this.UID = uint32(r.Uint32()) - this.GID = uint32(r.Uint32()) - v6 := r.Intn(10) - this.AdditionalGids = make([]uint32, v6) - for i := 0; i < v6; i++ { - this.AdditionalGids[i] = uint32(r.Uint32()) - } - this.Username = string(randStringOci(r)) - if !easy && r.Intn(10) != 0 { - this.XXX_unrecognized = randUnrecognizedOci(r, 5) - } - return this -} - -func NewPopulatedLinuxCapabilities(r randyOci, easy bool) *LinuxCapabilities { - this := &LinuxCapabilities{} - v7 := r.Intn(10) - this.Bounding = make([]string, v7) - for i := 0; i < v7; i++ { - this.Bounding[i] = string(randStringOci(r)) - } - v8 := r.Intn(10) - this.Effective = make([]string, v8) - for i := 0; i < v8; i++ { - this.Effective[i] = string(randStringOci(r)) - } - v9 := r.Intn(10) - this.Inheritable = make([]string, v9) - for i := 0; i < v9; i++ { - this.Inheritable[i] = string(randStringOci(r)) - } - v10 := r.Intn(10) - this.Permitted = make([]string, v10) - for i := 0; i < v10; i++ { - this.Permitted[i] = string(randStringOci(r)) - } - v11 := r.Intn(10) - this.Ambient = make([]string, v11) - for i := 0; i < v11; i++ { - this.Ambient[i] = string(randStringOci(r)) - } - if !easy && r.Intn(10) != 0 { - this.XXX_unrecognized = randUnrecognizedOci(r, 6) - } - return this -} - -func NewPopulatedPOSIXRlimit(r randyOci, easy bool) *POSIXRlimit { - this := &POSIXRlimit{} - this.Type = string(randStringOci(r)) - this.Hard = uint64(uint64(r.Uint32())) - this.Soft = uint64(uint64(r.Uint32())) - if !easy && r.Intn(10) != 0 { - this.XXX_unrecognized = randUnrecognizedOci(r, 4) - } - return this -} - -func NewPopulatedMount(r randyOci, easy bool) *Mount { - this := &Mount{} - this.Destination = string(randStringOci(r)) - this.Source = string(randStringOci(r)) - this.Type = string(randStringOci(r)) - v12 := r.Intn(10) - this.Options = make([]string, v12) - for i := 0; i < v12; i++ { - this.Options[i] = string(randStringOci(r)) - } - if !easy && r.Intn(10) != 0 { - this.XXX_unrecognized = randUnrecognizedOci(r, 5) - } - return this -} - -func NewPopulatedRoot(r randyOci, easy bool) *Root { - this := &Root{} - this.Path = string(randStringOci(r)) - this.Readonly = bool(bool(r.Intn(2) == 0)) - if !easy && r.Intn(10) != 0 { - this.XXX_unrecognized = randUnrecognizedOci(r, 3) - } - return this -} - -func NewPopulatedHooks(r randyOci, easy bool) *Hooks { - this := &Hooks{} - if r.Intn(5) != 0 { - v13 := r.Intn(5) - this.Prestart = make([]*Hook, v13) - for i := 0; i < v13; i++ { - this.Prestart[i] = NewPopulatedHook(r, easy) - } - } - if r.Intn(5) != 0 { - v14 := r.Intn(5) - this.Poststart = make([]*Hook, v14) - for i := 0; i < v14; i++ { - this.Poststart[i] = NewPopulatedHook(r, easy) - } - } - if r.Intn(5) != 0 { - v15 := r.Intn(5) - this.Poststop = make([]*Hook, v15) - for i := 0; i < v15; i++ { - this.Poststop[i] = NewPopulatedHook(r, easy) - } - } - if r.Intn(5) != 0 { - v16 := r.Intn(5) - this.CreateRuntime = make([]*Hook, v16) - for i := 0; i < v16; i++ { - this.CreateRuntime[i] = NewPopulatedHook(r, easy) - } - } - if r.Intn(5) != 0 { - v17 := r.Intn(5) - this.CreateContainer = make([]*Hook, v17) - for i := 0; i < v17; i++ { - this.CreateContainer[i] = NewPopulatedHook(r, easy) - } - } - if r.Intn(5) != 0 { - v18 := r.Intn(5) - this.StartContainer = make([]*Hook, v18) - for i := 0; i < v18; i++ { - this.StartContainer[i] = NewPopulatedHook(r, easy) - } - } - if !easy && r.Intn(10) != 0 { - this.XXX_unrecognized = randUnrecognizedOci(r, 7) - } - return this -} - -func NewPopulatedHook(r randyOci, easy bool) *Hook { - this := &Hook{} - this.Path = string(randStringOci(r)) - v19 := r.Intn(10) - this.Args = make([]string, v19) - for i := 0; i < v19; i++ { - this.Args[i] = string(randStringOci(r)) - } - v20 := r.Intn(10) - this.Env = make([]string, v20) - for i := 0; i < v20; i++ { - this.Env[i] = string(randStringOci(r)) - } - this.Timeout = int64(r.Int63()) - if r.Intn(2) == 0 { - this.Timeout *= -1 - } - if !easy && r.Intn(10) != 0 { - this.XXX_unrecognized = randUnrecognizedOci(r, 5) - } - return this -} - -func NewPopulatedLinux(r randyOci, easy bool) *Linux { - this := &Linux{} - if r.Intn(5) != 0 { - v21 := r.Intn(5) - this.UIDMappings = make([]*LinuxIDMapping, v21) - for i := 0; i < v21; i++ { - this.UIDMappings[i] = NewPopulatedLinuxIDMapping(r, easy) - } - } - if r.Intn(5) != 0 { - v22 := r.Intn(5) - this.GIDMappings = make([]*LinuxIDMapping, v22) - for i := 0; i < v22; i++ { - this.GIDMappings[i] = NewPopulatedLinuxIDMapping(r, easy) - } - } - if r.Intn(5) != 0 { - v23 := r.Intn(10) - this.Sysctl = make(map[string]string) - for i := 0; i < v23; i++ { - this.Sysctl[randStringOci(r)] = randStringOci(r) - } - } - if r.Intn(5) != 0 { - this.Resources = NewPopulatedLinuxResources(r, easy) - } - this.CgroupsPath = string(randStringOci(r)) - if r.Intn(5) != 0 { - v24 := r.Intn(5) - this.Namespaces = make([]*LinuxNamespace, v24) - for i := 0; i < v24; i++ { - this.Namespaces[i] = NewPopulatedLinuxNamespace(r, easy) - } - } - if r.Intn(5) != 0 { - v25 := r.Intn(5) - this.Devices = make([]*LinuxDevice, v25) - for i := 0; i < v25; i++ { - this.Devices[i] = NewPopulatedLinuxDevice(r, easy) - } - } - if r.Intn(5) != 0 { - this.Seccomp = NewPopulatedLinuxSeccomp(r, easy) - } - this.RootfsPropagation = string(randStringOci(r)) - v26 := r.Intn(10) - this.MaskedPaths = make([]string, v26) - for i := 0; i < v26; i++ { - this.MaskedPaths[i] = string(randStringOci(r)) - } - v27 := r.Intn(10) - this.ReadonlyPaths = make([]string, v27) - for i := 0; i < v27; i++ { - this.ReadonlyPaths[i] = string(randStringOci(r)) - } - this.MountLabel = string(randStringOci(r)) - if r.Intn(5) != 0 { - this.IntelRdt = NewPopulatedLinuxIntelRdt(r, easy) - } - if !easy && r.Intn(10) != 0 { - this.XXX_unrecognized = randUnrecognizedOci(r, 14) - } - return this -} - -func NewPopulatedWindows(r randyOci, easy bool) *Windows { - this := &Windows{} - this.Dummy = string(randStringOci(r)) - if !easy && r.Intn(10) != 0 { - this.XXX_unrecognized = randUnrecognizedOci(r, 2) - } - return this -} - -func NewPopulatedSolaris(r randyOci, easy bool) *Solaris { - this := &Solaris{} - this.Dummy = string(randStringOci(r)) - if !easy && r.Intn(10) != 0 { - this.XXX_unrecognized = randUnrecognizedOci(r, 2) - } - return this -} - -func NewPopulatedLinuxIDMapping(r randyOci, easy bool) *LinuxIDMapping { - this := &LinuxIDMapping{} - this.HostID = uint32(r.Uint32()) - this.ContainerID = uint32(r.Uint32()) - this.Size_ = uint32(r.Uint32()) - if !easy && r.Intn(10) != 0 { - this.XXX_unrecognized = randUnrecognizedOci(r, 4) - } - return this -} - -func NewPopulatedLinuxNamespace(r randyOci, easy bool) *LinuxNamespace { - this := &LinuxNamespace{} - this.Type = string(randStringOci(r)) - this.Path = string(randStringOci(r)) - if !easy && r.Intn(10) != 0 { - this.XXX_unrecognized = randUnrecognizedOci(r, 3) - } - return this -} - -func NewPopulatedLinuxDevice(r randyOci, easy bool) *LinuxDevice { - this := &LinuxDevice{} - this.Path = string(randStringOci(r)) - this.Type = string(randStringOci(r)) - this.Major = int64(r.Int63()) - if r.Intn(2) == 0 { - this.Major *= -1 - } - this.Minor = int64(r.Int63()) - if r.Intn(2) == 0 { - this.Minor *= -1 - } - this.FileMode = uint32(r.Uint32()) - this.UID = uint32(r.Uint32()) - this.GID = uint32(r.Uint32()) - if !easy && r.Intn(10) != 0 { - this.XXX_unrecognized = randUnrecognizedOci(r, 8) - } - return this -} - -func NewPopulatedLinuxResources(r randyOci, easy bool) *LinuxResources { - this := &LinuxResources{} - if r.Intn(5) != 0 { - v28 := r.Intn(5) - this.Devices = make([]*LinuxDeviceCgroup, v28) - for i := 0; i < v28; i++ { - this.Devices[i] = NewPopulatedLinuxDeviceCgroup(r, easy) - } - } - if r.Intn(5) != 0 { - this.Memory = NewPopulatedLinuxMemory(r, easy) - } - if r.Intn(5) != 0 { - this.CPU = NewPopulatedLinuxCPU(r, easy) - } - if r.Intn(5) != 0 { - this.Pids = NewPopulatedLinuxPids(r, easy) - } - if r.Intn(5) != 0 { - this.BlockIO = NewPopulatedLinuxBlockIO(r, easy) - } - if r.Intn(5) != 0 { - v29 := r.Intn(5) - this.HugepageLimits = make([]*LinuxHugepageLimit, v29) - for i := 0; i < v29; i++ { - this.HugepageLimits[i] = NewPopulatedLinuxHugepageLimit(r, easy) - } - } - if r.Intn(5) != 0 { - this.Network = NewPopulatedLinuxNetwork(r, easy) - } - if !easy && r.Intn(10) != 0 { - this.XXX_unrecognized = randUnrecognizedOci(r, 8) - } - return this -} - -func NewPopulatedLinuxMemory(r randyOci, easy bool) *LinuxMemory { - this := &LinuxMemory{} - this.Limit = int64(r.Int63()) - if r.Intn(2) == 0 { - this.Limit *= -1 - } - this.Reservation = int64(r.Int63()) - if r.Intn(2) == 0 { - this.Reservation *= -1 - } - this.Swap = int64(r.Int63()) - if r.Intn(2) == 0 { - this.Swap *= -1 - } - this.Kernel = int64(r.Int63()) - if r.Intn(2) == 0 { - this.Kernel *= -1 - } - this.KernelTCP = int64(r.Int63()) - if r.Intn(2) == 0 { - this.KernelTCP *= -1 - } - this.Swappiness = uint64(uint64(r.Uint32())) - this.DisableOOMKiller = bool(bool(r.Intn(2) == 0)) - if !easy && r.Intn(10) != 0 { - this.XXX_unrecognized = randUnrecognizedOci(r, 8) - } - return this -} - -func NewPopulatedLinuxCPU(r randyOci, easy bool) *LinuxCPU { - this := &LinuxCPU{} - this.Shares = uint64(uint64(r.Uint32())) - this.Quota = int64(r.Int63()) - if r.Intn(2) == 0 { - this.Quota *= -1 - } - this.Period = uint64(uint64(r.Uint32())) - this.RealtimeRuntime = int64(r.Int63()) - if r.Intn(2) == 0 { - this.RealtimeRuntime *= -1 - } - this.RealtimePeriod = uint64(uint64(r.Uint32())) - this.Cpus = string(randStringOci(r)) - this.Mems = string(randStringOci(r)) - if !easy && r.Intn(10) != 0 { - this.XXX_unrecognized = randUnrecognizedOci(r, 8) - } - return this -} - -func NewPopulatedLinuxWeightDevice(r randyOci, easy bool) *LinuxWeightDevice { - this := &LinuxWeightDevice{} - this.Major = int64(r.Int63()) - if r.Intn(2) == 0 { - this.Major *= -1 - } - this.Minor = int64(r.Int63()) - if r.Intn(2) == 0 { - this.Minor *= -1 - } - this.Weight = uint32(r.Uint32()) - this.LeafWeight = uint32(r.Uint32()) - if !easy && r.Intn(10) != 0 { - this.XXX_unrecognized = randUnrecognizedOci(r, 5) - } - return this -} - -func NewPopulatedLinuxThrottleDevice(r randyOci, easy bool) *LinuxThrottleDevice { - this := &LinuxThrottleDevice{} - this.Major = int64(r.Int63()) - if r.Intn(2) == 0 { - this.Major *= -1 - } - this.Minor = int64(r.Int63()) - if r.Intn(2) == 0 { - this.Minor *= -1 - } - this.Rate = uint64(uint64(r.Uint32())) - if !easy && r.Intn(10) != 0 { - this.XXX_unrecognized = randUnrecognizedOci(r, 4) - } - return this -} - -func NewPopulatedLinuxBlockIO(r randyOci, easy bool) *LinuxBlockIO { - this := &LinuxBlockIO{} - this.Weight = uint32(r.Uint32()) - this.LeafWeight = uint32(r.Uint32()) - if r.Intn(5) != 0 { - v30 := r.Intn(5) - this.WeightDevice = make([]*LinuxWeightDevice, v30) - for i := 0; i < v30; i++ { - this.WeightDevice[i] = NewPopulatedLinuxWeightDevice(r, easy) - } - } - if r.Intn(5) != 0 { - v31 := r.Intn(5) - this.ThrottleReadBpsDevice = make([]*LinuxThrottleDevice, v31) - for i := 0; i < v31; i++ { - this.ThrottleReadBpsDevice[i] = NewPopulatedLinuxThrottleDevice(r, easy) - } - } - if r.Intn(5) != 0 { - v32 := r.Intn(5) - this.ThrottleWriteBpsDevice = make([]*LinuxThrottleDevice, v32) - for i := 0; i < v32; i++ { - this.ThrottleWriteBpsDevice[i] = NewPopulatedLinuxThrottleDevice(r, easy) - } - } - if r.Intn(5) != 0 { - v33 := r.Intn(5) - this.ThrottleReadIOPSDevice = make([]*LinuxThrottleDevice, v33) - for i := 0; i < v33; i++ { - this.ThrottleReadIOPSDevice[i] = NewPopulatedLinuxThrottleDevice(r, easy) - } - } - if r.Intn(5) != 0 { - v34 := r.Intn(5) - this.ThrottleWriteIOPSDevice = make([]*LinuxThrottleDevice, v34) - for i := 0; i < v34; i++ { - this.ThrottleWriteIOPSDevice[i] = NewPopulatedLinuxThrottleDevice(r, easy) - } - } - if !easy && r.Intn(10) != 0 { - this.XXX_unrecognized = randUnrecognizedOci(r, 8) - } - return this -} - -func NewPopulatedLinuxPids(r randyOci, easy bool) *LinuxPids { - this := &LinuxPids{} - this.Limit = int64(r.Int63()) - if r.Intn(2) == 0 { - this.Limit *= -1 - } - if !easy && r.Intn(10) != 0 { - this.XXX_unrecognized = randUnrecognizedOci(r, 2) - } - return this -} - -func NewPopulatedLinuxDeviceCgroup(r randyOci, easy bool) *LinuxDeviceCgroup { - this := &LinuxDeviceCgroup{} - this.Allow = bool(bool(r.Intn(2) == 0)) - this.Type = string(randStringOci(r)) - this.Major = int64(r.Int63()) - if r.Intn(2) == 0 { - this.Major *= -1 - } - this.Minor = int64(r.Int63()) - if r.Intn(2) == 0 { - this.Minor *= -1 - } - this.Access = string(randStringOci(r)) - if !easy && r.Intn(10) != 0 { - this.XXX_unrecognized = randUnrecognizedOci(r, 6) - } - return this -} - -func NewPopulatedLinuxNetwork(r randyOci, easy bool) *LinuxNetwork { - this := &LinuxNetwork{} - this.ClassID = uint32(r.Uint32()) - if r.Intn(5) != 0 { - v35 := r.Intn(5) - this.Priorities = make([]*LinuxInterfacePriority, v35) - for i := 0; i < v35; i++ { - this.Priorities[i] = NewPopulatedLinuxInterfacePriority(r, easy) - } - } - if !easy && r.Intn(10) != 0 { - this.XXX_unrecognized = randUnrecognizedOci(r, 3) - } - return this -} - -func NewPopulatedLinuxHugepageLimit(r randyOci, easy bool) *LinuxHugepageLimit { - this := &LinuxHugepageLimit{} - this.Pagesize = string(randStringOci(r)) - this.Limit = uint64(uint64(r.Uint32())) - if !easy && r.Intn(10) != 0 { - this.XXX_unrecognized = randUnrecognizedOci(r, 3) - } - return this -} - -func NewPopulatedLinuxInterfacePriority(r randyOci, easy bool) *LinuxInterfacePriority { - this := &LinuxInterfacePriority{} - this.Name = string(randStringOci(r)) - this.Priority = uint32(r.Uint32()) - if !easy && r.Intn(10) != 0 { - this.XXX_unrecognized = randUnrecognizedOci(r, 3) - } - return this -} - -func NewPopulatedLinuxSeccomp(r randyOci, easy bool) *LinuxSeccomp { - this := &LinuxSeccomp{} - this.DefaultAction = string(randStringOci(r)) - v36 := r.Intn(10) - this.Architectures = make([]string, v36) - for i := 0; i < v36; i++ { - this.Architectures[i] = string(randStringOci(r)) - } - v37 := r.Intn(10) - this.Flags = make([]string, v37) - for i := 0; i < v37; i++ { - this.Flags[i] = string(randStringOci(r)) - } - if r.Intn(5) != 0 { - v38 := r.Intn(5) - this.Syscalls = make([]*LinuxSyscall, v38) - for i := 0; i < v38; i++ { - this.Syscalls[i] = NewPopulatedLinuxSyscall(r, easy) - } - } - if !easy && r.Intn(10) != 0 { - this.XXX_unrecognized = randUnrecognizedOci(r, 5) - } - return this -} - -func NewPopulatedLinuxSeccompArg(r randyOci, easy bool) *LinuxSeccompArg { - this := &LinuxSeccompArg{} - this.Index = uint64(uint64(r.Uint32())) - this.Value = uint64(uint64(r.Uint32())) - this.ValueTwo = uint64(uint64(r.Uint32())) - this.Op = string(randStringOci(r)) - if !easy && r.Intn(10) != 0 { - this.XXX_unrecognized = randUnrecognizedOci(r, 5) - } - return this -} - -func NewPopulatedLinuxSyscall(r randyOci, easy bool) *LinuxSyscall { - this := &LinuxSyscall{} - v39 := r.Intn(10) - this.Names = make([]string, v39) - for i := 0; i < v39; i++ { - this.Names[i] = string(randStringOci(r)) - } - this.Action = string(randStringOci(r)) - oneofNumber_ErrnoRet := []int32{3}[r.Intn(1)] - switch oneofNumber_ErrnoRet { - case 3: - this.ErrnoRet = NewPopulatedLinuxSyscall_Errnoret(r, easy) - } - if r.Intn(5) != 0 { - v40 := r.Intn(5) - this.Args = make([]*LinuxSeccompArg, v40) - for i := 0; i < v40; i++ { - this.Args[i] = NewPopulatedLinuxSeccompArg(r, easy) - } - } - if !easy && r.Intn(10) != 0 { - this.XXX_unrecognized = randUnrecognizedOci(r, 5) - } - return this -} - -func NewPopulatedLinuxSyscall_Errnoret(r randyOci, easy bool) *LinuxSyscall_Errnoret { - this := &LinuxSyscall_Errnoret{} - this.Errnoret = uint32(r.Uint32()) - return this -} -func NewPopulatedLinuxIntelRdt(r randyOci, easy bool) *LinuxIntelRdt { - this := &LinuxIntelRdt{} - this.L3CacheSchema = string(randStringOci(r)) - if !easy && r.Intn(10) != 0 { - this.XXX_unrecognized = randUnrecognizedOci(r, 2) - } - return this -} - -type randyOci interface { - Float32() float32 - Float64() float64 - Int63() int64 - Int31() int32 - Uint32() uint32 - Intn(n int) int -} - -func randUTF8RuneOci(r randyOci) rune { - ru := r.Intn(62) - if ru < 10 { - return rune(ru + 48) - } else if ru < 36 { - return rune(ru + 55) - } - return rune(ru + 61) -} -func randStringOci(r randyOci) string { - v41 := r.Intn(100) - tmps := make([]rune, v41) - for i := 0; i < v41; i++ { - tmps[i] = randUTF8RuneOci(r) - } - return string(tmps) -} -func randUnrecognizedOci(r randyOci, maxFieldNumber int) (dAtA []byte) { - l := r.Intn(5) - for i := 0; i < l; i++ { - wire := r.Intn(4) - if wire == 3 { - wire = 5 - } - fieldNumber := maxFieldNumber + r.Intn(100) - dAtA = randFieldOci(dAtA, r, fieldNumber, wire) - } - return dAtA -} -func randFieldOci(dAtA []byte, r randyOci, fieldNumber int, wire int) []byte { - key := uint32(fieldNumber)<<3 | uint32(wire) - switch wire { - case 0: - dAtA = encodeVarintPopulateOci(dAtA, uint64(key)) - v42 := r.Int63() - if r.Intn(2) == 0 { - v42 *= -1 - } - dAtA = encodeVarintPopulateOci(dAtA, uint64(v42)) - case 1: - dAtA = encodeVarintPopulateOci(dAtA, uint64(key)) - dAtA = append(dAtA, byte(r.Intn(256)), byte(r.Intn(256)), byte(r.Intn(256)), byte(r.Intn(256)), byte(r.Intn(256)), byte(r.Intn(256)), byte(r.Intn(256)), byte(r.Intn(256))) - case 2: - dAtA = encodeVarintPopulateOci(dAtA, uint64(key)) - ll := r.Intn(100) - dAtA = encodeVarintPopulateOci(dAtA, uint64(ll)) - for j := 0; j < ll; j++ { - dAtA = append(dAtA, byte(r.Intn(256))) - } - default: - dAtA = encodeVarintPopulateOci(dAtA, uint64(key)) - dAtA = append(dAtA, byte(r.Intn(256)), byte(r.Intn(256)), byte(r.Intn(256)), byte(r.Intn(256))) - } - return dAtA -} -func encodeVarintPopulateOci(dAtA []byte, v uint64) []byte { - for v >= 1<<7 { - dAtA = append(dAtA, uint8(uint64(v)&0x7f|0x80)) - v >>= 7 - } - dAtA = append(dAtA, uint8(v)) - return dAtA -} func (m *Spec) Size() (n int) { if m == nil { return 0 diff --git a/src/runtime/virtcontainers/pkg/agent/protocols/grpc/ocipb_test.go b/src/runtime/virtcontainers/pkg/agent/protocols/grpc/ocipb_test.go deleted file mode 100644 index 5aa4de2adf..0000000000 --- a/src/runtime/virtcontainers/pkg/agent/protocols/grpc/ocipb_test.go +++ /dev/null @@ -1,5821 +0,0 @@ -// Code generated by protoc-gen-gogo. DO NOT EDIT. -// source: oci.proto - -package grpc - -import ( - fmt "fmt" - _ "github.com/gogo/protobuf/gogoproto" - github_com_gogo_protobuf_jsonpb "github.com/gogo/protobuf/jsonpb" - github_com_gogo_protobuf_proto "github.com/gogo/protobuf/proto" - proto "github.com/gogo/protobuf/proto" - math "math" - math_rand "math/rand" - testing "testing" - time "time" -) - -// Reference imports to suppress errors if they are not otherwise used. -var _ = proto.Marshal -var _ = fmt.Errorf -var _ = math.Inf - -func TestSpecProto(t *testing.T) { - seed := time.Now().UnixNano() - popr := math_rand.New(math_rand.NewSource(seed)) - p := NewPopulatedSpec(popr, false) - dAtA, err := github_com_gogo_protobuf_proto.Marshal(p) - if err != nil { - t.Fatalf("seed = %d, err = %v", seed, err) - } - msg := &Spec{} - if err := github_com_gogo_protobuf_proto.Unmarshal(dAtA, msg); err != nil { - t.Fatalf("seed = %d, err = %v", seed, err) - } - littlefuzz := make([]byte, len(dAtA)) - copy(littlefuzz, dAtA) - for i := range dAtA { - dAtA[i] = byte(popr.Intn(256)) - } - if !p.Equal(msg) { - t.Fatalf("seed = %d, %#v !Proto %#v", seed, msg, p) - } - if len(littlefuzz) > 0 { - fuzzamount := 100 - for i := 0; i < fuzzamount; i++ { - littlefuzz[popr.Intn(len(littlefuzz))] = byte(popr.Intn(256)) - littlefuzz = append(littlefuzz, byte(popr.Intn(256))) - } - // shouldn't panic - _ = github_com_gogo_protobuf_proto.Unmarshal(littlefuzz, msg) - } -} - -func TestSpecMarshalTo(t *testing.T) { - seed := time.Now().UnixNano() - popr := math_rand.New(math_rand.NewSource(seed)) - p := NewPopulatedSpec(popr, false) - size := p.Size() - dAtA := make([]byte, size) - for i := range dAtA { - dAtA[i] = byte(popr.Intn(256)) - } - _, err := p.MarshalTo(dAtA) - if err != nil { - t.Fatalf("seed = %d, err = %v", seed, err) - } - msg := &Spec{} - if err := github_com_gogo_protobuf_proto.Unmarshal(dAtA, msg); err != nil { - t.Fatalf("seed = %d, err = %v", seed, err) - } - for i := range dAtA { - dAtA[i] = byte(popr.Intn(256)) - } - if !p.Equal(msg) { - t.Fatalf("seed = %d, %#v !Proto %#v", seed, msg, p) - } -} - -func BenchmarkSpecProtoMarshal(b *testing.B) { - popr := math_rand.New(math_rand.NewSource(616)) - total := 0 - pops := make([]*Spec, 10000) - for i := 0; i < 10000; i++ { - pops[i] = NewPopulatedSpec(popr, false) - } - b.ResetTimer() - for i := 0; i < b.N; i++ { - dAtA, err := github_com_gogo_protobuf_proto.Marshal(pops[i%10000]) - if err != nil { - panic(err) - } - total += len(dAtA) - } - b.SetBytes(int64(total / b.N)) -} - -func BenchmarkSpecProtoUnmarshal(b *testing.B) { - popr := math_rand.New(math_rand.NewSource(616)) - total := 0 - datas := make([][]byte, 10000) - for i := 0; i < 10000; i++ { - dAtA, err := github_com_gogo_protobuf_proto.Marshal(NewPopulatedSpec(popr, false)) - if err != nil { - panic(err) - } - datas[i] = dAtA - } - msg := &Spec{} - b.ResetTimer() - for i := 0; i < b.N; i++ { - total += len(datas[i%10000]) - if err := github_com_gogo_protobuf_proto.Unmarshal(datas[i%10000], msg); err != nil { - panic(err) - } - } - b.SetBytes(int64(total / b.N)) -} - -func TestProcessProto(t *testing.T) { - seed := time.Now().UnixNano() - popr := math_rand.New(math_rand.NewSource(seed)) - p := NewPopulatedProcess(popr, false) - dAtA, err := github_com_gogo_protobuf_proto.Marshal(p) - if err != nil { - t.Fatalf("seed = %d, err = %v", seed, err) - } - msg := &Process{} - if err := github_com_gogo_protobuf_proto.Unmarshal(dAtA, msg); err != nil { - t.Fatalf("seed = %d, err = %v", seed, err) - } - littlefuzz := make([]byte, len(dAtA)) - copy(littlefuzz, dAtA) - for i := range dAtA { - dAtA[i] = byte(popr.Intn(256)) - } - if !p.Equal(msg) { - t.Fatalf("seed = %d, %#v !Proto %#v", seed, msg, p) - } - if len(littlefuzz) > 0 { - fuzzamount := 100 - for i := 0; i < fuzzamount; i++ { - littlefuzz[popr.Intn(len(littlefuzz))] = byte(popr.Intn(256)) - littlefuzz = append(littlefuzz, byte(popr.Intn(256))) - } - // shouldn't panic - _ = github_com_gogo_protobuf_proto.Unmarshal(littlefuzz, msg) - } -} - -func TestProcessMarshalTo(t *testing.T) { - seed := time.Now().UnixNano() - popr := math_rand.New(math_rand.NewSource(seed)) - p := NewPopulatedProcess(popr, false) - size := p.Size() - dAtA := make([]byte, size) - for i := range dAtA { - dAtA[i] = byte(popr.Intn(256)) - } - _, err := p.MarshalTo(dAtA) - if err != nil { - t.Fatalf("seed = %d, err = %v", seed, err) - } - msg := &Process{} - if err := github_com_gogo_protobuf_proto.Unmarshal(dAtA, msg); err != nil { - t.Fatalf("seed = %d, err = %v", seed, err) - } - for i := range dAtA { - dAtA[i] = byte(popr.Intn(256)) - } - if !p.Equal(msg) { - t.Fatalf("seed = %d, %#v !Proto %#v", seed, msg, p) - } -} - -func BenchmarkProcessProtoMarshal(b *testing.B) { - popr := math_rand.New(math_rand.NewSource(616)) - total := 0 - pops := make([]*Process, 10000) - for i := 0; i < 10000; i++ { - pops[i] = NewPopulatedProcess(popr, false) - } - b.ResetTimer() - for i := 0; i < b.N; i++ { - dAtA, err := github_com_gogo_protobuf_proto.Marshal(pops[i%10000]) - if err != nil { - panic(err) - } - total += len(dAtA) - } - b.SetBytes(int64(total / b.N)) -} - -func BenchmarkProcessProtoUnmarshal(b *testing.B) { - popr := math_rand.New(math_rand.NewSource(616)) - total := 0 - datas := make([][]byte, 10000) - for i := 0; i < 10000; i++ { - dAtA, err := github_com_gogo_protobuf_proto.Marshal(NewPopulatedProcess(popr, false)) - if err != nil { - panic(err) - } - datas[i] = dAtA - } - msg := &Process{} - b.ResetTimer() - for i := 0; i < b.N; i++ { - total += len(datas[i%10000]) - if err := github_com_gogo_protobuf_proto.Unmarshal(datas[i%10000], msg); err != nil { - panic(err) - } - } - b.SetBytes(int64(total / b.N)) -} - -func TestBoxProto(t *testing.T) { - seed := time.Now().UnixNano() - popr := math_rand.New(math_rand.NewSource(seed)) - p := NewPopulatedBox(popr, false) - dAtA, err := github_com_gogo_protobuf_proto.Marshal(p) - if err != nil { - t.Fatalf("seed = %d, err = %v", seed, err) - } - msg := &Box{} - if err := github_com_gogo_protobuf_proto.Unmarshal(dAtA, msg); err != nil { - t.Fatalf("seed = %d, err = %v", seed, err) - } - littlefuzz := make([]byte, len(dAtA)) - copy(littlefuzz, dAtA) - for i := range dAtA { - dAtA[i] = byte(popr.Intn(256)) - } - if !p.Equal(msg) { - t.Fatalf("seed = %d, %#v !Proto %#v", seed, msg, p) - } - if len(littlefuzz) > 0 { - fuzzamount := 100 - for i := 0; i < fuzzamount; i++ { - littlefuzz[popr.Intn(len(littlefuzz))] = byte(popr.Intn(256)) - littlefuzz = append(littlefuzz, byte(popr.Intn(256))) - } - // shouldn't panic - _ = github_com_gogo_protobuf_proto.Unmarshal(littlefuzz, msg) - } -} - -func TestBoxMarshalTo(t *testing.T) { - seed := time.Now().UnixNano() - popr := math_rand.New(math_rand.NewSource(seed)) - p := NewPopulatedBox(popr, false) - size := p.Size() - dAtA := make([]byte, size) - for i := range dAtA { - dAtA[i] = byte(popr.Intn(256)) - } - _, err := p.MarshalTo(dAtA) - if err != nil { - t.Fatalf("seed = %d, err = %v", seed, err) - } - msg := &Box{} - if err := github_com_gogo_protobuf_proto.Unmarshal(dAtA, msg); err != nil { - t.Fatalf("seed = %d, err = %v", seed, err) - } - for i := range dAtA { - dAtA[i] = byte(popr.Intn(256)) - } - if !p.Equal(msg) { - t.Fatalf("seed = %d, %#v !Proto %#v", seed, msg, p) - } -} - -func BenchmarkBoxProtoMarshal(b *testing.B) { - popr := math_rand.New(math_rand.NewSource(616)) - total := 0 - pops := make([]*Box, 10000) - for i := 0; i < 10000; i++ { - pops[i] = NewPopulatedBox(popr, false) - } - b.ResetTimer() - for i := 0; i < b.N; i++ { - dAtA, err := github_com_gogo_protobuf_proto.Marshal(pops[i%10000]) - if err != nil { - panic(err) - } - total += len(dAtA) - } - b.SetBytes(int64(total / b.N)) -} - -func BenchmarkBoxProtoUnmarshal(b *testing.B) { - popr := math_rand.New(math_rand.NewSource(616)) - total := 0 - datas := make([][]byte, 10000) - for i := 0; i < 10000; i++ { - dAtA, err := github_com_gogo_protobuf_proto.Marshal(NewPopulatedBox(popr, false)) - if err != nil { - panic(err) - } - datas[i] = dAtA - } - msg := &Box{} - b.ResetTimer() - for i := 0; i < b.N; i++ { - total += len(datas[i%10000]) - if err := github_com_gogo_protobuf_proto.Unmarshal(datas[i%10000], msg); err != nil { - panic(err) - } - } - b.SetBytes(int64(total / b.N)) -} - -func TestUserProto(t *testing.T) { - seed := time.Now().UnixNano() - popr := math_rand.New(math_rand.NewSource(seed)) - p := NewPopulatedUser(popr, false) - dAtA, err := github_com_gogo_protobuf_proto.Marshal(p) - if err != nil { - t.Fatalf("seed = %d, err = %v", seed, err) - } - msg := &User{} - if err := github_com_gogo_protobuf_proto.Unmarshal(dAtA, msg); err != nil { - t.Fatalf("seed = %d, err = %v", seed, err) - } - littlefuzz := make([]byte, len(dAtA)) - copy(littlefuzz, dAtA) - for i := range dAtA { - dAtA[i] = byte(popr.Intn(256)) - } - if !p.Equal(msg) { - t.Fatalf("seed = %d, %#v !Proto %#v", seed, msg, p) - } - if len(littlefuzz) > 0 { - fuzzamount := 100 - for i := 0; i < fuzzamount; i++ { - littlefuzz[popr.Intn(len(littlefuzz))] = byte(popr.Intn(256)) - littlefuzz = append(littlefuzz, byte(popr.Intn(256))) - } - // shouldn't panic - _ = github_com_gogo_protobuf_proto.Unmarshal(littlefuzz, msg) - } -} - -func TestUserMarshalTo(t *testing.T) { - seed := time.Now().UnixNano() - popr := math_rand.New(math_rand.NewSource(seed)) - p := NewPopulatedUser(popr, false) - size := p.Size() - dAtA := make([]byte, size) - for i := range dAtA { - dAtA[i] = byte(popr.Intn(256)) - } - _, err := p.MarshalTo(dAtA) - if err != nil { - t.Fatalf("seed = %d, err = %v", seed, err) - } - msg := &User{} - if err := github_com_gogo_protobuf_proto.Unmarshal(dAtA, msg); err != nil { - t.Fatalf("seed = %d, err = %v", seed, err) - } - for i := range dAtA { - dAtA[i] = byte(popr.Intn(256)) - } - if !p.Equal(msg) { - t.Fatalf("seed = %d, %#v !Proto %#v", seed, msg, p) - } -} - -func BenchmarkUserProtoMarshal(b *testing.B) { - popr := math_rand.New(math_rand.NewSource(616)) - total := 0 - pops := make([]*User, 10000) - for i := 0; i < 10000; i++ { - pops[i] = NewPopulatedUser(popr, false) - } - b.ResetTimer() - for i := 0; i < b.N; i++ { - dAtA, err := github_com_gogo_protobuf_proto.Marshal(pops[i%10000]) - if err != nil { - panic(err) - } - total += len(dAtA) - } - b.SetBytes(int64(total / b.N)) -} - -func BenchmarkUserProtoUnmarshal(b *testing.B) { - popr := math_rand.New(math_rand.NewSource(616)) - total := 0 - datas := make([][]byte, 10000) - for i := 0; i < 10000; i++ { - dAtA, err := github_com_gogo_protobuf_proto.Marshal(NewPopulatedUser(popr, false)) - if err != nil { - panic(err) - } - datas[i] = dAtA - } - msg := &User{} - b.ResetTimer() - for i := 0; i < b.N; i++ { - total += len(datas[i%10000]) - if err := github_com_gogo_protobuf_proto.Unmarshal(datas[i%10000], msg); err != nil { - panic(err) - } - } - b.SetBytes(int64(total / b.N)) -} - -func TestLinuxCapabilitiesProto(t *testing.T) { - seed := time.Now().UnixNano() - popr := math_rand.New(math_rand.NewSource(seed)) - p := NewPopulatedLinuxCapabilities(popr, false) - dAtA, err := github_com_gogo_protobuf_proto.Marshal(p) - if err != nil { - t.Fatalf("seed = %d, err = %v", seed, err) - } - msg := &LinuxCapabilities{} - if err := github_com_gogo_protobuf_proto.Unmarshal(dAtA, msg); err != nil { - t.Fatalf("seed = %d, err = %v", seed, err) - } - littlefuzz := make([]byte, len(dAtA)) - copy(littlefuzz, dAtA) - for i := range dAtA { - dAtA[i] = byte(popr.Intn(256)) - } - if !p.Equal(msg) { - t.Fatalf("seed = %d, %#v !Proto %#v", seed, msg, p) - } - if len(littlefuzz) > 0 { - fuzzamount := 100 - for i := 0; i < fuzzamount; i++ { - littlefuzz[popr.Intn(len(littlefuzz))] = byte(popr.Intn(256)) - littlefuzz = append(littlefuzz, byte(popr.Intn(256))) - } - // shouldn't panic - _ = github_com_gogo_protobuf_proto.Unmarshal(littlefuzz, msg) - } -} - -func TestLinuxCapabilitiesMarshalTo(t *testing.T) { - seed := time.Now().UnixNano() - popr := math_rand.New(math_rand.NewSource(seed)) - p := NewPopulatedLinuxCapabilities(popr, false) - size := p.Size() - dAtA := make([]byte, size) - for i := range dAtA { - dAtA[i] = byte(popr.Intn(256)) - } - _, err := p.MarshalTo(dAtA) - if err != nil { - t.Fatalf("seed = %d, err = %v", seed, err) - } - msg := &LinuxCapabilities{} - if err := github_com_gogo_protobuf_proto.Unmarshal(dAtA, msg); err != nil { - t.Fatalf("seed = %d, err = %v", seed, err) - } - for i := range dAtA { - dAtA[i] = byte(popr.Intn(256)) - } - if !p.Equal(msg) { - t.Fatalf("seed = %d, %#v !Proto %#v", seed, msg, p) - } -} - -func BenchmarkLinuxCapabilitiesProtoMarshal(b *testing.B) { - popr := math_rand.New(math_rand.NewSource(616)) - total := 0 - pops := make([]*LinuxCapabilities, 10000) - for i := 0; i < 10000; i++ { - pops[i] = NewPopulatedLinuxCapabilities(popr, false) - } - b.ResetTimer() - for i := 0; i < b.N; i++ { - dAtA, err := github_com_gogo_protobuf_proto.Marshal(pops[i%10000]) - if err != nil { - panic(err) - } - total += len(dAtA) - } - b.SetBytes(int64(total / b.N)) -} - -func BenchmarkLinuxCapabilitiesProtoUnmarshal(b *testing.B) { - popr := math_rand.New(math_rand.NewSource(616)) - total := 0 - datas := make([][]byte, 10000) - for i := 0; i < 10000; i++ { - dAtA, err := github_com_gogo_protobuf_proto.Marshal(NewPopulatedLinuxCapabilities(popr, false)) - if err != nil { - panic(err) - } - datas[i] = dAtA - } - msg := &LinuxCapabilities{} - b.ResetTimer() - for i := 0; i < b.N; i++ { - total += len(datas[i%10000]) - if err := github_com_gogo_protobuf_proto.Unmarshal(datas[i%10000], msg); err != nil { - panic(err) - } - } - b.SetBytes(int64(total / b.N)) -} - -func TestPOSIXRlimitProto(t *testing.T) { - seed := time.Now().UnixNano() - popr := math_rand.New(math_rand.NewSource(seed)) - p := NewPopulatedPOSIXRlimit(popr, false) - dAtA, err := github_com_gogo_protobuf_proto.Marshal(p) - if err != nil { - t.Fatalf("seed = %d, err = %v", seed, err) - } - msg := &POSIXRlimit{} - if err := github_com_gogo_protobuf_proto.Unmarshal(dAtA, msg); err != nil { - t.Fatalf("seed = %d, err = %v", seed, err) - } - littlefuzz := make([]byte, len(dAtA)) - copy(littlefuzz, dAtA) - for i := range dAtA { - dAtA[i] = byte(popr.Intn(256)) - } - if !p.Equal(msg) { - t.Fatalf("seed = %d, %#v !Proto %#v", seed, msg, p) - } - if len(littlefuzz) > 0 { - fuzzamount := 100 - for i := 0; i < fuzzamount; i++ { - littlefuzz[popr.Intn(len(littlefuzz))] = byte(popr.Intn(256)) - littlefuzz = append(littlefuzz, byte(popr.Intn(256))) - } - // shouldn't panic - _ = github_com_gogo_protobuf_proto.Unmarshal(littlefuzz, msg) - } -} - -func TestPOSIXRlimitMarshalTo(t *testing.T) { - seed := time.Now().UnixNano() - popr := math_rand.New(math_rand.NewSource(seed)) - p := NewPopulatedPOSIXRlimit(popr, false) - size := p.Size() - dAtA := make([]byte, size) - for i := range dAtA { - dAtA[i] = byte(popr.Intn(256)) - } - _, err := p.MarshalTo(dAtA) - if err != nil { - t.Fatalf("seed = %d, err = %v", seed, err) - } - msg := &POSIXRlimit{} - if err := github_com_gogo_protobuf_proto.Unmarshal(dAtA, msg); err != nil { - t.Fatalf("seed = %d, err = %v", seed, err) - } - for i := range dAtA { - dAtA[i] = byte(popr.Intn(256)) - } - if !p.Equal(msg) { - t.Fatalf("seed = %d, %#v !Proto %#v", seed, msg, p) - } -} - -func BenchmarkPOSIXRlimitProtoMarshal(b *testing.B) { - popr := math_rand.New(math_rand.NewSource(616)) - total := 0 - pops := make([]*POSIXRlimit, 10000) - for i := 0; i < 10000; i++ { - pops[i] = NewPopulatedPOSIXRlimit(popr, false) - } - b.ResetTimer() - for i := 0; i < b.N; i++ { - dAtA, err := github_com_gogo_protobuf_proto.Marshal(pops[i%10000]) - if err != nil { - panic(err) - } - total += len(dAtA) - } - b.SetBytes(int64(total / b.N)) -} - -func BenchmarkPOSIXRlimitProtoUnmarshal(b *testing.B) { - popr := math_rand.New(math_rand.NewSource(616)) - total := 0 - datas := make([][]byte, 10000) - for i := 0; i < 10000; i++ { - dAtA, err := github_com_gogo_protobuf_proto.Marshal(NewPopulatedPOSIXRlimit(popr, false)) - if err != nil { - panic(err) - } - datas[i] = dAtA - } - msg := &POSIXRlimit{} - b.ResetTimer() - for i := 0; i < b.N; i++ { - total += len(datas[i%10000]) - if err := github_com_gogo_protobuf_proto.Unmarshal(datas[i%10000], msg); err != nil { - panic(err) - } - } - b.SetBytes(int64(total / b.N)) -} - -func TestMountProto(t *testing.T) { - seed := time.Now().UnixNano() - popr := math_rand.New(math_rand.NewSource(seed)) - p := NewPopulatedMount(popr, false) - dAtA, err := github_com_gogo_protobuf_proto.Marshal(p) - if err != nil { - t.Fatalf("seed = %d, err = %v", seed, err) - } - msg := &Mount{} - if err := github_com_gogo_protobuf_proto.Unmarshal(dAtA, msg); err != nil { - t.Fatalf("seed = %d, err = %v", seed, err) - } - littlefuzz := make([]byte, len(dAtA)) - copy(littlefuzz, dAtA) - for i := range dAtA { - dAtA[i] = byte(popr.Intn(256)) - } - if !p.Equal(msg) { - t.Fatalf("seed = %d, %#v !Proto %#v", seed, msg, p) - } - if len(littlefuzz) > 0 { - fuzzamount := 100 - for i := 0; i < fuzzamount; i++ { - littlefuzz[popr.Intn(len(littlefuzz))] = byte(popr.Intn(256)) - littlefuzz = append(littlefuzz, byte(popr.Intn(256))) - } - // shouldn't panic - _ = github_com_gogo_protobuf_proto.Unmarshal(littlefuzz, msg) - } -} - -func TestMountMarshalTo(t *testing.T) { - seed := time.Now().UnixNano() - popr := math_rand.New(math_rand.NewSource(seed)) - p := NewPopulatedMount(popr, false) - size := p.Size() - dAtA := make([]byte, size) - for i := range dAtA { - dAtA[i] = byte(popr.Intn(256)) - } - _, err := p.MarshalTo(dAtA) - if err != nil { - t.Fatalf("seed = %d, err = %v", seed, err) - } - msg := &Mount{} - if err := github_com_gogo_protobuf_proto.Unmarshal(dAtA, msg); err != nil { - t.Fatalf("seed = %d, err = %v", seed, err) - } - for i := range dAtA { - dAtA[i] = byte(popr.Intn(256)) - } - if !p.Equal(msg) { - t.Fatalf("seed = %d, %#v !Proto %#v", seed, msg, p) - } -} - -func BenchmarkMountProtoMarshal(b *testing.B) { - popr := math_rand.New(math_rand.NewSource(616)) - total := 0 - pops := make([]*Mount, 10000) - for i := 0; i < 10000; i++ { - pops[i] = NewPopulatedMount(popr, false) - } - b.ResetTimer() - for i := 0; i < b.N; i++ { - dAtA, err := github_com_gogo_protobuf_proto.Marshal(pops[i%10000]) - if err != nil { - panic(err) - } - total += len(dAtA) - } - b.SetBytes(int64(total / b.N)) -} - -func BenchmarkMountProtoUnmarshal(b *testing.B) { - popr := math_rand.New(math_rand.NewSource(616)) - total := 0 - datas := make([][]byte, 10000) - for i := 0; i < 10000; i++ { - dAtA, err := github_com_gogo_protobuf_proto.Marshal(NewPopulatedMount(popr, false)) - if err != nil { - panic(err) - } - datas[i] = dAtA - } - msg := &Mount{} - b.ResetTimer() - for i := 0; i < b.N; i++ { - total += len(datas[i%10000]) - if err := github_com_gogo_protobuf_proto.Unmarshal(datas[i%10000], msg); err != nil { - panic(err) - } - } - b.SetBytes(int64(total / b.N)) -} - -func TestRootProto(t *testing.T) { - seed := time.Now().UnixNano() - popr := math_rand.New(math_rand.NewSource(seed)) - p := NewPopulatedRoot(popr, false) - dAtA, err := github_com_gogo_protobuf_proto.Marshal(p) - if err != nil { - t.Fatalf("seed = %d, err = %v", seed, err) - } - msg := &Root{} - if err := github_com_gogo_protobuf_proto.Unmarshal(dAtA, msg); err != nil { - t.Fatalf("seed = %d, err = %v", seed, err) - } - littlefuzz := make([]byte, len(dAtA)) - copy(littlefuzz, dAtA) - for i := range dAtA { - dAtA[i] = byte(popr.Intn(256)) - } - if !p.Equal(msg) { - t.Fatalf("seed = %d, %#v !Proto %#v", seed, msg, p) - } - if len(littlefuzz) > 0 { - fuzzamount := 100 - for i := 0; i < fuzzamount; i++ { - littlefuzz[popr.Intn(len(littlefuzz))] = byte(popr.Intn(256)) - littlefuzz = append(littlefuzz, byte(popr.Intn(256))) - } - // shouldn't panic - _ = github_com_gogo_protobuf_proto.Unmarshal(littlefuzz, msg) - } -} - -func TestRootMarshalTo(t *testing.T) { - seed := time.Now().UnixNano() - popr := math_rand.New(math_rand.NewSource(seed)) - p := NewPopulatedRoot(popr, false) - size := p.Size() - dAtA := make([]byte, size) - for i := range dAtA { - dAtA[i] = byte(popr.Intn(256)) - } - _, err := p.MarshalTo(dAtA) - if err != nil { - t.Fatalf("seed = %d, err = %v", seed, err) - } - msg := &Root{} - if err := github_com_gogo_protobuf_proto.Unmarshal(dAtA, msg); err != nil { - t.Fatalf("seed = %d, err = %v", seed, err) - } - for i := range dAtA { - dAtA[i] = byte(popr.Intn(256)) - } - if !p.Equal(msg) { - t.Fatalf("seed = %d, %#v !Proto %#v", seed, msg, p) - } -} - -func BenchmarkRootProtoMarshal(b *testing.B) { - popr := math_rand.New(math_rand.NewSource(616)) - total := 0 - pops := make([]*Root, 10000) - for i := 0; i < 10000; i++ { - pops[i] = NewPopulatedRoot(popr, false) - } - b.ResetTimer() - for i := 0; i < b.N; i++ { - dAtA, err := github_com_gogo_protobuf_proto.Marshal(pops[i%10000]) - if err != nil { - panic(err) - } - total += len(dAtA) - } - b.SetBytes(int64(total / b.N)) -} - -func BenchmarkRootProtoUnmarshal(b *testing.B) { - popr := math_rand.New(math_rand.NewSource(616)) - total := 0 - datas := make([][]byte, 10000) - for i := 0; i < 10000; i++ { - dAtA, err := github_com_gogo_protobuf_proto.Marshal(NewPopulatedRoot(popr, false)) - if err != nil { - panic(err) - } - datas[i] = dAtA - } - msg := &Root{} - b.ResetTimer() - for i := 0; i < b.N; i++ { - total += len(datas[i%10000]) - if err := github_com_gogo_protobuf_proto.Unmarshal(datas[i%10000], msg); err != nil { - panic(err) - } - } - b.SetBytes(int64(total / b.N)) -} - -func TestHooksProto(t *testing.T) { - seed := time.Now().UnixNano() - popr := math_rand.New(math_rand.NewSource(seed)) - p := NewPopulatedHooks(popr, false) - dAtA, err := github_com_gogo_protobuf_proto.Marshal(p) - if err != nil { - t.Fatalf("seed = %d, err = %v", seed, err) - } - msg := &Hooks{} - if err := github_com_gogo_protobuf_proto.Unmarshal(dAtA, msg); err != nil { - t.Fatalf("seed = %d, err = %v", seed, err) - } - littlefuzz := make([]byte, len(dAtA)) - copy(littlefuzz, dAtA) - for i := range dAtA { - dAtA[i] = byte(popr.Intn(256)) - } - if !p.Equal(msg) { - t.Fatalf("seed = %d, %#v !Proto %#v", seed, msg, p) - } - if len(littlefuzz) > 0 { - fuzzamount := 100 - for i := 0; i < fuzzamount; i++ { - littlefuzz[popr.Intn(len(littlefuzz))] = byte(popr.Intn(256)) - littlefuzz = append(littlefuzz, byte(popr.Intn(256))) - } - // shouldn't panic - _ = github_com_gogo_protobuf_proto.Unmarshal(littlefuzz, msg) - } -} - -func TestHooksMarshalTo(t *testing.T) { - seed := time.Now().UnixNano() - popr := math_rand.New(math_rand.NewSource(seed)) - p := NewPopulatedHooks(popr, false) - size := p.Size() - dAtA := make([]byte, size) - for i := range dAtA { - dAtA[i] = byte(popr.Intn(256)) - } - _, err := p.MarshalTo(dAtA) - if err != nil { - t.Fatalf("seed = %d, err = %v", seed, err) - } - msg := &Hooks{} - if err := github_com_gogo_protobuf_proto.Unmarshal(dAtA, msg); err != nil { - t.Fatalf("seed = %d, err = %v", seed, err) - } - for i := range dAtA { - dAtA[i] = byte(popr.Intn(256)) - } - if !p.Equal(msg) { - t.Fatalf("seed = %d, %#v !Proto %#v", seed, msg, p) - } -} - -func BenchmarkHooksProtoMarshal(b *testing.B) { - popr := math_rand.New(math_rand.NewSource(616)) - total := 0 - pops := make([]*Hooks, 10000) - for i := 0; i < 10000; i++ { - pops[i] = NewPopulatedHooks(popr, false) - } - b.ResetTimer() - for i := 0; i < b.N; i++ { - dAtA, err := github_com_gogo_protobuf_proto.Marshal(pops[i%10000]) - if err != nil { - panic(err) - } - total += len(dAtA) - } - b.SetBytes(int64(total / b.N)) -} - -func BenchmarkHooksProtoUnmarshal(b *testing.B) { - popr := math_rand.New(math_rand.NewSource(616)) - total := 0 - datas := make([][]byte, 10000) - for i := 0; i < 10000; i++ { - dAtA, err := github_com_gogo_protobuf_proto.Marshal(NewPopulatedHooks(popr, false)) - if err != nil { - panic(err) - } - datas[i] = dAtA - } - msg := &Hooks{} - b.ResetTimer() - for i := 0; i < b.N; i++ { - total += len(datas[i%10000]) - if err := github_com_gogo_protobuf_proto.Unmarshal(datas[i%10000], msg); err != nil { - panic(err) - } - } - b.SetBytes(int64(total / b.N)) -} - -func TestHookProto(t *testing.T) { - seed := time.Now().UnixNano() - popr := math_rand.New(math_rand.NewSource(seed)) - p := NewPopulatedHook(popr, false) - dAtA, err := github_com_gogo_protobuf_proto.Marshal(p) - if err != nil { - t.Fatalf("seed = %d, err = %v", seed, err) - } - msg := &Hook{} - if err := github_com_gogo_protobuf_proto.Unmarshal(dAtA, msg); err != nil { - t.Fatalf("seed = %d, err = %v", seed, err) - } - littlefuzz := make([]byte, len(dAtA)) - copy(littlefuzz, dAtA) - for i := range dAtA { - dAtA[i] = byte(popr.Intn(256)) - } - if !p.Equal(msg) { - t.Fatalf("seed = %d, %#v !Proto %#v", seed, msg, p) - } - if len(littlefuzz) > 0 { - fuzzamount := 100 - for i := 0; i < fuzzamount; i++ { - littlefuzz[popr.Intn(len(littlefuzz))] = byte(popr.Intn(256)) - littlefuzz = append(littlefuzz, byte(popr.Intn(256))) - } - // shouldn't panic - _ = github_com_gogo_protobuf_proto.Unmarshal(littlefuzz, msg) - } -} - -func TestHookMarshalTo(t *testing.T) { - seed := time.Now().UnixNano() - popr := math_rand.New(math_rand.NewSource(seed)) - p := NewPopulatedHook(popr, false) - size := p.Size() - dAtA := make([]byte, size) - for i := range dAtA { - dAtA[i] = byte(popr.Intn(256)) - } - _, err := p.MarshalTo(dAtA) - if err != nil { - t.Fatalf("seed = %d, err = %v", seed, err) - } - msg := &Hook{} - if err := github_com_gogo_protobuf_proto.Unmarshal(dAtA, msg); err != nil { - t.Fatalf("seed = %d, err = %v", seed, err) - } - for i := range dAtA { - dAtA[i] = byte(popr.Intn(256)) - } - if !p.Equal(msg) { - t.Fatalf("seed = %d, %#v !Proto %#v", seed, msg, p) - } -} - -func BenchmarkHookProtoMarshal(b *testing.B) { - popr := math_rand.New(math_rand.NewSource(616)) - total := 0 - pops := make([]*Hook, 10000) - for i := 0; i < 10000; i++ { - pops[i] = NewPopulatedHook(popr, false) - } - b.ResetTimer() - for i := 0; i < b.N; i++ { - dAtA, err := github_com_gogo_protobuf_proto.Marshal(pops[i%10000]) - if err != nil { - panic(err) - } - total += len(dAtA) - } - b.SetBytes(int64(total / b.N)) -} - -func BenchmarkHookProtoUnmarshal(b *testing.B) { - popr := math_rand.New(math_rand.NewSource(616)) - total := 0 - datas := make([][]byte, 10000) - for i := 0; i < 10000; i++ { - dAtA, err := github_com_gogo_protobuf_proto.Marshal(NewPopulatedHook(popr, false)) - if err != nil { - panic(err) - } - datas[i] = dAtA - } - msg := &Hook{} - b.ResetTimer() - for i := 0; i < b.N; i++ { - total += len(datas[i%10000]) - if err := github_com_gogo_protobuf_proto.Unmarshal(datas[i%10000], msg); err != nil { - panic(err) - } - } - b.SetBytes(int64(total / b.N)) -} - -func TestLinuxProto(t *testing.T) { - seed := time.Now().UnixNano() - popr := math_rand.New(math_rand.NewSource(seed)) - p := NewPopulatedLinux(popr, false) - dAtA, err := github_com_gogo_protobuf_proto.Marshal(p) - if err != nil { - t.Fatalf("seed = %d, err = %v", seed, err) - } - msg := &Linux{} - if err := github_com_gogo_protobuf_proto.Unmarshal(dAtA, msg); err != nil { - t.Fatalf("seed = %d, err = %v", seed, err) - } - littlefuzz := make([]byte, len(dAtA)) - copy(littlefuzz, dAtA) - for i := range dAtA { - dAtA[i] = byte(popr.Intn(256)) - } - if !p.Equal(msg) { - t.Fatalf("seed = %d, %#v !Proto %#v", seed, msg, p) - } - if len(littlefuzz) > 0 { - fuzzamount := 100 - for i := 0; i < fuzzamount; i++ { - littlefuzz[popr.Intn(len(littlefuzz))] = byte(popr.Intn(256)) - littlefuzz = append(littlefuzz, byte(popr.Intn(256))) - } - // shouldn't panic - _ = github_com_gogo_protobuf_proto.Unmarshal(littlefuzz, msg) - } -} - -func TestLinuxMarshalTo(t *testing.T) { - seed := time.Now().UnixNano() - popr := math_rand.New(math_rand.NewSource(seed)) - p := NewPopulatedLinux(popr, false) - size := p.Size() - dAtA := make([]byte, size) - for i := range dAtA { - dAtA[i] = byte(popr.Intn(256)) - } - _, err := p.MarshalTo(dAtA) - if err != nil { - t.Fatalf("seed = %d, err = %v", seed, err) - } - msg := &Linux{} - if err := github_com_gogo_protobuf_proto.Unmarshal(dAtA, msg); err != nil { - t.Fatalf("seed = %d, err = %v", seed, err) - } - for i := range dAtA { - dAtA[i] = byte(popr.Intn(256)) - } - if !p.Equal(msg) { - t.Fatalf("seed = %d, %#v !Proto %#v", seed, msg, p) - } -} - -func BenchmarkLinuxProtoMarshal(b *testing.B) { - popr := math_rand.New(math_rand.NewSource(616)) - total := 0 - pops := make([]*Linux, 10000) - for i := 0; i < 10000; i++ { - pops[i] = NewPopulatedLinux(popr, false) - } - b.ResetTimer() - for i := 0; i < b.N; i++ { - dAtA, err := github_com_gogo_protobuf_proto.Marshal(pops[i%10000]) - if err != nil { - panic(err) - } - total += len(dAtA) - } - b.SetBytes(int64(total / b.N)) -} - -func BenchmarkLinuxProtoUnmarshal(b *testing.B) { - popr := math_rand.New(math_rand.NewSource(616)) - total := 0 - datas := make([][]byte, 10000) - for i := 0; i < 10000; i++ { - dAtA, err := github_com_gogo_protobuf_proto.Marshal(NewPopulatedLinux(popr, false)) - if err != nil { - panic(err) - } - datas[i] = dAtA - } - msg := &Linux{} - b.ResetTimer() - for i := 0; i < b.N; i++ { - total += len(datas[i%10000]) - if err := github_com_gogo_protobuf_proto.Unmarshal(datas[i%10000], msg); err != nil { - panic(err) - } - } - b.SetBytes(int64(total / b.N)) -} - -func TestWindowsProto(t *testing.T) { - seed := time.Now().UnixNano() - popr := math_rand.New(math_rand.NewSource(seed)) - p := NewPopulatedWindows(popr, false) - dAtA, err := github_com_gogo_protobuf_proto.Marshal(p) - if err != nil { - t.Fatalf("seed = %d, err = %v", seed, err) - } - msg := &Windows{} - if err := github_com_gogo_protobuf_proto.Unmarshal(dAtA, msg); err != nil { - t.Fatalf("seed = %d, err = %v", seed, err) - } - littlefuzz := make([]byte, len(dAtA)) - copy(littlefuzz, dAtA) - for i := range dAtA { - dAtA[i] = byte(popr.Intn(256)) - } - if !p.Equal(msg) { - t.Fatalf("seed = %d, %#v !Proto %#v", seed, msg, p) - } - if len(littlefuzz) > 0 { - fuzzamount := 100 - for i := 0; i < fuzzamount; i++ { - littlefuzz[popr.Intn(len(littlefuzz))] = byte(popr.Intn(256)) - littlefuzz = append(littlefuzz, byte(popr.Intn(256))) - } - // shouldn't panic - _ = github_com_gogo_protobuf_proto.Unmarshal(littlefuzz, msg) - } -} - -func TestWindowsMarshalTo(t *testing.T) { - seed := time.Now().UnixNano() - popr := math_rand.New(math_rand.NewSource(seed)) - p := NewPopulatedWindows(popr, false) - size := p.Size() - dAtA := make([]byte, size) - for i := range dAtA { - dAtA[i] = byte(popr.Intn(256)) - } - _, err := p.MarshalTo(dAtA) - if err != nil { - t.Fatalf("seed = %d, err = %v", seed, err) - } - msg := &Windows{} - if err := github_com_gogo_protobuf_proto.Unmarshal(dAtA, msg); err != nil { - t.Fatalf("seed = %d, err = %v", seed, err) - } - for i := range dAtA { - dAtA[i] = byte(popr.Intn(256)) - } - if !p.Equal(msg) { - t.Fatalf("seed = %d, %#v !Proto %#v", seed, msg, p) - } -} - -func BenchmarkWindowsProtoMarshal(b *testing.B) { - popr := math_rand.New(math_rand.NewSource(616)) - total := 0 - pops := make([]*Windows, 10000) - for i := 0; i < 10000; i++ { - pops[i] = NewPopulatedWindows(popr, false) - } - b.ResetTimer() - for i := 0; i < b.N; i++ { - dAtA, err := github_com_gogo_protobuf_proto.Marshal(pops[i%10000]) - if err != nil { - panic(err) - } - total += len(dAtA) - } - b.SetBytes(int64(total / b.N)) -} - -func BenchmarkWindowsProtoUnmarshal(b *testing.B) { - popr := math_rand.New(math_rand.NewSource(616)) - total := 0 - datas := make([][]byte, 10000) - for i := 0; i < 10000; i++ { - dAtA, err := github_com_gogo_protobuf_proto.Marshal(NewPopulatedWindows(popr, false)) - if err != nil { - panic(err) - } - datas[i] = dAtA - } - msg := &Windows{} - b.ResetTimer() - for i := 0; i < b.N; i++ { - total += len(datas[i%10000]) - if err := github_com_gogo_protobuf_proto.Unmarshal(datas[i%10000], msg); err != nil { - panic(err) - } - } - b.SetBytes(int64(total / b.N)) -} - -func TestSolarisProto(t *testing.T) { - seed := time.Now().UnixNano() - popr := math_rand.New(math_rand.NewSource(seed)) - p := NewPopulatedSolaris(popr, false) - dAtA, err := github_com_gogo_protobuf_proto.Marshal(p) - if err != nil { - t.Fatalf("seed = %d, err = %v", seed, err) - } - msg := &Solaris{} - if err := github_com_gogo_protobuf_proto.Unmarshal(dAtA, msg); err != nil { - t.Fatalf("seed = %d, err = %v", seed, err) - } - littlefuzz := make([]byte, len(dAtA)) - copy(littlefuzz, dAtA) - for i := range dAtA { - dAtA[i] = byte(popr.Intn(256)) - } - if !p.Equal(msg) { - t.Fatalf("seed = %d, %#v !Proto %#v", seed, msg, p) - } - if len(littlefuzz) > 0 { - fuzzamount := 100 - for i := 0; i < fuzzamount; i++ { - littlefuzz[popr.Intn(len(littlefuzz))] = byte(popr.Intn(256)) - littlefuzz = append(littlefuzz, byte(popr.Intn(256))) - } - // shouldn't panic - _ = github_com_gogo_protobuf_proto.Unmarshal(littlefuzz, msg) - } -} - -func TestSolarisMarshalTo(t *testing.T) { - seed := time.Now().UnixNano() - popr := math_rand.New(math_rand.NewSource(seed)) - p := NewPopulatedSolaris(popr, false) - size := p.Size() - dAtA := make([]byte, size) - for i := range dAtA { - dAtA[i] = byte(popr.Intn(256)) - } - _, err := p.MarshalTo(dAtA) - if err != nil { - t.Fatalf("seed = %d, err = %v", seed, err) - } - msg := &Solaris{} - if err := github_com_gogo_protobuf_proto.Unmarshal(dAtA, msg); err != nil { - t.Fatalf("seed = %d, err = %v", seed, err) - } - for i := range dAtA { - dAtA[i] = byte(popr.Intn(256)) - } - if !p.Equal(msg) { - t.Fatalf("seed = %d, %#v !Proto %#v", seed, msg, p) - } -} - -func BenchmarkSolarisProtoMarshal(b *testing.B) { - popr := math_rand.New(math_rand.NewSource(616)) - total := 0 - pops := make([]*Solaris, 10000) - for i := 0; i < 10000; i++ { - pops[i] = NewPopulatedSolaris(popr, false) - } - b.ResetTimer() - for i := 0; i < b.N; i++ { - dAtA, err := github_com_gogo_protobuf_proto.Marshal(pops[i%10000]) - if err != nil { - panic(err) - } - total += len(dAtA) - } - b.SetBytes(int64(total / b.N)) -} - -func BenchmarkSolarisProtoUnmarshal(b *testing.B) { - popr := math_rand.New(math_rand.NewSource(616)) - total := 0 - datas := make([][]byte, 10000) - for i := 0; i < 10000; i++ { - dAtA, err := github_com_gogo_protobuf_proto.Marshal(NewPopulatedSolaris(popr, false)) - if err != nil { - panic(err) - } - datas[i] = dAtA - } - msg := &Solaris{} - b.ResetTimer() - for i := 0; i < b.N; i++ { - total += len(datas[i%10000]) - if err := github_com_gogo_protobuf_proto.Unmarshal(datas[i%10000], msg); err != nil { - panic(err) - } - } - b.SetBytes(int64(total / b.N)) -} - -func TestLinuxIDMappingProto(t *testing.T) { - seed := time.Now().UnixNano() - popr := math_rand.New(math_rand.NewSource(seed)) - p := NewPopulatedLinuxIDMapping(popr, false) - dAtA, err := github_com_gogo_protobuf_proto.Marshal(p) - if err != nil { - t.Fatalf("seed = %d, err = %v", seed, err) - } - msg := &LinuxIDMapping{} - if err := github_com_gogo_protobuf_proto.Unmarshal(dAtA, msg); err != nil { - t.Fatalf("seed = %d, err = %v", seed, err) - } - littlefuzz := make([]byte, len(dAtA)) - copy(littlefuzz, dAtA) - for i := range dAtA { - dAtA[i] = byte(popr.Intn(256)) - } - if !p.Equal(msg) { - t.Fatalf("seed = %d, %#v !Proto %#v", seed, msg, p) - } - if len(littlefuzz) > 0 { - fuzzamount := 100 - for i := 0; i < fuzzamount; i++ { - littlefuzz[popr.Intn(len(littlefuzz))] = byte(popr.Intn(256)) - littlefuzz = append(littlefuzz, byte(popr.Intn(256))) - } - // shouldn't panic - _ = github_com_gogo_protobuf_proto.Unmarshal(littlefuzz, msg) - } -} - -func TestLinuxIDMappingMarshalTo(t *testing.T) { - seed := time.Now().UnixNano() - popr := math_rand.New(math_rand.NewSource(seed)) - p := NewPopulatedLinuxIDMapping(popr, false) - size := p.Size() - dAtA := make([]byte, size) - for i := range dAtA { - dAtA[i] = byte(popr.Intn(256)) - } - _, err := p.MarshalTo(dAtA) - if err != nil { - t.Fatalf("seed = %d, err = %v", seed, err) - } - msg := &LinuxIDMapping{} - if err := github_com_gogo_protobuf_proto.Unmarshal(dAtA, msg); err != nil { - t.Fatalf("seed = %d, err = %v", seed, err) - } - for i := range dAtA { - dAtA[i] = byte(popr.Intn(256)) - } - if !p.Equal(msg) { - t.Fatalf("seed = %d, %#v !Proto %#v", seed, msg, p) - } -} - -func BenchmarkLinuxIDMappingProtoMarshal(b *testing.B) { - popr := math_rand.New(math_rand.NewSource(616)) - total := 0 - pops := make([]*LinuxIDMapping, 10000) - for i := 0; i < 10000; i++ { - pops[i] = NewPopulatedLinuxIDMapping(popr, false) - } - b.ResetTimer() - for i := 0; i < b.N; i++ { - dAtA, err := github_com_gogo_protobuf_proto.Marshal(pops[i%10000]) - if err != nil { - panic(err) - } - total += len(dAtA) - } - b.SetBytes(int64(total / b.N)) -} - -func BenchmarkLinuxIDMappingProtoUnmarshal(b *testing.B) { - popr := math_rand.New(math_rand.NewSource(616)) - total := 0 - datas := make([][]byte, 10000) - for i := 0; i < 10000; i++ { - dAtA, err := github_com_gogo_protobuf_proto.Marshal(NewPopulatedLinuxIDMapping(popr, false)) - if err != nil { - panic(err) - } - datas[i] = dAtA - } - msg := &LinuxIDMapping{} - b.ResetTimer() - for i := 0; i < b.N; i++ { - total += len(datas[i%10000]) - if err := github_com_gogo_protobuf_proto.Unmarshal(datas[i%10000], msg); err != nil { - panic(err) - } - } - b.SetBytes(int64(total / b.N)) -} - -func TestLinuxNamespaceProto(t *testing.T) { - seed := time.Now().UnixNano() - popr := math_rand.New(math_rand.NewSource(seed)) - p := NewPopulatedLinuxNamespace(popr, false) - dAtA, err := github_com_gogo_protobuf_proto.Marshal(p) - if err != nil { - t.Fatalf("seed = %d, err = %v", seed, err) - } - msg := &LinuxNamespace{} - if err := github_com_gogo_protobuf_proto.Unmarshal(dAtA, msg); err != nil { - t.Fatalf("seed = %d, err = %v", seed, err) - } - littlefuzz := make([]byte, len(dAtA)) - copy(littlefuzz, dAtA) - for i := range dAtA { - dAtA[i] = byte(popr.Intn(256)) - } - if !p.Equal(msg) { - t.Fatalf("seed = %d, %#v !Proto %#v", seed, msg, p) - } - if len(littlefuzz) > 0 { - fuzzamount := 100 - for i := 0; i < fuzzamount; i++ { - littlefuzz[popr.Intn(len(littlefuzz))] = byte(popr.Intn(256)) - littlefuzz = append(littlefuzz, byte(popr.Intn(256))) - } - // shouldn't panic - _ = github_com_gogo_protobuf_proto.Unmarshal(littlefuzz, msg) - } -} - -func TestLinuxNamespaceMarshalTo(t *testing.T) { - seed := time.Now().UnixNano() - popr := math_rand.New(math_rand.NewSource(seed)) - p := NewPopulatedLinuxNamespace(popr, false) - size := p.Size() - dAtA := make([]byte, size) - for i := range dAtA { - dAtA[i] = byte(popr.Intn(256)) - } - _, err := p.MarshalTo(dAtA) - if err != nil { - t.Fatalf("seed = %d, err = %v", seed, err) - } - msg := &LinuxNamespace{} - if err := github_com_gogo_protobuf_proto.Unmarshal(dAtA, msg); err != nil { - t.Fatalf("seed = %d, err = %v", seed, err) - } - for i := range dAtA { - dAtA[i] = byte(popr.Intn(256)) - } - if !p.Equal(msg) { - t.Fatalf("seed = %d, %#v !Proto %#v", seed, msg, p) - } -} - -func BenchmarkLinuxNamespaceProtoMarshal(b *testing.B) { - popr := math_rand.New(math_rand.NewSource(616)) - total := 0 - pops := make([]*LinuxNamespace, 10000) - for i := 0; i < 10000; i++ { - pops[i] = NewPopulatedLinuxNamespace(popr, false) - } - b.ResetTimer() - for i := 0; i < b.N; i++ { - dAtA, err := github_com_gogo_protobuf_proto.Marshal(pops[i%10000]) - if err != nil { - panic(err) - } - total += len(dAtA) - } - b.SetBytes(int64(total / b.N)) -} - -func BenchmarkLinuxNamespaceProtoUnmarshal(b *testing.B) { - popr := math_rand.New(math_rand.NewSource(616)) - total := 0 - datas := make([][]byte, 10000) - for i := 0; i < 10000; i++ { - dAtA, err := github_com_gogo_protobuf_proto.Marshal(NewPopulatedLinuxNamespace(popr, false)) - if err != nil { - panic(err) - } - datas[i] = dAtA - } - msg := &LinuxNamespace{} - b.ResetTimer() - for i := 0; i < b.N; i++ { - total += len(datas[i%10000]) - if err := github_com_gogo_protobuf_proto.Unmarshal(datas[i%10000], msg); err != nil { - panic(err) - } - } - b.SetBytes(int64(total / b.N)) -} - -func TestLinuxDeviceProto(t *testing.T) { - seed := time.Now().UnixNano() - popr := math_rand.New(math_rand.NewSource(seed)) - p := NewPopulatedLinuxDevice(popr, false) - dAtA, err := github_com_gogo_protobuf_proto.Marshal(p) - if err != nil { - t.Fatalf("seed = %d, err = %v", seed, err) - } - msg := &LinuxDevice{} - if err := github_com_gogo_protobuf_proto.Unmarshal(dAtA, msg); err != nil { - t.Fatalf("seed = %d, err = %v", seed, err) - } - littlefuzz := make([]byte, len(dAtA)) - copy(littlefuzz, dAtA) - for i := range dAtA { - dAtA[i] = byte(popr.Intn(256)) - } - if !p.Equal(msg) { - t.Fatalf("seed = %d, %#v !Proto %#v", seed, msg, p) - } - if len(littlefuzz) > 0 { - fuzzamount := 100 - for i := 0; i < fuzzamount; i++ { - littlefuzz[popr.Intn(len(littlefuzz))] = byte(popr.Intn(256)) - littlefuzz = append(littlefuzz, byte(popr.Intn(256))) - } - // shouldn't panic - _ = github_com_gogo_protobuf_proto.Unmarshal(littlefuzz, msg) - } -} - -func TestLinuxDeviceMarshalTo(t *testing.T) { - seed := time.Now().UnixNano() - popr := math_rand.New(math_rand.NewSource(seed)) - p := NewPopulatedLinuxDevice(popr, false) - size := p.Size() - dAtA := make([]byte, size) - for i := range dAtA { - dAtA[i] = byte(popr.Intn(256)) - } - _, err := p.MarshalTo(dAtA) - if err != nil { - t.Fatalf("seed = %d, err = %v", seed, err) - } - msg := &LinuxDevice{} - if err := github_com_gogo_protobuf_proto.Unmarshal(dAtA, msg); err != nil { - t.Fatalf("seed = %d, err = %v", seed, err) - } - for i := range dAtA { - dAtA[i] = byte(popr.Intn(256)) - } - if !p.Equal(msg) { - t.Fatalf("seed = %d, %#v !Proto %#v", seed, msg, p) - } -} - -func BenchmarkLinuxDeviceProtoMarshal(b *testing.B) { - popr := math_rand.New(math_rand.NewSource(616)) - total := 0 - pops := make([]*LinuxDevice, 10000) - for i := 0; i < 10000; i++ { - pops[i] = NewPopulatedLinuxDevice(popr, false) - } - b.ResetTimer() - for i := 0; i < b.N; i++ { - dAtA, err := github_com_gogo_protobuf_proto.Marshal(pops[i%10000]) - if err != nil { - panic(err) - } - total += len(dAtA) - } - b.SetBytes(int64(total / b.N)) -} - -func BenchmarkLinuxDeviceProtoUnmarshal(b *testing.B) { - popr := math_rand.New(math_rand.NewSource(616)) - total := 0 - datas := make([][]byte, 10000) - for i := 0; i < 10000; i++ { - dAtA, err := github_com_gogo_protobuf_proto.Marshal(NewPopulatedLinuxDevice(popr, false)) - if err != nil { - panic(err) - } - datas[i] = dAtA - } - msg := &LinuxDevice{} - b.ResetTimer() - for i := 0; i < b.N; i++ { - total += len(datas[i%10000]) - if err := github_com_gogo_protobuf_proto.Unmarshal(datas[i%10000], msg); err != nil { - panic(err) - } - } - b.SetBytes(int64(total / b.N)) -} - -func TestLinuxResourcesProto(t *testing.T) { - seed := time.Now().UnixNano() - popr := math_rand.New(math_rand.NewSource(seed)) - p := NewPopulatedLinuxResources(popr, false) - dAtA, err := github_com_gogo_protobuf_proto.Marshal(p) - if err != nil { - t.Fatalf("seed = %d, err = %v", seed, err) - } - msg := &LinuxResources{} - if err := github_com_gogo_protobuf_proto.Unmarshal(dAtA, msg); err != nil { - t.Fatalf("seed = %d, err = %v", seed, err) - } - littlefuzz := make([]byte, len(dAtA)) - copy(littlefuzz, dAtA) - for i := range dAtA { - dAtA[i] = byte(popr.Intn(256)) - } - if !p.Equal(msg) { - t.Fatalf("seed = %d, %#v !Proto %#v", seed, msg, p) - } - if len(littlefuzz) > 0 { - fuzzamount := 100 - for i := 0; i < fuzzamount; i++ { - littlefuzz[popr.Intn(len(littlefuzz))] = byte(popr.Intn(256)) - littlefuzz = append(littlefuzz, byte(popr.Intn(256))) - } - // shouldn't panic - _ = github_com_gogo_protobuf_proto.Unmarshal(littlefuzz, msg) - } -} - -func TestLinuxResourcesMarshalTo(t *testing.T) { - seed := time.Now().UnixNano() - popr := math_rand.New(math_rand.NewSource(seed)) - p := NewPopulatedLinuxResources(popr, false) - size := p.Size() - dAtA := make([]byte, size) - for i := range dAtA { - dAtA[i] = byte(popr.Intn(256)) - } - _, err := p.MarshalTo(dAtA) - if err != nil { - t.Fatalf("seed = %d, err = %v", seed, err) - } - msg := &LinuxResources{} - if err := github_com_gogo_protobuf_proto.Unmarshal(dAtA, msg); err != nil { - t.Fatalf("seed = %d, err = %v", seed, err) - } - for i := range dAtA { - dAtA[i] = byte(popr.Intn(256)) - } - if !p.Equal(msg) { - t.Fatalf("seed = %d, %#v !Proto %#v", seed, msg, p) - } -} - -func BenchmarkLinuxResourcesProtoMarshal(b *testing.B) { - popr := math_rand.New(math_rand.NewSource(616)) - total := 0 - pops := make([]*LinuxResources, 10000) - for i := 0; i < 10000; i++ { - pops[i] = NewPopulatedLinuxResources(popr, false) - } - b.ResetTimer() - for i := 0; i < b.N; i++ { - dAtA, err := github_com_gogo_protobuf_proto.Marshal(pops[i%10000]) - if err != nil { - panic(err) - } - total += len(dAtA) - } - b.SetBytes(int64(total / b.N)) -} - -func BenchmarkLinuxResourcesProtoUnmarshal(b *testing.B) { - popr := math_rand.New(math_rand.NewSource(616)) - total := 0 - datas := make([][]byte, 10000) - for i := 0; i < 10000; i++ { - dAtA, err := github_com_gogo_protobuf_proto.Marshal(NewPopulatedLinuxResources(popr, false)) - if err != nil { - panic(err) - } - datas[i] = dAtA - } - msg := &LinuxResources{} - b.ResetTimer() - for i := 0; i < b.N; i++ { - total += len(datas[i%10000]) - if err := github_com_gogo_protobuf_proto.Unmarshal(datas[i%10000], msg); err != nil { - panic(err) - } - } - b.SetBytes(int64(total / b.N)) -} - -func TestLinuxMemoryProto(t *testing.T) { - seed := time.Now().UnixNano() - popr := math_rand.New(math_rand.NewSource(seed)) - p := NewPopulatedLinuxMemory(popr, false) - dAtA, err := github_com_gogo_protobuf_proto.Marshal(p) - if err != nil { - t.Fatalf("seed = %d, err = %v", seed, err) - } - msg := &LinuxMemory{} - if err := github_com_gogo_protobuf_proto.Unmarshal(dAtA, msg); err != nil { - t.Fatalf("seed = %d, err = %v", seed, err) - } - littlefuzz := make([]byte, len(dAtA)) - copy(littlefuzz, dAtA) - for i := range dAtA { - dAtA[i] = byte(popr.Intn(256)) - } - if !p.Equal(msg) { - t.Fatalf("seed = %d, %#v !Proto %#v", seed, msg, p) - } - if len(littlefuzz) > 0 { - fuzzamount := 100 - for i := 0; i < fuzzamount; i++ { - littlefuzz[popr.Intn(len(littlefuzz))] = byte(popr.Intn(256)) - littlefuzz = append(littlefuzz, byte(popr.Intn(256))) - } - // shouldn't panic - _ = github_com_gogo_protobuf_proto.Unmarshal(littlefuzz, msg) - } -} - -func TestLinuxMemoryMarshalTo(t *testing.T) { - seed := time.Now().UnixNano() - popr := math_rand.New(math_rand.NewSource(seed)) - p := NewPopulatedLinuxMemory(popr, false) - size := p.Size() - dAtA := make([]byte, size) - for i := range dAtA { - dAtA[i] = byte(popr.Intn(256)) - } - _, err := p.MarshalTo(dAtA) - if err != nil { - t.Fatalf("seed = %d, err = %v", seed, err) - } - msg := &LinuxMemory{} - if err := github_com_gogo_protobuf_proto.Unmarshal(dAtA, msg); err != nil { - t.Fatalf("seed = %d, err = %v", seed, err) - } - for i := range dAtA { - dAtA[i] = byte(popr.Intn(256)) - } - if !p.Equal(msg) { - t.Fatalf("seed = %d, %#v !Proto %#v", seed, msg, p) - } -} - -func BenchmarkLinuxMemoryProtoMarshal(b *testing.B) { - popr := math_rand.New(math_rand.NewSource(616)) - total := 0 - pops := make([]*LinuxMemory, 10000) - for i := 0; i < 10000; i++ { - pops[i] = NewPopulatedLinuxMemory(popr, false) - } - b.ResetTimer() - for i := 0; i < b.N; i++ { - dAtA, err := github_com_gogo_protobuf_proto.Marshal(pops[i%10000]) - if err != nil { - panic(err) - } - total += len(dAtA) - } - b.SetBytes(int64(total / b.N)) -} - -func BenchmarkLinuxMemoryProtoUnmarshal(b *testing.B) { - popr := math_rand.New(math_rand.NewSource(616)) - total := 0 - datas := make([][]byte, 10000) - for i := 0; i < 10000; i++ { - dAtA, err := github_com_gogo_protobuf_proto.Marshal(NewPopulatedLinuxMemory(popr, false)) - if err != nil { - panic(err) - } - datas[i] = dAtA - } - msg := &LinuxMemory{} - b.ResetTimer() - for i := 0; i < b.N; i++ { - total += len(datas[i%10000]) - if err := github_com_gogo_protobuf_proto.Unmarshal(datas[i%10000], msg); err != nil { - panic(err) - } - } - b.SetBytes(int64(total / b.N)) -} - -func TestLinuxCPUProto(t *testing.T) { - seed := time.Now().UnixNano() - popr := math_rand.New(math_rand.NewSource(seed)) - p := NewPopulatedLinuxCPU(popr, false) - dAtA, err := github_com_gogo_protobuf_proto.Marshal(p) - if err != nil { - t.Fatalf("seed = %d, err = %v", seed, err) - } - msg := &LinuxCPU{} - if err := github_com_gogo_protobuf_proto.Unmarshal(dAtA, msg); err != nil { - t.Fatalf("seed = %d, err = %v", seed, err) - } - littlefuzz := make([]byte, len(dAtA)) - copy(littlefuzz, dAtA) - for i := range dAtA { - dAtA[i] = byte(popr.Intn(256)) - } - if !p.Equal(msg) { - t.Fatalf("seed = %d, %#v !Proto %#v", seed, msg, p) - } - if len(littlefuzz) > 0 { - fuzzamount := 100 - for i := 0; i < fuzzamount; i++ { - littlefuzz[popr.Intn(len(littlefuzz))] = byte(popr.Intn(256)) - littlefuzz = append(littlefuzz, byte(popr.Intn(256))) - } - // shouldn't panic - _ = github_com_gogo_protobuf_proto.Unmarshal(littlefuzz, msg) - } -} - -func TestLinuxCPUMarshalTo(t *testing.T) { - seed := time.Now().UnixNano() - popr := math_rand.New(math_rand.NewSource(seed)) - p := NewPopulatedLinuxCPU(popr, false) - size := p.Size() - dAtA := make([]byte, size) - for i := range dAtA { - dAtA[i] = byte(popr.Intn(256)) - } - _, err := p.MarshalTo(dAtA) - if err != nil { - t.Fatalf("seed = %d, err = %v", seed, err) - } - msg := &LinuxCPU{} - if err := github_com_gogo_protobuf_proto.Unmarshal(dAtA, msg); err != nil { - t.Fatalf("seed = %d, err = %v", seed, err) - } - for i := range dAtA { - dAtA[i] = byte(popr.Intn(256)) - } - if !p.Equal(msg) { - t.Fatalf("seed = %d, %#v !Proto %#v", seed, msg, p) - } -} - -func BenchmarkLinuxCPUProtoMarshal(b *testing.B) { - popr := math_rand.New(math_rand.NewSource(616)) - total := 0 - pops := make([]*LinuxCPU, 10000) - for i := 0; i < 10000; i++ { - pops[i] = NewPopulatedLinuxCPU(popr, false) - } - b.ResetTimer() - for i := 0; i < b.N; i++ { - dAtA, err := github_com_gogo_protobuf_proto.Marshal(pops[i%10000]) - if err != nil { - panic(err) - } - total += len(dAtA) - } - b.SetBytes(int64(total / b.N)) -} - -func BenchmarkLinuxCPUProtoUnmarshal(b *testing.B) { - popr := math_rand.New(math_rand.NewSource(616)) - total := 0 - datas := make([][]byte, 10000) - for i := 0; i < 10000; i++ { - dAtA, err := github_com_gogo_protobuf_proto.Marshal(NewPopulatedLinuxCPU(popr, false)) - if err != nil { - panic(err) - } - datas[i] = dAtA - } - msg := &LinuxCPU{} - b.ResetTimer() - for i := 0; i < b.N; i++ { - total += len(datas[i%10000]) - if err := github_com_gogo_protobuf_proto.Unmarshal(datas[i%10000], msg); err != nil { - panic(err) - } - } - b.SetBytes(int64(total / b.N)) -} - -func TestLinuxWeightDeviceProto(t *testing.T) { - seed := time.Now().UnixNano() - popr := math_rand.New(math_rand.NewSource(seed)) - p := NewPopulatedLinuxWeightDevice(popr, false) - dAtA, err := github_com_gogo_protobuf_proto.Marshal(p) - if err != nil { - t.Fatalf("seed = %d, err = %v", seed, err) - } - msg := &LinuxWeightDevice{} - if err := github_com_gogo_protobuf_proto.Unmarshal(dAtA, msg); err != nil { - t.Fatalf("seed = %d, err = %v", seed, err) - } - littlefuzz := make([]byte, len(dAtA)) - copy(littlefuzz, dAtA) - for i := range dAtA { - dAtA[i] = byte(popr.Intn(256)) - } - if !p.Equal(msg) { - t.Fatalf("seed = %d, %#v !Proto %#v", seed, msg, p) - } - if len(littlefuzz) > 0 { - fuzzamount := 100 - for i := 0; i < fuzzamount; i++ { - littlefuzz[popr.Intn(len(littlefuzz))] = byte(popr.Intn(256)) - littlefuzz = append(littlefuzz, byte(popr.Intn(256))) - } - // shouldn't panic - _ = github_com_gogo_protobuf_proto.Unmarshal(littlefuzz, msg) - } -} - -func TestLinuxWeightDeviceMarshalTo(t *testing.T) { - seed := time.Now().UnixNano() - popr := math_rand.New(math_rand.NewSource(seed)) - p := NewPopulatedLinuxWeightDevice(popr, false) - size := p.Size() - dAtA := make([]byte, size) - for i := range dAtA { - dAtA[i] = byte(popr.Intn(256)) - } - _, err := p.MarshalTo(dAtA) - if err != nil { - t.Fatalf("seed = %d, err = %v", seed, err) - } - msg := &LinuxWeightDevice{} - if err := github_com_gogo_protobuf_proto.Unmarshal(dAtA, msg); err != nil { - t.Fatalf("seed = %d, err = %v", seed, err) - } - for i := range dAtA { - dAtA[i] = byte(popr.Intn(256)) - } - if !p.Equal(msg) { - t.Fatalf("seed = %d, %#v !Proto %#v", seed, msg, p) - } -} - -func BenchmarkLinuxWeightDeviceProtoMarshal(b *testing.B) { - popr := math_rand.New(math_rand.NewSource(616)) - total := 0 - pops := make([]*LinuxWeightDevice, 10000) - for i := 0; i < 10000; i++ { - pops[i] = NewPopulatedLinuxWeightDevice(popr, false) - } - b.ResetTimer() - for i := 0; i < b.N; i++ { - dAtA, err := github_com_gogo_protobuf_proto.Marshal(pops[i%10000]) - if err != nil { - panic(err) - } - total += len(dAtA) - } - b.SetBytes(int64(total / b.N)) -} - -func BenchmarkLinuxWeightDeviceProtoUnmarshal(b *testing.B) { - popr := math_rand.New(math_rand.NewSource(616)) - total := 0 - datas := make([][]byte, 10000) - for i := 0; i < 10000; i++ { - dAtA, err := github_com_gogo_protobuf_proto.Marshal(NewPopulatedLinuxWeightDevice(popr, false)) - if err != nil { - panic(err) - } - datas[i] = dAtA - } - msg := &LinuxWeightDevice{} - b.ResetTimer() - for i := 0; i < b.N; i++ { - total += len(datas[i%10000]) - if err := github_com_gogo_protobuf_proto.Unmarshal(datas[i%10000], msg); err != nil { - panic(err) - } - } - b.SetBytes(int64(total / b.N)) -} - -func TestLinuxThrottleDeviceProto(t *testing.T) { - seed := time.Now().UnixNano() - popr := math_rand.New(math_rand.NewSource(seed)) - p := NewPopulatedLinuxThrottleDevice(popr, false) - dAtA, err := github_com_gogo_protobuf_proto.Marshal(p) - if err != nil { - t.Fatalf("seed = %d, err = %v", seed, err) - } - msg := &LinuxThrottleDevice{} - if err := github_com_gogo_protobuf_proto.Unmarshal(dAtA, msg); err != nil { - t.Fatalf("seed = %d, err = %v", seed, err) - } - littlefuzz := make([]byte, len(dAtA)) - copy(littlefuzz, dAtA) - for i := range dAtA { - dAtA[i] = byte(popr.Intn(256)) - } - if !p.Equal(msg) { - t.Fatalf("seed = %d, %#v !Proto %#v", seed, msg, p) - } - if len(littlefuzz) > 0 { - fuzzamount := 100 - for i := 0; i < fuzzamount; i++ { - littlefuzz[popr.Intn(len(littlefuzz))] = byte(popr.Intn(256)) - littlefuzz = append(littlefuzz, byte(popr.Intn(256))) - } - // shouldn't panic - _ = github_com_gogo_protobuf_proto.Unmarshal(littlefuzz, msg) - } -} - -func TestLinuxThrottleDeviceMarshalTo(t *testing.T) { - seed := time.Now().UnixNano() - popr := math_rand.New(math_rand.NewSource(seed)) - p := NewPopulatedLinuxThrottleDevice(popr, false) - size := p.Size() - dAtA := make([]byte, size) - for i := range dAtA { - dAtA[i] = byte(popr.Intn(256)) - } - _, err := p.MarshalTo(dAtA) - if err != nil { - t.Fatalf("seed = %d, err = %v", seed, err) - } - msg := &LinuxThrottleDevice{} - if err := github_com_gogo_protobuf_proto.Unmarshal(dAtA, msg); err != nil { - t.Fatalf("seed = %d, err = %v", seed, err) - } - for i := range dAtA { - dAtA[i] = byte(popr.Intn(256)) - } - if !p.Equal(msg) { - t.Fatalf("seed = %d, %#v !Proto %#v", seed, msg, p) - } -} - -func BenchmarkLinuxThrottleDeviceProtoMarshal(b *testing.B) { - popr := math_rand.New(math_rand.NewSource(616)) - total := 0 - pops := make([]*LinuxThrottleDevice, 10000) - for i := 0; i < 10000; i++ { - pops[i] = NewPopulatedLinuxThrottleDevice(popr, false) - } - b.ResetTimer() - for i := 0; i < b.N; i++ { - dAtA, err := github_com_gogo_protobuf_proto.Marshal(pops[i%10000]) - if err != nil { - panic(err) - } - total += len(dAtA) - } - b.SetBytes(int64(total / b.N)) -} - -func BenchmarkLinuxThrottleDeviceProtoUnmarshal(b *testing.B) { - popr := math_rand.New(math_rand.NewSource(616)) - total := 0 - datas := make([][]byte, 10000) - for i := 0; i < 10000; i++ { - dAtA, err := github_com_gogo_protobuf_proto.Marshal(NewPopulatedLinuxThrottleDevice(popr, false)) - if err != nil { - panic(err) - } - datas[i] = dAtA - } - msg := &LinuxThrottleDevice{} - b.ResetTimer() - for i := 0; i < b.N; i++ { - total += len(datas[i%10000]) - if err := github_com_gogo_protobuf_proto.Unmarshal(datas[i%10000], msg); err != nil { - panic(err) - } - } - b.SetBytes(int64(total / b.N)) -} - -func TestLinuxBlockIOProto(t *testing.T) { - seed := time.Now().UnixNano() - popr := math_rand.New(math_rand.NewSource(seed)) - p := NewPopulatedLinuxBlockIO(popr, false) - dAtA, err := github_com_gogo_protobuf_proto.Marshal(p) - if err != nil { - t.Fatalf("seed = %d, err = %v", seed, err) - } - msg := &LinuxBlockIO{} - if err := github_com_gogo_protobuf_proto.Unmarshal(dAtA, msg); err != nil { - t.Fatalf("seed = %d, err = %v", seed, err) - } - littlefuzz := make([]byte, len(dAtA)) - copy(littlefuzz, dAtA) - for i := range dAtA { - dAtA[i] = byte(popr.Intn(256)) - } - if !p.Equal(msg) { - t.Fatalf("seed = %d, %#v !Proto %#v", seed, msg, p) - } - if len(littlefuzz) > 0 { - fuzzamount := 100 - for i := 0; i < fuzzamount; i++ { - littlefuzz[popr.Intn(len(littlefuzz))] = byte(popr.Intn(256)) - littlefuzz = append(littlefuzz, byte(popr.Intn(256))) - } - // shouldn't panic - _ = github_com_gogo_protobuf_proto.Unmarshal(littlefuzz, msg) - } -} - -func TestLinuxBlockIOMarshalTo(t *testing.T) { - seed := time.Now().UnixNano() - popr := math_rand.New(math_rand.NewSource(seed)) - p := NewPopulatedLinuxBlockIO(popr, false) - size := p.Size() - dAtA := make([]byte, size) - for i := range dAtA { - dAtA[i] = byte(popr.Intn(256)) - } - _, err := p.MarshalTo(dAtA) - if err != nil { - t.Fatalf("seed = %d, err = %v", seed, err) - } - msg := &LinuxBlockIO{} - if err := github_com_gogo_protobuf_proto.Unmarshal(dAtA, msg); err != nil { - t.Fatalf("seed = %d, err = %v", seed, err) - } - for i := range dAtA { - dAtA[i] = byte(popr.Intn(256)) - } - if !p.Equal(msg) { - t.Fatalf("seed = %d, %#v !Proto %#v", seed, msg, p) - } -} - -func BenchmarkLinuxBlockIOProtoMarshal(b *testing.B) { - popr := math_rand.New(math_rand.NewSource(616)) - total := 0 - pops := make([]*LinuxBlockIO, 10000) - for i := 0; i < 10000; i++ { - pops[i] = NewPopulatedLinuxBlockIO(popr, false) - } - b.ResetTimer() - for i := 0; i < b.N; i++ { - dAtA, err := github_com_gogo_protobuf_proto.Marshal(pops[i%10000]) - if err != nil { - panic(err) - } - total += len(dAtA) - } - b.SetBytes(int64(total / b.N)) -} - -func BenchmarkLinuxBlockIOProtoUnmarshal(b *testing.B) { - popr := math_rand.New(math_rand.NewSource(616)) - total := 0 - datas := make([][]byte, 10000) - for i := 0; i < 10000; i++ { - dAtA, err := github_com_gogo_protobuf_proto.Marshal(NewPopulatedLinuxBlockIO(popr, false)) - if err != nil { - panic(err) - } - datas[i] = dAtA - } - msg := &LinuxBlockIO{} - b.ResetTimer() - for i := 0; i < b.N; i++ { - total += len(datas[i%10000]) - if err := github_com_gogo_protobuf_proto.Unmarshal(datas[i%10000], msg); err != nil { - panic(err) - } - } - b.SetBytes(int64(total / b.N)) -} - -func TestLinuxPidsProto(t *testing.T) { - seed := time.Now().UnixNano() - popr := math_rand.New(math_rand.NewSource(seed)) - p := NewPopulatedLinuxPids(popr, false) - dAtA, err := github_com_gogo_protobuf_proto.Marshal(p) - if err != nil { - t.Fatalf("seed = %d, err = %v", seed, err) - } - msg := &LinuxPids{} - if err := github_com_gogo_protobuf_proto.Unmarshal(dAtA, msg); err != nil { - t.Fatalf("seed = %d, err = %v", seed, err) - } - littlefuzz := make([]byte, len(dAtA)) - copy(littlefuzz, dAtA) - for i := range dAtA { - dAtA[i] = byte(popr.Intn(256)) - } - if !p.Equal(msg) { - t.Fatalf("seed = %d, %#v !Proto %#v", seed, msg, p) - } - if len(littlefuzz) > 0 { - fuzzamount := 100 - for i := 0; i < fuzzamount; i++ { - littlefuzz[popr.Intn(len(littlefuzz))] = byte(popr.Intn(256)) - littlefuzz = append(littlefuzz, byte(popr.Intn(256))) - } - // shouldn't panic - _ = github_com_gogo_protobuf_proto.Unmarshal(littlefuzz, msg) - } -} - -func TestLinuxPidsMarshalTo(t *testing.T) { - seed := time.Now().UnixNano() - popr := math_rand.New(math_rand.NewSource(seed)) - p := NewPopulatedLinuxPids(popr, false) - size := p.Size() - dAtA := make([]byte, size) - for i := range dAtA { - dAtA[i] = byte(popr.Intn(256)) - } - _, err := p.MarshalTo(dAtA) - if err != nil { - t.Fatalf("seed = %d, err = %v", seed, err) - } - msg := &LinuxPids{} - if err := github_com_gogo_protobuf_proto.Unmarshal(dAtA, msg); err != nil { - t.Fatalf("seed = %d, err = %v", seed, err) - } - for i := range dAtA { - dAtA[i] = byte(popr.Intn(256)) - } - if !p.Equal(msg) { - t.Fatalf("seed = %d, %#v !Proto %#v", seed, msg, p) - } -} - -func BenchmarkLinuxPidsProtoMarshal(b *testing.B) { - popr := math_rand.New(math_rand.NewSource(616)) - total := 0 - pops := make([]*LinuxPids, 10000) - for i := 0; i < 10000; i++ { - pops[i] = NewPopulatedLinuxPids(popr, false) - } - b.ResetTimer() - for i := 0; i < b.N; i++ { - dAtA, err := github_com_gogo_protobuf_proto.Marshal(pops[i%10000]) - if err != nil { - panic(err) - } - total += len(dAtA) - } - b.SetBytes(int64(total / b.N)) -} - -func BenchmarkLinuxPidsProtoUnmarshal(b *testing.B) { - popr := math_rand.New(math_rand.NewSource(616)) - total := 0 - datas := make([][]byte, 10000) - for i := 0; i < 10000; i++ { - dAtA, err := github_com_gogo_protobuf_proto.Marshal(NewPopulatedLinuxPids(popr, false)) - if err != nil { - panic(err) - } - datas[i] = dAtA - } - msg := &LinuxPids{} - b.ResetTimer() - for i := 0; i < b.N; i++ { - total += len(datas[i%10000]) - if err := github_com_gogo_protobuf_proto.Unmarshal(datas[i%10000], msg); err != nil { - panic(err) - } - } - b.SetBytes(int64(total / b.N)) -} - -func TestLinuxDeviceCgroupProto(t *testing.T) { - seed := time.Now().UnixNano() - popr := math_rand.New(math_rand.NewSource(seed)) - p := NewPopulatedLinuxDeviceCgroup(popr, false) - dAtA, err := github_com_gogo_protobuf_proto.Marshal(p) - if err != nil { - t.Fatalf("seed = %d, err = %v", seed, err) - } - msg := &LinuxDeviceCgroup{} - if err := github_com_gogo_protobuf_proto.Unmarshal(dAtA, msg); err != nil { - t.Fatalf("seed = %d, err = %v", seed, err) - } - littlefuzz := make([]byte, len(dAtA)) - copy(littlefuzz, dAtA) - for i := range dAtA { - dAtA[i] = byte(popr.Intn(256)) - } - if !p.Equal(msg) { - t.Fatalf("seed = %d, %#v !Proto %#v", seed, msg, p) - } - if len(littlefuzz) > 0 { - fuzzamount := 100 - for i := 0; i < fuzzamount; i++ { - littlefuzz[popr.Intn(len(littlefuzz))] = byte(popr.Intn(256)) - littlefuzz = append(littlefuzz, byte(popr.Intn(256))) - } - // shouldn't panic - _ = github_com_gogo_protobuf_proto.Unmarshal(littlefuzz, msg) - } -} - -func TestLinuxDeviceCgroupMarshalTo(t *testing.T) { - seed := time.Now().UnixNano() - popr := math_rand.New(math_rand.NewSource(seed)) - p := NewPopulatedLinuxDeviceCgroup(popr, false) - size := p.Size() - dAtA := make([]byte, size) - for i := range dAtA { - dAtA[i] = byte(popr.Intn(256)) - } - _, err := p.MarshalTo(dAtA) - if err != nil { - t.Fatalf("seed = %d, err = %v", seed, err) - } - msg := &LinuxDeviceCgroup{} - if err := github_com_gogo_protobuf_proto.Unmarshal(dAtA, msg); err != nil { - t.Fatalf("seed = %d, err = %v", seed, err) - } - for i := range dAtA { - dAtA[i] = byte(popr.Intn(256)) - } - if !p.Equal(msg) { - t.Fatalf("seed = %d, %#v !Proto %#v", seed, msg, p) - } -} - -func BenchmarkLinuxDeviceCgroupProtoMarshal(b *testing.B) { - popr := math_rand.New(math_rand.NewSource(616)) - total := 0 - pops := make([]*LinuxDeviceCgroup, 10000) - for i := 0; i < 10000; i++ { - pops[i] = NewPopulatedLinuxDeviceCgroup(popr, false) - } - b.ResetTimer() - for i := 0; i < b.N; i++ { - dAtA, err := github_com_gogo_protobuf_proto.Marshal(pops[i%10000]) - if err != nil { - panic(err) - } - total += len(dAtA) - } - b.SetBytes(int64(total / b.N)) -} - -func BenchmarkLinuxDeviceCgroupProtoUnmarshal(b *testing.B) { - popr := math_rand.New(math_rand.NewSource(616)) - total := 0 - datas := make([][]byte, 10000) - for i := 0; i < 10000; i++ { - dAtA, err := github_com_gogo_protobuf_proto.Marshal(NewPopulatedLinuxDeviceCgroup(popr, false)) - if err != nil { - panic(err) - } - datas[i] = dAtA - } - msg := &LinuxDeviceCgroup{} - b.ResetTimer() - for i := 0; i < b.N; i++ { - total += len(datas[i%10000]) - if err := github_com_gogo_protobuf_proto.Unmarshal(datas[i%10000], msg); err != nil { - panic(err) - } - } - b.SetBytes(int64(total / b.N)) -} - -func TestLinuxNetworkProto(t *testing.T) { - seed := time.Now().UnixNano() - popr := math_rand.New(math_rand.NewSource(seed)) - p := NewPopulatedLinuxNetwork(popr, false) - dAtA, err := github_com_gogo_protobuf_proto.Marshal(p) - if err != nil { - t.Fatalf("seed = %d, err = %v", seed, err) - } - msg := &LinuxNetwork{} - if err := github_com_gogo_protobuf_proto.Unmarshal(dAtA, msg); err != nil { - t.Fatalf("seed = %d, err = %v", seed, err) - } - littlefuzz := make([]byte, len(dAtA)) - copy(littlefuzz, dAtA) - for i := range dAtA { - dAtA[i] = byte(popr.Intn(256)) - } - if !p.Equal(msg) { - t.Fatalf("seed = %d, %#v !Proto %#v", seed, msg, p) - } - if len(littlefuzz) > 0 { - fuzzamount := 100 - for i := 0; i < fuzzamount; i++ { - littlefuzz[popr.Intn(len(littlefuzz))] = byte(popr.Intn(256)) - littlefuzz = append(littlefuzz, byte(popr.Intn(256))) - } - // shouldn't panic - _ = github_com_gogo_protobuf_proto.Unmarshal(littlefuzz, msg) - } -} - -func TestLinuxNetworkMarshalTo(t *testing.T) { - seed := time.Now().UnixNano() - popr := math_rand.New(math_rand.NewSource(seed)) - p := NewPopulatedLinuxNetwork(popr, false) - size := p.Size() - dAtA := make([]byte, size) - for i := range dAtA { - dAtA[i] = byte(popr.Intn(256)) - } - _, err := p.MarshalTo(dAtA) - if err != nil { - t.Fatalf("seed = %d, err = %v", seed, err) - } - msg := &LinuxNetwork{} - if err := github_com_gogo_protobuf_proto.Unmarshal(dAtA, msg); err != nil { - t.Fatalf("seed = %d, err = %v", seed, err) - } - for i := range dAtA { - dAtA[i] = byte(popr.Intn(256)) - } - if !p.Equal(msg) { - t.Fatalf("seed = %d, %#v !Proto %#v", seed, msg, p) - } -} - -func BenchmarkLinuxNetworkProtoMarshal(b *testing.B) { - popr := math_rand.New(math_rand.NewSource(616)) - total := 0 - pops := make([]*LinuxNetwork, 10000) - for i := 0; i < 10000; i++ { - pops[i] = NewPopulatedLinuxNetwork(popr, false) - } - b.ResetTimer() - for i := 0; i < b.N; i++ { - dAtA, err := github_com_gogo_protobuf_proto.Marshal(pops[i%10000]) - if err != nil { - panic(err) - } - total += len(dAtA) - } - b.SetBytes(int64(total / b.N)) -} - -func BenchmarkLinuxNetworkProtoUnmarshal(b *testing.B) { - popr := math_rand.New(math_rand.NewSource(616)) - total := 0 - datas := make([][]byte, 10000) - for i := 0; i < 10000; i++ { - dAtA, err := github_com_gogo_protobuf_proto.Marshal(NewPopulatedLinuxNetwork(popr, false)) - if err != nil { - panic(err) - } - datas[i] = dAtA - } - msg := &LinuxNetwork{} - b.ResetTimer() - for i := 0; i < b.N; i++ { - total += len(datas[i%10000]) - if err := github_com_gogo_protobuf_proto.Unmarshal(datas[i%10000], msg); err != nil { - panic(err) - } - } - b.SetBytes(int64(total / b.N)) -} - -func TestLinuxHugepageLimitProto(t *testing.T) { - seed := time.Now().UnixNano() - popr := math_rand.New(math_rand.NewSource(seed)) - p := NewPopulatedLinuxHugepageLimit(popr, false) - dAtA, err := github_com_gogo_protobuf_proto.Marshal(p) - if err != nil { - t.Fatalf("seed = %d, err = %v", seed, err) - } - msg := &LinuxHugepageLimit{} - if err := github_com_gogo_protobuf_proto.Unmarshal(dAtA, msg); err != nil { - t.Fatalf("seed = %d, err = %v", seed, err) - } - littlefuzz := make([]byte, len(dAtA)) - copy(littlefuzz, dAtA) - for i := range dAtA { - dAtA[i] = byte(popr.Intn(256)) - } - if !p.Equal(msg) { - t.Fatalf("seed = %d, %#v !Proto %#v", seed, msg, p) - } - if len(littlefuzz) > 0 { - fuzzamount := 100 - for i := 0; i < fuzzamount; i++ { - littlefuzz[popr.Intn(len(littlefuzz))] = byte(popr.Intn(256)) - littlefuzz = append(littlefuzz, byte(popr.Intn(256))) - } - // shouldn't panic - _ = github_com_gogo_protobuf_proto.Unmarshal(littlefuzz, msg) - } -} - -func TestLinuxHugepageLimitMarshalTo(t *testing.T) { - seed := time.Now().UnixNano() - popr := math_rand.New(math_rand.NewSource(seed)) - p := NewPopulatedLinuxHugepageLimit(popr, false) - size := p.Size() - dAtA := make([]byte, size) - for i := range dAtA { - dAtA[i] = byte(popr.Intn(256)) - } - _, err := p.MarshalTo(dAtA) - if err != nil { - t.Fatalf("seed = %d, err = %v", seed, err) - } - msg := &LinuxHugepageLimit{} - if err := github_com_gogo_protobuf_proto.Unmarshal(dAtA, msg); err != nil { - t.Fatalf("seed = %d, err = %v", seed, err) - } - for i := range dAtA { - dAtA[i] = byte(popr.Intn(256)) - } - if !p.Equal(msg) { - t.Fatalf("seed = %d, %#v !Proto %#v", seed, msg, p) - } -} - -func BenchmarkLinuxHugepageLimitProtoMarshal(b *testing.B) { - popr := math_rand.New(math_rand.NewSource(616)) - total := 0 - pops := make([]*LinuxHugepageLimit, 10000) - for i := 0; i < 10000; i++ { - pops[i] = NewPopulatedLinuxHugepageLimit(popr, false) - } - b.ResetTimer() - for i := 0; i < b.N; i++ { - dAtA, err := github_com_gogo_protobuf_proto.Marshal(pops[i%10000]) - if err != nil { - panic(err) - } - total += len(dAtA) - } - b.SetBytes(int64(total / b.N)) -} - -func BenchmarkLinuxHugepageLimitProtoUnmarshal(b *testing.B) { - popr := math_rand.New(math_rand.NewSource(616)) - total := 0 - datas := make([][]byte, 10000) - for i := 0; i < 10000; i++ { - dAtA, err := github_com_gogo_protobuf_proto.Marshal(NewPopulatedLinuxHugepageLimit(popr, false)) - if err != nil { - panic(err) - } - datas[i] = dAtA - } - msg := &LinuxHugepageLimit{} - b.ResetTimer() - for i := 0; i < b.N; i++ { - total += len(datas[i%10000]) - if err := github_com_gogo_protobuf_proto.Unmarshal(datas[i%10000], msg); err != nil { - panic(err) - } - } - b.SetBytes(int64(total / b.N)) -} - -func TestLinuxInterfacePriorityProto(t *testing.T) { - seed := time.Now().UnixNano() - popr := math_rand.New(math_rand.NewSource(seed)) - p := NewPopulatedLinuxInterfacePriority(popr, false) - dAtA, err := github_com_gogo_protobuf_proto.Marshal(p) - if err != nil { - t.Fatalf("seed = %d, err = %v", seed, err) - } - msg := &LinuxInterfacePriority{} - if err := github_com_gogo_protobuf_proto.Unmarshal(dAtA, msg); err != nil { - t.Fatalf("seed = %d, err = %v", seed, err) - } - littlefuzz := make([]byte, len(dAtA)) - copy(littlefuzz, dAtA) - for i := range dAtA { - dAtA[i] = byte(popr.Intn(256)) - } - if !p.Equal(msg) { - t.Fatalf("seed = %d, %#v !Proto %#v", seed, msg, p) - } - if len(littlefuzz) > 0 { - fuzzamount := 100 - for i := 0; i < fuzzamount; i++ { - littlefuzz[popr.Intn(len(littlefuzz))] = byte(popr.Intn(256)) - littlefuzz = append(littlefuzz, byte(popr.Intn(256))) - } - // shouldn't panic - _ = github_com_gogo_protobuf_proto.Unmarshal(littlefuzz, msg) - } -} - -func TestLinuxInterfacePriorityMarshalTo(t *testing.T) { - seed := time.Now().UnixNano() - popr := math_rand.New(math_rand.NewSource(seed)) - p := NewPopulatedLinuxInterfacePriority(popr, false) - size := p.Size() - dAtA := make([]byte, size) - for i := range dAtA { - dAtA[i] = byte(popr.Intn(256)) - } - _, err := p.MarshalTo(dAtA) - if err != nil { - t.Fatalf("seed = %d, err = %v", seed, err) - } - msg := &LinuxInterfacePriority{} - if err := github_com_gogo_protobuf_proto.Unmarshal(dAtA, msg); err != nil { - t.Fatalf("seed = %d, err = %v", seed, err) - } - for i := range dAtA { - dAtA[i] = byte(popr.Intn(256)) - } - if !p.Equal(msg) { - t.Fatalf("seed = %d, %#v !Proto %#v", seed, msg, p) - } -} - -func BenchmarkLinuxInterfacePriorityProtoMarshal(b *testing.B) { - popr := math_rand.New(math_rand.NewSource(616)) - total := 0 - pops := make([]*LinuxInterfacePriority, 10000) - for i := 0; i < 10000; i++ { - pops[i] = NewPopulatedLinuxInterfacePriority(popr, false) - } - b.ResetTimer() - for i := 0; i < b.N; i++ { - dAtA, err := github_com_gogo_protobuf_proto.Marshal(pops[i%10000]) - if err != nil { - panic(err) - } - total += len(dAtA) - } - b.SetBytes(int64(total / b.N)) -} - -func BenchmarkLinuxInterfacePriorityProtoUnmarshal(b *testing.B) { - popr := math_rand.New(math_rand.NewSource(616)) - total := 0 - datas := make([][]byte, 10000) - for i := 0; i < 10000; i++ { - dAtA, err := github_com_gogo_protobuf_proto.Marshal(NewPopulatedLinuxInterfacePriority(popr, false)) - if err != nil { - panic(err) - } - datas[i] = dAtA - } - msg := &LinuxInterfacePriority{} - b.ResetTimer() - for i := 0; i < b.N; i++ { - total += len(datas[i%10000]) - if err := github_com_gogo_protobuf_proto.Unmarshal(datas[i%10000], msg); err != nil { - panic(err) - } - } - b.SetBytes(int64(total / b.N)) -} - -func TestLinuxSeccompProto(t *testing.T) { - seed := time.Now().UnixNano() - popr := math_rand.New(math_rand.NewSource(seed)) - p := NewPopulatedLinuxSeccomp(popr, false) - dAtA, err := github_com_gogo_protobuf_proto.Marshal(p) - if err != nil { - t.Fatalf("seed = %d, err = %v", seed, err) - } - msg := &LinuxSeccomp{} - if err := github_com_gogo_protobuf_proto.Unmarshal(dAtA, msg); err != nil { - t.Fatalf("seed = %d, err = %v", seed, err) - } - littlefuzz := make([]byte, len(dAtA)) - copy(littlefuzz, dAtA) - for i := range dAtA { - dAtA[i] = byte(popr.Intn(256)) - } - if !p.Equal(msg) { - t.Fatalf("seed = %d, %#v !Proto %#v", seed, msg, p) - } - if len(littlefuzz) > 0 { - fuzzamount := 100 - for i := 0; i < fuzzamount; i++ { - littlefuzz[popr.Intn(len(littlefuzz))] = byte(popr.Intn(256)) - littlefuzz = append(littlefuzz, byte(popr.Intn(256))) - } - // shouldn't panic - _ = github_com_gogo_protobuf_proto.Unmarshal(littlefuzz, msg) - } -} - -func TestLinuxSeccompMarshalTo(t *testing.T) { - seed := time.Now().UnixNano() - popr := math_rand.New(math_rand.NewSource(seed)) - p := NewPopulatedLinuxSeccomp(popr, false) - size := p.Size() - dAtA := make([]byte, size) - for i := range dAtA { - dAtA[i] = byte(popr.Intn(256)) - } - _, err := p.MarshalTo(dAtA) - if err != nil { - t.Fatalf("seed = %d, err = %v", seed, err) - } - msg := &LinuxSeccomp{} - if err := github_com_gogo_protobuf_proto.Unmarshal(dAtA, msg); err != nil { - t.Fatalf("seed = %d, err = %v", seed, err) - } - for i := range dAtA { - dAtA[i] = byte(popr.Intn(256)) - } - if !p.Equal(msg) { - t.Fatalf("seed = %d, %#v !Proto %#v", seed, msg, p) - } -} - -func BenchmarkLinuxSeccompProtoMarshal(b *testing.B) { - popr := math_rand.New(math_rand.NewSource(616)) - total := 0 - pops := make([]*LinuxSeccomp, 10000) - for i := 0; i < 10000; i++ { - pops[i] = NewPopulatedLinuxSeccomp(popr, false) - } - b.ResetTimer() - for i := 0; i < b.N; i++ { - dAtA, err := github_com_gogo_protobuf_proto.Marshal(pops[i%10000]) - if err != nil { - panic(err) - } - total += len(dAtA) - } - b.SetBytes(int64(total / b.N)) -} - -func BenchmarkLinuxSeccompProtoUnmarshal(b *testing.B) { - popr := math_rand.New(math_rand.NewSource(616)) - total := 0 - datas := make([][]byte, 10000) - for i := 0; i < 10000; i++ { - dAtA, err := github_com_gogo_protobuf_proto.Marshal(NewPopulatedLinuxSeccomp(popr, false)) - if err != nil { - panic(err) - } - datas[i] = dAtA - } - msg := &LinuxSeccomp{} - b.ResetTimer() - for i := 0; i < b.N; i++ { - total += len(datas[i%10000]) - if err := github_com_gogo_protobuf_proto.Unmarshal(datas[i%10000], msg); err != nil { - panic(err) - } - } - b.SetBytes(int64(total / b.N)) -} - -func TestLinuxSeccompArgProto(t *testing.T) { - seed := time.Now().UnixNano() - popr := math_rand.New(math_rand.NewSource(seed)) - p := NewPopulatedLinuxSeccompArg(popr, false) - dAtA, err := github_com_gogo_protobuf_proto.Marshal(p) - if err != nil { - t.Fatalf("seed = %d, err = %v", seed, err) - } - msg := &LinuxSeccompArg{} - if err := github_com_gogo_protobuf_proto.Unmarshal(dAtA, msg); err != nil { - t.Fatalf("seed = %d, err = %v", seed, err) - } - littlefuzz := make([]byte, len(dAtA)) - copy(littlefuzz, dAtA) - for i := range dAtA { - dAtA[i] = byte(popr.Intn(256)) - } - if !p.Equal(msg) { - t.Fatalf("seed = %d, %#v !Proto %#v", seed, msg, p) - } - if len(littlefuzz) > 0 { - fuzzamount := 100 - for i := 0; i < fuzzamount; i++ { - littlefuzz[popr.Intn(len(littlefuzz))] = byte(popr.Intn(256)) - littlefuzz = append(littlefuzz, byte(popr.Intn(256))) - } - // shouldn't panic - _ = github_com_gogo_protobuf_proto.Unmarshal(littlefuzz, msg) - } -} - -func TestLinuxSeccompArgMarshalTo(t *testing.T) { - seed := time.Now().UnixNano() - popr := math_rand.New(math_rand.NewSource(seed)) - p := NewPopulatedLinuxSeccompArg(popr, false) - size := p.Size() - dAtA := make([]byte, size) - for i := range dAtA { - dAtA[i] = byte(popr.Intn(256)) - } - _, err := p.MarshalTo(dAtA) - if err != nil { - t.Fatalf("seed = %d, err = %v", seed, err) - } - msg := &LinuxSeccompArg{} - if err := github_com_gogo_protobuf_proto.Unmarshal(dAtA, msg); err != nil { - t.Fatalf("seed = %d, err = %v", seed, err) - } - for i := range dAtA { - dAtA[i] = byte(popr.Intn(256)) - } - if !p.Equal(msg) { - t.Fatalf("seed = %d, %#v !Proto %#v", seed, msg, p) - } -} - -func BenchmarkLinuxSeccompArgProtoMarshal(b *testing.B) { - popr := math_rand.New(math_rand.NewSource(616)) - total := 0 - pops := make([]*LinuxSeccompArg, 10000) - for i := 0; i < 10000; i++ { - pops[i] = NewPopulatedLinuxSeccompArg(popr, false) - } - b.ResetTimer() - for i := 0; i < b.N; i++ { - dAtA, err := github_com_gogo_protobuf_proto.Marshal(pops[i%10000]) - if err != nil { - panic(err) - } - total += len(dAtA) - } - b.SetBytes(int64(total / b.N)) -} - -func BenchmarkLinuxSeccompArgProtoUnmarshal(b *testing.B) { - popr := math_rand.New(math_rand.NewSource(616)) - total := 0 - datas := make([][]byte, 10000) - for i := 0; i < 10000; i++ { - dAtA, err := github_com_gogo_protobuf_proto.Marshal(NewPopulatedLinuxSeccompArg(popr, false)) - if err != nil { - panic(err) - } - datas[i] = dAtA - } - msg := &LinuxSeccompArg{} - b.ResetTimer() - for i := 0; i < b.N; i++ { - total += len(datas[i%10000]) - if err := github_com_gogo_protobuf_proto.Unmarshal(datas[i%10000], msg); err != nil { - panic(err) - } - } - b.SetBytes(int64(total / b.N)) -} - -func TestLinuxSyscallProto(t *testing.T) { - seed := time.Now().UnixNano() - popr := math_rand.New(math_rand.NewSource(seed)) - p := NewPopulatedLinuxSyscall(popr, false) - dAtA, err := github_com_gogo_protobuf_proto.Marshal(p) - if err != nil { - t.Fatalf("seed = %d, err = %v", seed, err) - } - msg := &LinuxSyscall{} - if err := github_com_gogo_protobuf_proto.Unmarshal(dAtA, msg); err != nil { - t.Fatalf("seed = %d, err = %v", seed, err) - } - littlefuzz := make([]byte, len(dAtA)) - copy(littlefuzz, dAtA) - for i := range dAtA { - dAtA[i] = byte(popr.Intn(256)) - } - if !p.Equal(msg) { - t.Fatalf("seed = %d, %#v !Proto %#v", seed, msg, p) - } - if len(littlefuzz) > 0 { - fuzzamount := 100 - for i := 0; i < fuzzamount; i++ { - littlefuzz[popr.Intn(len(littlefuzz))] = byte(popr.Intn(256)) - littlefuzz = append(littlefuzz, byte(popr.Intn(256))) - } - // shouldn't panic - _ = github_com_gogo_protobuf_proto.Unmarshal(littlefuzz, msg) - } -} - -func TestLinuxSyscallMarshalTo(t *testing.T) { - seed := time.Now().UnixNano() - popr := math_rand.New(math_rand.NewSource(seed)) - p := NewPopulatedLinuxSyscall(popr, false) - size := p.Size() - dAtA := make([]byte, size) - for i := range dAtA { - dAtA[i] = byte(popr.Intn(256)) - } - _, err := p.MarshalTo(dAtA) - if err != nil { - t.Fatalf("seed = %d, err = %v", seed, err) - } - msg := &LinuxSyscall{} - if err := github_com_gogo_protobuf_proto.Unmarshal(dAtA, msg); err != nil { - t.Fatalf("seed = %d, err = %v", seed, err) - } - for i := range dAtA { - dAtA[i] = byte(popr.Intn(256)) - } - if !p.Equal(msg) { - t.Fatalf("seed = %d, %#v !Proto %#v", seed, msg, p) - } -} - -func BenchmarkLinuxSyscallProtoMarshal(b *testing.B) { - popr := math_rand.New(math_rand.NewSource(616)) - total := 0 - pops := make([]*LinuxSyscall, 10000) - for i := 0; i < 10000; i++ { - pops[i] = NewPopulatedLinuxSyscall(popr, false) - } - b.ResetTimer() - for i := 0; i < b.N; i++ { - dAtA, err := github_com_gogo_protobuf_proto.Marshal(pops[i%10000]) - if err != nil { - panic(err) - } - total += len(dAtA) - } - b.SetBytes(int64(total / b.N)) -} - -func BenchmarkLinuxSyscallProtoUnmarshal(b *testing.B) { - popr := math_rand.New(math_rand.NewSource(616)) - total := 0 - datas := make([][]byte, 10000) - for i := 0; i < 10000; i++ { - dAtA, err := github_com_gogo_protobuf_proto.Marshal(NewPopulatedLinuxSyscall(popr, false)) - if err != nil { - panic(err) - } - datas[i] = dAtA - } - msg := &LinuxSyscall{} - b.ResetTimer() - for i := 0; i < b.N; i++ { - total += len(datas[i%10000]) - if err := github_com_gogo_protobuf_proto.Unmarshal(datas[i%10000], msg); err != nil { - panic(err) - } - } - b.SetBytes(int64(total / b.N)) -} - -func TestLinuxIntelRdtProto(t *testing.T) { - seed := time.Now().UnixNano() - popr := math_rand.New(math_rand.NewSource(seed)) - p := NewPopulatedLinuxIntelRdt(popr, false) - dAtA, err := github_com_gogo_protobuf_proto.Marshal(p) - if err != nil { - t.Fatalf("seed = %d, err = %v", seed, err) - } - msg := &LinuxIntelRdt{} - if err := github_com_gogo_protobuf_proto.Unmarshal(dAtA, msg); err != nil { - t.Fatalf("seed = %d, err = %v", seed, err) - } - littlefuzz := make([]byte, len(dAtA)) - copy(littlefuzz, dAtA) - for i := range dAtA { - dAtA[i] = byte(popr.Intn(256)) - } - if !p.Equal(msg) { - t.Fatalf("seed = %d, %#v !Proto %#v", seed, msg, p) - } - if len(littlefuzz) > 0 { - fuzzamount := 100 - for i := 0; i < fuzzamount; i++ { - littlefuzz[popr.Intn(len(littlefuzz))] = byte(popr.Intn(256)) - littlefuzz = append(littlefuzz, byte(popr.Intn(256))) - } - // shouldn't panic - _ = github_com_gogo_protobuf_proto.Unmarshal(littlefuzz, msg) - } -} - -func TestLinuxIntelRdtMarshalTo(t *testing.T) { - seed := time.Now().UnixNano() - popr := math_rand.New(math_rand.NewSource(seed)) - p := NewPopulatedLinuxIntelRdt(popr, false) - size := p.Size() - dAtA := make([]byte, size) - for i := range dAtA { - dAtA[i] = byte(popr.Intn(256)) - } - _, err := p.MarshalTo(dAtA) - if err != nil { - t.Fatalf("seed = %d, err = %v", seed, err) - } - msg := &LinuxIntelRdt{} - if err := github_com_gogo_protobuf_proto.Unmarshal(dAtA, msg); err != nil { - t.Fatalf("seed = %d, err = %v", seed, err) - } - for i := range dAtA { - dAtA[i] = byte(popr.Intn(256)) - } - if !p.Equal(msg) { - t.Fatalf("seed = %d, %#v !Proto %#v", seed, msg, p) - } -} - -func BenchmarkLinuxIntelRdtProtoMarshal(b *testing.B) { - popr := math_rand.New(math_rand.NewSource(616)) - total := 0 - pops := make([]*LinuxIntelRdt, 10000) - for i := 0; i < 10000; i++ { - pops[i] = NewPopulatedLinuxIntelRdt(popr, false) - } - b.ResetTimer() - for i := 0; i < b.N; i++ { - dAtA, err := github_com_gogo_protobuf_proto.Marshal(pops[i%10000]) - if err != nil { - panic(err) - } - total += len(dAtA) - } - b.SetBytes(int64(total / b.N)) -} - -func BenchmarkLinuxIntelRdtProtoUnmarshal(b *testing.B) { - popr := math_rand.New(math_rand.NewSource(616)) - total := 0 - datas := make([][]byte, 10000) - for i := 0; i < 10000; i++ { - dAtA, err := github_com_gogo_protobuf_proto.Marshal(NewPopulatedLinuxIntelRdt(popr, false)) - if err != nil { - panic(err) - } - datas[i] = dAtA - } - msg := &LinuxIntelRdt{} - b.ResetTimer() - for i := 0; i < b.N; i++ { - total += len(datas[i%10000]) - if err := github_com_gogo_protobuf_proto.Unmarshal(datas[i%10000], msg); err != nil { - panic(err) - } - } - b.SetBytes(int64(total / b.N)) -} - -func TestSpecJSON(t *testing.T) { - seed := time.Now().UnixNano() - popr := math_rand.New(math_rand.NewSource(seed)) - p := NewPopulatedSpec(popr, true) - marshaler := github_com_gogo_protobuf_jsonpb.Marshaler{} - jsondata, err := marshaler.MarshalToString(p) - if err != nil { - t.Fatalf("seed = %d, err = %v", seed, err) - } - msg := &Spec{} - err = github_com_gogo_protobuf_jsonpb.UnmarshalString(jsondata, msg) - if err != nil { - t.Fatalf("seed = %d, err = %v", seed, err) - } - if !p.Equal(msg) { - t.Fatalf("seed = %d, %#v !Json Equal %#v", seed, msg, p) - } -} -func TestProcessJSON(t *testing.T) { - seed := time.Now().UnixNano() - popr := math_rand.New(math_rand.NewSource(seed)) - p := NewPopulatedProcess(popr, true) - marshaler := github_com_gogo_protobuf_jsonpb.Marshaler{} - jsondata, err := marshaler.MarshalToString(p) - if err != nil { - t.Fatalf("seed = %d, err = %v", seed, err) - } - msg := &Process{} - err = github_com_gogo_protobuf_jsonpb.UnmarshalString(jsondata, msg) - if err != nil { - t.Fatalf("seed = %d, err = %v", seed, err) - } - if !p.Equal(msg) { - t.Fatalf("seed = %d, %#v !Json Equal %#v", seed, msg, p) - } -} -func TestBoxJSON(t *testing.T) { - seed := time.Now().UnixNano() - popr := math_rand.New(math_rand.NewSource(seed)) - p := NewPopulatedBox(popr, true) - marshaler := github_com_gogo_protobuf_jsonpb.Marshaler{} - jsondata, err := marshaler.MarshalToString(p) - if err != nil { - t.Fatalf("seed = %d, err = %v", seed, err) - } - msg := &Box{} - err = github_com_gogo_protobuf_jsonpb.UnmarshalString(jsondata, msg) - if err != nil { - t.Fatalf("seed = %d, err = %v", seed, err) - } - if !p.Equal(msg) { - t.Fatalf("seed = %d, %#v !Json Equal %#v", seed, msg, p) - } -} -func TestUserJSON(t *testing.T) { - seed := time.Now().UnixNano() - popr := math_rand.New(math_rand.NewSource(seed)) - p := NewPopulatedUser(popr, true) - marshaler := github_com_gogo_protobuf_jsonpb.Marshaler{} - jsondata, err := marshaler.MarshalToString(p) - if err != nil { - t.Fatalf("seed = %d, err = %v", seed, err) - } - msg := &User{} - err = github_com_gogo_protobuf_jsonpb.UnmarshalString(jsondata, msg) - if err != nil { - t.Fatalf("seed = %d, err = %v", seed, err) - } - if !p.Equal(msg) { - t.Fatalf("seed = %d, %#v !Json Equal %#v", seed, msg, p) - } -} -func TestLinuxCapabilitiesJSON(t *testing.T) { - seed := time.Now().UnixNano() - popr := math_rand.New(math_rand.NewSource(seed)) - p := NewPopulatedLinuxCapabilities(popr, true) - marshaler := github_com_gogo_protobuf_jsonpb.Marshaler{} - jsondata, err := marshaler.MarshalToString(p) - if err != nil { - t.Fatalf("seed = %d, err = %v", seed, err) - } - msg := &LinuxCapabilities{} - err = github_com_gogo_protobuf_jsonpb.UnmarshalString(jsondata, msg) - if err != nil { - t.Fatalf("seed = %d, err = %v", seed, err) - } - if !p.Equal(msg) { - t.Fatalf("seed = %d, %#v !Json Equal %#v", seed, msg, p) - } -} -func TestPOSIXRlimitJSON(t *testing.T) { - seed := time.Now().UnixNano() - popr := math_rand.New(math_rand.NewSource(seed)) - p := NewPopulatedPOSIXRlimit(popr, true) - marshaler := github_com_gogo_protobuf_jsonpb.Marshaler{} - jsondata, err := marshaler.MarshalToString(p) - if err != nil { - t.Fatalf("seed = %d, err = %v", seed, err) - } - msg := &POSIXRlimit{} - err = github_com_gogo_protobuf_jsonpb.UnmarshalString(jsondata, msg) - if err != nil { - t.Fatalf("seed = %d, err = %v", seed, err) - } - if !p.Equal(msg) { - t.Fatalf("seed = %d, %#v !Json Equal %#v", seed, msg, p) - } -} -func TestMountJSON(t *testing.T) { - seed := time.Now().UnixNano() - popr := math_rand.New(math_rand.NewSource(seed)) - p := NewPopulatedMount(popr, true) - marshaler := github_com_gogo_protobuf_jsonpb.Marshaler{} - jsondata, err := marshaler.MarshalToString(p) - if err != nil { - t.Fatalf("seed = %d, err = %v", seed, err) - } - msg := &Mount{} - err = github_com_gogo_protobuf_jsonpb.UnmarshalString(jsondata, msg) - if err != nil { - t.Fatalf("seed = %d, err = %v", seed, err) - } - if !p.Equal(msg) { - t.Fatalf("seed = %d, %#v !Json Equal %#v", seed, msg, p) - } -} -func TestRootJSON(t *testing.T) { - seed := time.Now().UnixNano() - popr := math_rand.New(math_rand.NewSource(seed)) - p := NewPopulatedRoot(popr, true) - marshaler := github_com_gogo_protobuf_jsonpb.Marshaler{} - jsondata, err := marshaler.MarshalToString(p) - if err != nil { - t.Fatalf("seed = %d, err = %v", seed, err) - } - msg := &Root{} - err = github_com_gogo_protobuf_jsonpb.UnmarshalString(jsondata, msg) - if err != nil { - t.Fatalf("seed = %d, err = %v", seed, err) - } - if !p.Equal(msg) { - t.Fatalf("seed = %d, %#v !Json Equal %#v", seed, msg, p) - } -} -func TestHooksJSON(t *testing.T) { - seed := time.Now().UnixNano() - popr := math_rand.New(math_rand.NewSource(seed)) - p := NewPopulatedHooks(popr, true) - marshaler := github_com_gogo_protobuf_jsonpb.Marshaler{} - jsondata, err := marshaler.MarshalToString(p) - if err != nil { - t.Fatalf("seed = %d, err = %v", seed, err) - } - msg := &Hooks{} - err = github_com_gogo_protobuf_jsonpb.UnmarshalString(jsondata, msg) - if err != nil { - t.Fatalf("seed = %d, err = %v", seed, err) - } - if !p.Equal(msg) { - t.Fatalf("seed = %d, %#v !Json Equal %#v", seed, msg, p) - } -} -func TestHookJSON(t *testing.T) { - seed := time.Now().UnixNano() - popr := math_rand.New(math_rand.NewSource(seed)) - p := NewPopulatedHook(popr, true) - marshaler := github_com_gogo_protobuf_jsonpb.Marshaler{} - jsondata, err := marshaler.MarshalToString(p) - if err != nil { - t.Fatalf("seed = %d, err = %v", seed, err) - } - msg := &Hook{} - err = github_com_gogo_protobuf_jsonpb.UnmarshalString(jsondata, msg) - if err != nil { - t.Fatalf("seed = %d, err = %v", seed, err) - } - if !p.Equal(msg) { - t.Fatalf("seed = %d, %#v !Json Equal %#v", seed, msg, p) - } -} -func TestLinuxJSON(t *testing.T) { - seed := time.Now().UnixNano() - popr := math_rand.New(math_rand.NewSource(seed)) - p := NewPopulatedLinux(popr, true) - marshaler := github_com_gogo_protobuf_jsonpb.Marshaler{} - jsondata, err := marshaler.MarshalToString(p) - if err != nil { - t.Fatalf("seed = %d, err = %v", seed, err) - } - msg := &Linux{} - err = github_com_gogo_protobuf_jsonpb.UnmarshalString(jsondata, msg) - if err != nil { - t.Fatalf("seed = %d, err = %v", seed, err) - } - if !p.Equal(msg) { - t.Fatalf("seed = %d, %#v !Json Equal %#v", seed, msg, p) - } -} -func TestWindowsJSON(t *testing.T) { - seed := time.Now().UnixNano() - popr := math_rand.New(math_rand.NewSource(seed)) - p := NewPopulatedWindows(popr, true) - marshaler := github_com_gogo_protobuf_jsonpb.Marshaler{} - jsondata, err := marshaler.MarshalToString(p) - if err != nil { - t.Fatalf("seed = %d, err = %v", seed, err) - } - msg := &Windows{} - err = github_com_gogo_protobuf_jsonpb.UnmarshalString(jsondata, msg) - if err != nil { - t.Fatalf("seed = %d, err = %v", seed, err) - } - if !p.Equal(msg) { - t.Fatalf("seed = %d, %#v !Json Equal %#v", seed, msg, p) - } -} -func TestSolarisJSON(t *testing.T) { - seed := time.Now().UnixNano() - popr := math_rand.New(math_rand.NewSource(seed)) - p := NewPopulatedSolaris(popr, true) - marshaler := github_com_gogo_protobuf_jsonpb.Marshaler{} - jsondata, err := marshaler.MarshalToString(p) - if err != nil { - t.Fatalf("seed = %d, err = %v", seed, err) - } - msg := &Solaris{} - err = github_com_gogo_protobuf_jsonpb.UnmarshalString(jsondata, msg) - if err != nil { - t.Fatalf("seed = %d, err = %v", seed, err) - } - if !p.Equal(msg) { - t.Fatalf("seed = %d, %#v !Json Equal %#v", seed, msg, p) - } -} -func TestLinuxIDMappingJSON(t *testing.T) { - seed := time.Now().UnixNano() - popr := math_rand.New(math_rand.NewSource(seed)) - p := NewPopulatedLinuxIDMapping(popr, true) - marshaler := github_com_gogo_protobuf_jsonpb.Marshaler{} - jsondata, err := marshaler.MarshalToString(p) - if err != nil { - t.Fatalf("seed = %d, err = %v", seed, err) - } - msg := &LinuxIDMapping{} - err = github_com_gogo_protobuf_jsonpb.UnmarshalString(jsondata, msg) - if err != nil { - t.Fatalf("seed = %d, err = %v", seed, err) - } - if !p.Equal(msg) { - t.Fatalf("seed = %d, %#v !Json Equal %#v", seed, msg, p) - } -} -func TestLinuxNamespaceJSON(t *testing.T) { - seed := time.Now().UnixNano() - popr := math_rand.New(math_rand.NewSource(seed)) - p := NewPopulatedLinuxNamespace(popr, true) - marshaler := github_com_gogo_protobuf_jsonpb.Marshaler{} - jsondata, err := marshaler.MarshalToString(p) - if err != nil { - t.Fatalf("seed = %d, err = %v", seed, err) - } - msg := &LinuxNamespace{} - err = github_com_gogo_protobuf_jsonpb.UnmarshalString(jsondata, msg) - if err != nil { - t.Fatalf("seed = %d, err = %v", seed, err) - } - if !p.Equal(msg) { - t.Fatalf("seed = %d, %#v !Json Equal %#v", seed, msg, p) - } -} -func TestLinuxDeviceJSON(t *testing.T) { - seed := time.Now().UnixNano() - popr := math_rand.New(math_rand.NewSource(seed)) - p := NewPopulatedLinuxDevice(popr, true) - marshaler := github_com_gogo_protobuf_jsonpb.Marshaler{} - jsondata, err := marshaler.MarshalToString(p) - if err != nil { - t.Fatalf("seed = %d, err = %v", seed, err) - } - msg := &LinuxDevice{} - err = github_com_gogo_protobuf_jsonpb.UnmarshalString(jsondata, msg) - if err != nil { - t.Fatalf("seed = %d, err = %v", seed, err) - } - if !p.Equal(msg) { - t.Fatalf("seed = %d, %#v !Json Equal %#v", seed, msg, p) - } -} -func TestLinuxResourcesJSON(t *testing.T) { - seed := time.Now().UnixNano() - popr := math_rand.New(math_rand.NewSource(seed)) - p := NewPopulatedLinuxResources(popr, true) - marshaler := github_com_gogo_protobuf_jsonpb.Marshaler{} - jsondata, err := marshaler.MarshalToString(p) - if err != nil { - t.Fatalf("seed = %d, err = %v", seed, err) - } - msg := &LinuxResources{} - err = github_com_gogo_protobuf_jsonpb.UnmarshalString(jsondata, msg) - if err != nil { - t.Fatalf("seed = %d, err = %v", seed, err) - } - if !p.Equal(msg) { - t.Fatalf("seed = %d, %#v !Json Equal %#v", seed, msg, p) - } -} -func TestLinuxMemoryJSON(t *testing.T) { - seed := time.Now().UnixNano() - popr := math_rand.New(math_rand.NewSource(seed)) - p := NewPopulatedLinuxMemory(popr, true) - marshaler := github_com_gogo_protobuf_jsonpb.Marshaler{} - jsondata, err := marshaler.MarshalToString(p) - if err != nil { - t.Fatalf("seed = %d, err = %v", seed, err) - } - msg := &LinuxMemory{} - err = github_com_gogo_protobuf_jsonpb.UnmarshalString(jsondata, msg) - if err != nil { - t.Fatalf("seed = %d, err = %v", seed, err) - } - if !p.Equal(msg) { - t.Fatalf("seed = %d, %#v !Json Equal %#v", seed, msg, p) - } -} -func TestLinuxCPUJSON(t *testing.T) { - seed := time.Now().UnixNano() - popr := math_rand.New(math_rand.NewSource(seed)) - p := NewPopulatedLinuxCPU(popr, true) - marshaler := github_com_gogo_protobuf_jsonpb.Marshaler{} - jsondata, err := marshaler.MarshalToString(p) - if err != nil { - t.Fatalf("seed = %d, err = %v", seed, err) - } - msg := &LinuxCPU{} - err = github_com_gogo_protobuf_jsonpb.UnmarshalString(jsondata, msg) - if err != nil { - t.Fatalf("seed = %d, err = %v", seed, err) - } - if !p.Equal(msg) { - t.Fatalf("seed = %d, %#v !Json Equal %#v", seed, msg, p) - } -} -func TestLinuxWeightDeviceJSON(t *testing.T) { - seed := time.Now().UnixNano() - popr := math_rand.New(math_rand.NewSource(seed)) - p := NewPopulatedLinuxWeightDevice(popr, true) - marshaler := github_com_gogo_protobuf_jsonpb.Marshaler{} - jsondata, err := marshaler.MarshalToString(p) - if err != nil { - t.Fatalf("seed = %d, err = %v", seed, err) - } - msg := &LinuxWeightDevice{} - err = github_com_gogo_protobuf_jsonpb.UnmarshalString(jsondata, msg) - if err != nil { - t.Fatalf("seed = %d, err = %v", seed, err) - } - if !p.Equal(msg) { - t.Fatalf("seed = %d, %#v !Json Equal %#v", seed, msg, p) - } -} -func TestLinuxThrottleDeviceJSON(t *testing.T) { - seed := time.Now().UnixNano() - popr := math_rand.New(math_rand.NewSource(seed)) - p := NewPopulatedLinuxThrottleDevice(popr, true) - marshaler := github_com_gogo_protobuf_jsonpb.Marshaler{} - jsondata, err := marshaler.MarshalToString(p) - if err != nil { - t.Fatalf("seed = %d, err = %v", seed, err) - } - msg := &LinuxThrottleDevice{} - err = github_com_gogo_protobuf_jsonpb.UnmarshalString(jsondata, msg) - if err != nil { - t.Fatalf("seed = %d, err = %v", seed, err) - } - if !p.Equal(msg) { - t.Fatalf("seed = %d, %#v !Json Equal %#v", seed, msg, p) - } -} -func TestLinuxBlockIOJSON(t *testing.T) { - seed := time.Now().UnixNano() - popr := math_rand.New(math_rand.NewSource(seed)) - p := NewPopulatedLinuxBlockIO(popr, true) - marshaler := github_com_gogo_protobuf_jsonpb.Marshaler{} - jsondata, err := marshaler.MarshalToString(p) - if err != nil { - t.Fatalf("seed = %d, err = %v", seed, err) - } - msg := &LinuxBlockIO{} - err = github_com_gogo_protobuf_jsonpb.UnmarshalString(jsondata, msg) - if err != nil { - t.Fatalf("seed = %d, err = %v", seed, err) - } - if !p.Equal(msg) { - t.Fatalf("seed = %d, %#v !Json Equal %#v", seed, msg, p) - } -} -func TestLinuxPidsJSON(t *testing.T) { - seed := time.Now().UnixNano() - popr := math_rand.New(math_rand.NewSource(seed)) - p := NewPopulatedLinuxPids(popr, true) - marshaler := github_com_gogo_protobuf_jsonpb.Marshaler{} - jsondata, err := marshaler.MarshalToString(p) - if err != nil { - t.Fatalf("seed = %d, err = %v", seed, err) - } - msg := &LinuxPids{} - err = github_com_gogo_protobuf_jsonpb.UnmarshalString(jsondata, msg) - if err != nil { - t.Fatalf("seed = %d, err = %v", seed, err) - } - if !p.Equal(msg) { - t.Fatalf("seed = %d, %#v !Json Equal %#v", seed, msg, p) - } -} -func TestLinuxDeviceCgroupJSON(t *testing.T) { - seed := time.Now().UnixNano() - popr := math_rand.New(math_rand.NewSource(seed)) - p := NewPopulatedLinuxDeviceCgroup(popr, true) - marshaler := github_com_gogo_protobuf_jsonpb.Marshaler{} - jsondata, err := marshaler.MarshalToString(p) - if err != nil { - t.Fatalf("seed = %d, err = %v", seed, err) - } - msg := &LinuxDeviceCgroup{} - err = github_com_gogo_protobuf_jsonpb.UnmarshalString(jsondata, msg) - if err != nil { - t.Fatalf("seed = %d, err = %v", seed, err) - } - if !p.Equal(msg) { - t.Fatalf("seed = %d, %#v !Json Equal %#v", seed, msg, p) - } -} -func TestLinuxNetworkJSON(t *testing.T) { - seed := time.Now().UnixNano() - popr := math_rand.New(math_rand.NewSource(seed)) - p := NewPopulatedLinuxNetwork(popr, true) - marshaler := github_com_gogo_protobuf_jsonpb.Marshaler{} - jsondata, err := marshaler.MarshalToString(p) - if err != nil { - t.Fatalf("seed = %d, err = %v", seed, err) - } - msg := &LinuxNetwork{} - err = github_com_gogo_protobuf_jsonpb.UnmarshalString(jsondata, msg) - if err != nil { - t.Fatalf("seed = %d, err = %v", seed, err) - } - if !p.Equal(msg) { - t.Fatalf("seed = %d, %#v !Json Equal %#v", seed, msg, p) - } -} -func TestLinuxHugepageLimitJSON(t *testing.T) { - seed := time.Now().UnixNano() - popr := math_rand.New(math_rand.NewSource(seed)) - p := NewPopulatedLinuxHugepageLimit(popr, true) - marshaler := github_com_gogo_protobuf_jsonpb.Marshaler{} - jsondata, err := marshaler.MarshalToString(p) - if err != nil { - t.Fatalf("seed = %d, err = %v", seed, err) - } - msg := &LinuxHugepageLimit{} - err = github_com_gogo_protobuf_jsonpb.UnmarshalString(jsondata, msg) - if err != nil { - t.Fatalf("seed = %d, err = %v", seed, err) - } - if !p.Equal(msg) { - t.Fatalf("seed = %d, %#v !Json Equal %#v", seed, msg, p) - } -} -func TestLinuxInterfacePriorityJSON(t *testing.T) { - seed := time.Now().UnixNano() - popr := math_rand.New(math_rand.NewSource(seed)) - p := NewPopulatedLinuxInterfacePriority(popr, true) - marshaler := github_com_gogo_protobuf_jsonpb.Marshaler{} - jsondata, err := marshaler.MarshalToString(p) - if err != nil { - t.Fatalf("seed = %d, err = %v", seed, err) - } - msg := &LinuxInterfacePriority{} - err = github_com_gogo_protobuf_jsonpb.UnmarshalString(jsondata, msg) - if err != nil { - t.Fatalf("seed = %d, err = %v", seed, err) - } - if !p.Equal(msg) { - t.Fatalf("seed = %d, %#v !Json Equal %#v", seed, msg, p) - } -} -func TestLinuxSeccompJSON(t *testing.T) { - seed := time.Now().UnixNano() - popr := math_rand.New(math_rand.NewSource(seed)) - p := NewPopulatedLinuxSeccomp(popr, true) - marshaler := github_com_gogo_protobuf_jsonpb.Marshaler{} - jsondata, err := marshaler.MarshalToString(p) - if err != nil { - t.Fatalf("seed = %d, err = %v", seed, err) - } - msg := &LinuxSeccomp{} - err = github_com_gogo_protobuf_jsonpb.UnmarshalString(jsondata, msg) - if err != nil { - t.Fatalf("seed = %d, err = %v", seed, err) - } - if !p.Equal(msg) { - t.Fatalf("seed = %d, %#v !Json Equal %#v", seed, msg, p) - } -} -func TestLinuxSeccompArgJSON(t *testing.T) { - seed := time.Now().UnixNano() - popr := math_rand.New(math_rand.NewSource(seed)) - p := NewPopulatedLinuxSeccompArg(popr, true) - marshaler := github_com_gogo_protobuf_jsonpb.Marshaler{} - jsondata, err := marshaler.MarshalToString(p) - if err != nil { - t.Fatalf("seed = %d, err = %v", seed, err) - } - msg := &LinuxSeccompArg{} - err = github_com_gogo_protobuf_jsonpb.UnmarshalString(jsondata, msg) - if err != nil { - t.Fatalf("seed = %d, err = %v", seed, err) - } - if !p.Equal(msg) { - t.Fatalf("seed = %d, %#v !Json Equal %#v", seed, msg, p) - } -} -func TestLinuxSyscallJSON(t *testing.T) { - seed := time.Now().UnixNano() - popr := math_rand.New(math_rand.NewSource(seed)) - p := NewPopulatedLinuxSyscall(popr, true) - marshaler := github_com_gogo_protobuf_jsonpb.Marshaler{} - jsondata, err := marshaler.MarshalToString(p) - if err != nil { - t.Fatalf("seed = %d, err = %v", seed, err) - } - msg := &LinuxSyscall{} - err = github_com_gogo_protobuf_jsonpb.UnmarshalString(jsondata, msg) - if err != nil { - t.Fatalf("seed = %d, err = %v", seed, err) - } - if !p.Equal(msg) { - t.Fatalf("seed = %d, %#v !Json Equal %#v", seed, msg, p) - } -} -func TestLinuxIntelRdtJSON(t *testing.T) { - seed := time.Now().UnixNano() - popr := math_rand.New(math_rand.NewSource(seed)) - p := NewPopulatedLinuxIntelRdt(popr, true) - marshaler := github_com_gogo_protobuf_jsonpb.Marshaler{} - jsondata, err := marshaler.MarshalToString(p) - if err != nil { - t.Fatalf("seed = %d, err = %v", seed, err) - } - msg := &LinuxIntelRdt{} - err = github_com_gogo_protobuf_jsonpb.UnmarshalString(jsondata, msg) - if err != nil { - t.Fatalf("seed = %d, err = %v", seed, err) - } - if !p.Equal(msg) { - t.Fatalf("seed = %d, %#v !Json Equal %#v", seed, msg, p) - } -} -func TestSpecProtoText(t *testing.T) { - seed := time.Now().UnixNano() - popr := math_rand.New(math_rand.NewSource(seed)) - p := NewPopulatedSpec(popr, true) - dAtA := github_com_gogo_protobuf_proto.MarshalTextString(p) - msg := &Spec{} - if err := github_com_gogo_protobuf_proto.UnmarshalText(dAtA, msg); err != nil { - t.Fatalf("seed = %d, err = %v", seed, err) - } - if !p.Equal(msg) { - t.Fatalf("seed = %d, %#v !Proto %#v", seed, msg, p) - } -} - -func TestSpecProtoCompactText(t *testing.T) { - seed := time.Now().UnixNano() - popr := math_rand.New(math_rand.NewSource(seed)) - p := NewPopulatedSpec(popr, true) - dAtA := github_com_gogo_protobuf_proto.CompactTextString(p) - msg := &Spec{} - if err := github_com_gogo_protobuf_proto.UnmarshalText(dAtA, msg); err != nil { - t.Fatalf("seed = %d, err = %v", seed, err) - } - if !p.Equal(msg) { - t.Fatalf("seed = %d, %#v !Proto %#v", seed, msg, p) - } -} - -func TestProcessProtoText(t *testing.T) { - seed := time.Now().UnixNano() - popr := math_rand.New(math_rand.NewSource(seed)) - p := NewPopulatedProcess(popr, true) - dAtA := github_com_gogo_protobuf_proto.MarshalTextString(p) - msg := &Process{} - if err := github_com_gogo_protobuf_proto.UnmarshalText(dAtA, msg); err != nil { - t.Fatalf("seed = %d, err = %v", seed, err) - } - if !p.Equal(msg) { - t.Fatalf("seed = %d, %#v !Proto %#v", seed, msg, p) - } -} - -func TestProcessProtoCompactText(t *testing.T) { - seed := time.Now().UnixNano() - popr := math_rand.New(math_rand.NewSource(seed)) - p := NewPopulatedProcess(popr, true) - dAtA := github_com_gogo_protobuf_proto.CompactTextString(p) - msg := &Process{} - if err := github_com_gogo_protobuf_proto.UnmarshalText(dAtA, msg); err != nil { - t.Fatalf("seed = %d, err = %v", seed, err) - } - if !p.Equal(msg) { - t.Fatalf("seed = %d, %#v !Proto %#v", seed, msg, p) - } -} - -func TestBoxProtoText(t *testing.T) { - seed := time.Now().UnixNano() - popr := math_rand.New(math_rand.NewSource(seed)) - p := NewPopulatedBox(popr, true) - dAtA := github_com_gogo_protobuf_proto.MarshalTextString(p) - msg := &Box{} - if err := github_com_gogo_protobuf_proto.UnmarshalText(dAtA, msg); err != nil { - t.Fatalf("seed = %d, err = %v", seed, err) - } - if !p.Equal(msg) { - t.Fatalf("seed = %d, %#v !Proto %#v", seed, msg, p) - } -} - -func TestBoxProtoCompactText(t *testing.T) { - seed := time.Now().UnixNano() - popr := math_rand.New(math_rand.NewSource(seed)) - p := NewPopulatedBox(popr, true) - dAtA := github_com_gogo_protobuf_proto.CompactTextString(p) - msg := &Box{} - if err := github_com_gogo_protobuf_proto.UnmarshalText(dAtA, msg); err != nil { - t.Fatalf("seed = %d, err = %v", seed, err) - } - if !p.Equal(msg) { - t.Fatalf("seed = %d, %#v !Proto %#v", seed, msg, p) - } -} - -func TestUserProtoText(t *testing.T) { - seed := time.Now().UnixNano() - popr := math_rand.New(math_rand.NewSource(seed)) - p := NewPopulatedUser(popr, true) - dAtA := github_com_gogo_protobuf_proto.MarshalTextString(p) - msg := &User{} - if err := github_com_gogo_protobuf_proto.UnmarshalText(dAtA, msg); err != nil { - t.Fatalf("seed = %d, err = %v", seed, err) - } - if !p.Equal(msg) { - t.Fatalf("seed = %d, %#v !Proto %#v", seed, msg, p) - } -} - -func TestUserProtoCompactText(t *testing.T) { - seed := time.Now().UnixNano() - popr := math_rand.New(math_rand.NewSource(seed)) - p := NewPopulatedUser(popr, true) - dAtA := github_com_gogo_protobuf_proto.CompactTextString(p) - msg := &User{} - if err := github_com_gogo_protobuf_proto.UnmarshalText(dAtA, msg); err != nil { - t.Fatalf("seed = %d, err = %v", seed, err) - } - if !p.Equal(msg) { - t.Fatalf("seed = %d, %#v !Proto %#v", seed, msg, p) - } -} - -func TestLinuxCapabilitiesProtoText(t *testing.T) { - seed := time.Now().UnixNano() - popr := math_rand.New(math_rand.NewSource(seed)) - p := NewPopulatedLinuxCapabilities(popr, true) - dAtA := github_com_gogo_protobuf_proto.MarshalTextString(p) - msg := &LinuxCapabilities{} - if err := github_com_gogo_protobuf_proto.UnmarshalText(dAtA, msg); err != nil { - t.Fatalf("seed = %d, err = %v", seed, err) - } - if !p.Equal(msg) { - t.Fatalf("seed = %d, %#v !Proto %#v", seed, msg, p) - } -} - -func TestLinuxCapabilitiesProtoCompactText(t *testing.T) { - seed := time.Now().UnixNano() - popr := math_rand.New(math_rand.NewSource(seed)) - p := NewPopulatedLinuxCapabilities(popr, true) - dAtA := github_com_gogo_protobuf_proto.CompactTextString(p) - msg := &LinuxCapabilities{} - if err := github_com_gogo_protobuf_proto.UnmarshalText(dAtA, msg); err != nil { - t.Fatalf("seed = %d, err = %v", seed, err) - } - if !p.Equal(msg) { - t.Fatalf("seed = %d, %#v !Proto %#v", seed, msg, p) - } -} - -func TestPOSIXRlimitProtoText(t *testing.T) { - seed := time.Now().UnixNano() - popr := math_rand.New(math_rand.NewSource(seed)) - p := NewPopulatedPOSIXRlimit(popr, true) - dAtA := github_com_gogo_protobuf_proto.MarshalTextString(p) - msg := &POSIXRlimit{} - if err := github_com_gogo_protobuf_proto.UnmarshalText(dAtA, msg); err != nil { - t.Fatalf("seed = %d, err = %v", seed, err) - } - if !p.Equal(msg) { - t.Fatalf("seed = %d, %#v !Proto %#v", seed, msg, p) - } -} - -func TestPOSIXRlimitProtoCompactText(t *testing.T) { - seed := time.Now().UnixNano() - popr := math_rand.New(math_rand.NewSource(seed)) - p := NewPopulatedPOSIXRlimit(popr, true) - dAtA := github_com_gogo_protobuf_proto.CompactTextString(p) - msg := &POSIXRlimit{} - if err := github_com_gogo_protobuf_proto.UnmarshalText(dAtA, msg); err != nil { - t.Fatalf("seed = %d, err = %v", seed, err) - } - if !p.Equal(msg) { - t.Fatalf("seed = %d, %#v !Proto %#v", seed, msg, p) - } -} - -func TestMountProtoText(t *testing.T) { - seed := time.Now().UnixNano() - popr := math_rand.New(math_rand.NewSource(seed)) - p := NewPopulatedMount(popr, true) - dAtA := github_com_gogo_protobuf_proto.MarshalTextString(p) - msg := &Mount{} - if err := github_com_gogo_protobuf_proto.UnmarshalText(dAtA, msg); err != nil { - t.Fatalf("seed = %d, err = %v", seed, err) - } - if !p.Equal(msg) { - t.Fatalf("seed = %d, %#v !Proto %#v", seed, msg, p) - } -} - -func TestMountProtoCompactText(t *testing.T) { - seed := time.Now().UnixNano() - popr := math_rand.New(math_rand.NewSource(seed)) - p := NewPopulatedMount(popr, true) - dAtA := github_com_gogo_protobuf_proto.CompactTextString(p) - msg := &Mount{} - if err := github_com_gogo_protobuf_proto.UnmarshalText(dAtA, msg); err != nil { - t.Fatalf("seed = %d, err = %v", seed, err) - } - if !p.Equal(msg) { - t.Fatalf("seed = %d, %#v !Proto %#v", seed, msg, p) - } -} - -func TestRootProtoText(t *testing.T) { - seed := time.Now().UnixNano() - popr := math_rand.New(math_rand.NewSource(seed)) - p := NewPopulatedRoot(popr, true) - dAtA := github_com_gogo_protobuf_proto.MarshalTextString(p) - msg := &Root{} - if err := github_com_gogo_protobuf_proto.UnmarshalText(dAtA, msg); err != nil { - t.Fatalf("seed = %d, err = %v", seed, err) - } - if !p.Equal(msg) { - t.Fatalf("seed = %d, %#v !Proto %#v", seed, msg, p) - } -} - -func TestRootProtoCompactText(t *testing.T) { - seed := time.Now().UnixNano() - popr := math_rand.New(math_rand.NewSource(seed)) - p := NewPopulatedRoot(popr, true) - dAtA := github_com_gogo_protobuf_proto.CompactTextString(p) - msg := &Root{} - if err := github_com_gogo_protobuf_proto.UnmarshalText(dAtA, msg); err != nil { - t.Fatalf("seed = %d, err = %v", seed, err) - } - if !p.Equal(msg) { - t.Fatalf("seed = %d, %#v !Proto %#v", seed, msg, p) - } -} - -func TestHooksProtoText(t *testing.T) { - seed := time.Now().UnixNano() - popr := math_rand.New(math_rand.NewSource(seed)) - p := NewPopulatedHooks(popr, true) - dAtA := github_com_gogo_protobuf_proto.MarshalTextString(p) - msg := &Hooks{} - if err := github_com_gogo_protobuf_proto.UnmarshalText(dAtA, msg); err != nil { - t.Fatalf("seed = %d, err = %v", seed, err) - } - if !p.Equal(msg) { - t.Fatalf("seed = %d, %#v !Proto %#v", seed, msg, p) - } -} - -func TestHooksProtoCompactText(t *testing.T) { - seed := time.Now().UnixNano() - popr := math_rand.New(math_rand.NewSource(seed)) - p := NewPopulatedHooks(popr, true) - dAtA := github_com_gogo_protobuf_proto.CompactTextString(p) - msg := &Hooks{} - if err := github_com_gogo_protobuf_proto.UnmarshalText(dAtA, msg); err != nil { - t.Fatalf("seed = %d, err = %v", seed, err) - } - if !p.Equal(msg) { - t.Fatalf("seed = %d, %#v !Proto %#v", seed, msg, p) - } -} - -func TestHookProtoText(t *testing.T) { - seed := time.Now().UnixNano() - popr := math_rand.New(math_rand.NewSource(seed)) - p := NewPopulatedHook(popr, true) - dAtA := github_com_gogo_protobuf_proto.MarshalTextString(p) - msg := &Hook{} - if err := github_com_gogo_protobuf_proto.UnmarshalText(dAtA, msg); err != nil { - t.Fatalf("seed = %d, err = %v", seed, err) - } - if !p.Equal(msg) { - t.Fatalf("seed = %d, %#v !Proto %#v", seed, msg, p) - } -} - -func TestHookProtoCompactText(t *testing.T) { - seed := time.Now().UnixNano() - popr := math_rand.New(math_rand.NewSource(seed)) - p := NewPopulatedHook(popr, true) - dAtA := github_com_gogo_protobuf_proto.CompactTextString(p) - msg := &Hook{} - if err := github_com_gogo_protobuf_proto.UnmarshalText(dAtA, msg); err != nil { - t.Fatalf("seed = %d, err = %v", seed, err) - } - if !p.Equal(msg) { - t.Fatalf("seed = %d, %#v !Proto %#v", seed, msg, p) - } -} - -func TestLinuxProtoText(t *testing.T) { - seed := time.Now().UnixNano() - popr := math_rand.New(math_rand.NewSource(seed)) - p := NewPopulatedLinux(popr, true) - dAtA := github_com_gogo_protobuf_proto.MarshalTextString(p) - msg := &Linux{} - if err := github_com_gogo_protobuf_proto.UnmarshalText(dAtA, msg); err != nil { - t.Fatalf("seed = %d, err = %v", seed, err) - } - if !p.Equal(msg) { - t.Fatalf("seed = %d, %#v !Proto %#v", seed, msg, p) - } -} - -func TestLinuxProtoCompactText(t *testing.T) { - seed := time.Now().UnixNano() - popr := math_rand.New(math_rand.NewSource(seed)) - p := NewPopulatedLinux(popr, true) - dAtA := github_com_gogo_protobuf_proto.CompactTextString(p) - msg := &Linux{} - if err := github_com_gogo_protobuf_proto.UnmarshalText(dAtA, msg); err != nil { - t.Fatalf("seed = %d, err = %v", seed, err) - } - if !p.Equal(msg) { - t.Fatalf("seed = %d, %#v !Proto %#v", seed, msg, p) - } -} - -func TestWindowsProtoText(t *testing.T) { - seed := time.Now().UnixNano() - popr := math_rand.New(math_rand.NewSource(seed)) - p := NewPopulatedWindows(popr, true) - dAtA := github_com_gogo_protobuf_proto.MarshalTextString(p) - msg := &Windows{} - if err := github_com_gogo_protobuf_proto.UnmarshalText(dAtA, msg); err != nil { - t.Fatalf("seed = %d, err = %v", seed, err) - } - if !p.Equal(msg) { - t.Fatalf("seed = %d, %#v !Proto %#v", seed, msg, p) - } -} - -func TestWindowsProtoCompactText(t *testing.T) { - seed := time.Now().UnixNano() - popr := math_rand.New(math_rand.NewSource(seed)) - p := NewPopulatedWindows(popr, true) - dAtA := github_com_gogo_protobuf_proto.CompactTextString(p) - msg := &Windows{} - if err := github_com_gogo_protobuf_proto.UnmarshalText(dAtA, msg); err != nil { - t.Fatalf("seed = %d, err = %v", seed, err) - } - if !p.Equal(msg) { - t.Fatalf("seed = %d, %#v !Proto %#v", seed, msg, p) - } -} - -func TestSolarisProtoText(t *testing.T) { - seed := time.Now().UnixNano() - popr := math_rand.New(math_rand.NewSource(seed)) - p := NewPopulatedSolaris(popr, true) - dAtA := github_com_gogo_protobuf_proto.MarshalTextString(p) - msg := &Solaris{} - if err := github_com_gogo_protobuf_proto.UnmarshalText(dAtA, msg); err != nil { - t.Fatalf("seed = %d, err = %v", seed, err) - } - if !p.Equal(msg) { - t.Fatalf("seed = %d, %#v !Proto %#v", seed, msg, p) - } -} - -func TestSolarisProtoCompactText(t *testing.T) { - seed := time.Now().UnixNano() - popr := math_rand.New(math_rand.NewSource(seed)) - p := NewPopulatedSolaris(popr, true) - dAtA := github_com_gogo_protobuf_proto.CompactTextString(p) - msg := &Solaris{} - if err := github_com_gogo_protobuf_proto.UnmarshalText(dAtA, msg); err != nil { - t.Fatalf("seed = %d, err = %v", seed, err) - } - if !p.Equal(msg) { - t.Fatalf("seed = %d, %#v !Proto %#v", seed, msg, p) - } -} - -func TestLinuxIDMappingProtoText(t *testing.T) { - seed := time.Now().UnixNano() - popr := math_rand.New(math_rand.NewSource(seed)) - p := NewPopulatedLinuxIDMapping(popr, true) - dAtA := github_com_gogo_protobuf_proto.MarshalTextString(p) - msg := &LinuxIDMapping{} - if err := github_com_gogo_protobuf_proto.UnmarshalText(dAtA, msg); err != nil { - t.Fatalf("seed = %d, err = %v", seed, err) - } - if !p.Equal(msg) { - t.Fatalf("seed = %d, %#v !Proto %#v", seed, msg, p) - } -} - -func TestLinuxIDMappingProtoCompactText(t *testing.T) { - seed := time.Now().UnixNano() - popr := math_rand.New(math_rand.NewSource(seed)) - p := NewPopulatedLinuxIDMapping(popr, true) - dAtA := github_com_gogo_protobuf_proto.CompactTextString(p) - msg := &LinuxIDMapping{} - if err := github_com_gogo_protobuf_proto.UnmarshalText(dAtA, msg); err != nil { - t.Fatalf("seed = %d, err = %v", seed, err) - } - if !p.Equal(msg) { - t.Fatalf("seed = %d, %#v !Proto %#v", seed, msg, p) - } -} - -func TestLinuxNamespaceProtoText(t *testing.T) { - seed := time.Now().UnixNano() - popr := math_rand.New(math_rand.NewSource(seed)) - p := NewPopulatedLinuxNamespace(popr, true) - dAtA := github_com_gogo_protobuf_proto.MarshalTextString(p) - msg := &LinuxNamespace{} - if err := github_com_gogo_protobuf_proto.UnmarshalText(dAtA, msg); err != nil { - t.Fatalf("seed = %d, err = %v", seed, err) - } - if !p.Equal(msg) { - t.Fatalf("seed = %d, %#v !Proto %#v", seed, msg, p) - } -} - -func TestLinuxNamespaceProtoCompactText(t *testing.T) { - seed := time.Now().UnixNano() - popr := math_rand.New(math_rand.NewSource(seed)) - p := NewPopulatedLinuxNamespace(popr, true) - dAtA := github_com_gogo_protobuf_proto.CompactTextString(p) - msg := &LinuxNamespace{} - if err := github_com_gogo_protobuf_proto.UnmarshalText(dAtA, msg); err != nil { - t.Fatalf("seed = %d, err = %v", seed, err) - } - if !p.Equal(msg) { - t.Fatalf("seed = %d, %#v !Proto %#v", seed, msg, p) - } -} - -func TestLinuxDeviceProtoText(t *testing.T) { - seed := time.Now().UnixNano() - popr := math_rand.New(math_rand.NewSource(seed)) - p := NewPopulatedLinuxDevice(popr, true) - dAtA := github_com_gogo_protobuf_proto.MarshalTextString(p) - msg := &LinuxDevice{} - if err := github_com_gogo_protobuf_proto.UnmarshalText(dAtA, msg); err != nil { - t.Fatalf("seed = %d, err = %v", seed, err) - } - if !p.Equal(msg) { - t.Fatalf("seed = %d, %#v !Proto %#v", seed, msg, p) - } -} - -func TestLinuxDeviceProtoCompactText(t *testing.T) { - seed := time.Now().UnixNano() - popr := math_rand.New(math_rand.NewSource(seed)) - p := NewPopulatedLinuxDevice(popr, true) - dAtA := github_com_gogo_protobuf_proto.CompactTextString(p) - msg := &LinuxDevice{} - if err := github_com_gogo_protobuf_proto.UnmarshalText(dAtA, msg); err != nil { - t.Fatalf("seed = %d, err = %v", seed, err) - } - if !p.Equal(msg) { - t.Fatalf("seed = %d, %#v !Proto %#v", seed, msg, p) - } -} - -func TestLinuxResourcesProtoText(t *testing.T) { - seed := time.Now().UnixNano() - popr := math_rand.New(math_rand.NewSource(seed)) - p := NewPopulatedLinuxResources(popr, true) - dAtA := github_com_gogo_protobuf_proto.MarshalTextString(p) - msg := &LinuxResources{} - if err := github_com_gogo_protobuf_proto.UnmarshalText(dAtA, msg); err != nil { - t.Fatalf("seed = %d, err = %v", seed, err) - } - if !p.Equal(msg) { - t.Fatalf("seed = %d, %#v !Proto %#v", seed, msg, p) - } -} - -func TestLinuxResourcesProtoCompactText(t *testing.T) { - seed := time.Now().UnixNano() - popr := math_rand.New(math_rand.NewSource(seed)) - p := NewPopulatedLinuxResources(popr, true) - dAtA := github_com_gogo_protobuf_proto.CompactTextString(p) - msg := &LinuxResources{} - if err := github_com_gogo_protobuf_proto.UnmarshalText(dAtA, msg); err != nil { - t.Fatalf("seed = %d, err = %v", seed, err) - } - if !p.Equal(msg) { - t.Fatalf("seed = %d, %#v !Proto %#v", seed, msg, p) - } -} - -func TestLinuxMemoryProtoText(t *testing.T) { - seed := time.Now().UnixNano() - popr := math_rand.New(math_rand.NewSource(seed)) - p := NewPopulatedLinuxMemory(popr, true) - dAtA := github_com_gogo_protobuf_proto.MarshalTextString(p) - msg := &LinuxMemory{} - if err := github_com_gogo_protobuf_proto.UnmarshalText(dAtA, msg); err != nil { - t.Fatalf("seed = %d, err = %v", seed, err) - } - if !p.Equal(msg) { - t.Fatalf("seed = %d, %#v !Proto %#v", seed, msg, p) - } -} - -func TestLinuxMemoryProtoCompactText(t *testing.T) { - seed := time.Now().UnixNano() - popr := math_rand.New(math_rand.NewSource(seed)) - p := NewPopulatedLinuxMemory(popr, true) - dAtA := github_com_gogo_protobuf_proto.CompactTextString(p) - msg := &LinuxMemory{} - if err := github_com_gogo_protobuf_proto.UnmarshalText(dAtA, msg); err != nil { - t.Fatalf("seed = %d, err = %v", seed, err) - } - if !p.Equal(msg) { - t.Fatalf("seed = %d, %#v !Proto %#v", seed, msg, p) - } -} - -func TestLinuxCPUProtoText(t *testing.T) { - seed := time.Now().UnixNano() - popr := math_rand.New(math_rand.NewSource(seed)) - p := NewPopulatedLinuxCPU(popr, true) - dAtA := github_com_gogo_protobuf_proto.MarshalTextString(p) - msg := &LinuxCPU{} - if err := github_com_gogo_protobuf_proto.UnmarshalText(dAtA, msg); err != nil { - t.Fatalf("seed = %d, err = %v", seed, err) - } - if !p.Equal(msg) { - t.Fatalf("seed = %d, %#v !Proto %#v", seed, msg, p) - } -} - -func TestLinuxCPUProtoCompactText(t *testing.T) { - seed := time.Now().UnixNano() - popr := math_rand.New(math_rand.NewSource(seed)) - p := NewPopulatedLinuxCPU(popr, true) - dAtA := github_com_gogo_protobuf_proto.CompactTextString(p) - msg := &LinuxCPU{} - if err := github_com_gogo_protobuf_proto.UnmarshalText(dAtA, msg); err != nil { - t.Fatalf("seed = %d, err = %v", seed, err) - } - if !p.Equal(msg) { - t.Fatalf("seed = %d, %#v !Proto %#v", seed, msg, p) - } -} - -func TestLinuxWeightDeviceProtoText(t *testing.T) { - seed := time.Now().UnixNano() - popr := math_rand.New(math_rand.NewSource(seed)) - p := NewPopulatedLinuxWeightDevice(popr, true) - dAtA := github_com_gogo_protobuf_proto.MarshalTextString(p) - msg := &LinuxWeightDevice{} - if err := github_com_gogo_protobuf_proto.UnmarshalText(dAtA, msg); err != nil { - t.Fatalf("seed = %d, err = %v", seed, err) - } - if !p.Equal(msg) { - t.Fatalf("seed = %d, %#v !Proto %#v", seed, msg, p) - } -} - -func TestLinuxWeightDeviceProtoCompactText(t *testing.T) { - seed := time.Now().UnixNano() - popr := math_rand.New(math_rand.NewSource(seed)) - p := NewPopulatedLinuxWeightDevice(popr, true) - dAtA := github_com_gogo_protobuf_proto.CompactTextString(p) - msg := &LinuxWeightDevice{} - if err := github_com_gogo_protobuf_proto.UnmarshalText(dAtA, msg); err != nil { - t.Fatalf("seed = %d, err = %v", seed, err) - } - if !p.Equal(msg) { - t.Fatalf("seed = %d, %#v !Proto %#v", seed, msg, p) - } -} - -func TestLinuxThrottleDeviceProtoText(t *testing.T) { - seed := time.Now().UnixNano() - popr := math_rand.New(math_rand.NewSource(seed)) - p := NewPopulatedLinuxThrottleDevice(popr, true) - dAtA := github_com_gogo_protobuf_proto.MarshalTextString(p) - msg := &LinuxThrottleDevice{} - if err := github_com_gogo_protobuf_proto.UnmarshalText(dAtA, msg); err != nil { - t.Fatalf("seed = %d, err = %v", seed, err) - } - if !p.Equal(msg) { - t.Fatalf("seed = %d, %#v !Proto %#v", seed, msg, p) - } -} - -func TestLinuxThrottleDeviceProtoCompactText(t *testing.T) { - seed := time.Now().UnixNano() - popr := math_rand.New(math_rand.NewSource(seed)) - p := NewPopulatedLinuxThrottleDevice(popr, true) - dAtA := github_com_gogo_protobuf_proto.CompactTextString(p) - msg := &LinuxThrottleDevice{} - if err := github_com_gogo_protobuf_proto.UnmarshalText(dAtA, msg); err != nil { - t.Fatalf("seed = %d, err = %v", seed, err) - } - if !p.Equal(msg) { - t.Fatalf("seed = %d, %#v !Proto %#v", seed, msg, p) - } -} - -func TestLinuxBlockIOProtoText(t *testing.T) { - seed := time.Now().UnixNano() - popr := math_rand.New(math_rand.NewSource(seed)) - p := NewPopulatedLinuxBlockIO(popr, true) - dAtA := github_com_gogo_protobuf_proto.MarshalTextString(p) - msg := &LinuxBlockIO{} - if err := github_com_gogo_protobuf_proto.UnmarshalText(dAtA, msg); err != nil { - t.Fatalf("seed = %d, err = %v", seed, err) - } - if !p.Equal(msg) { - t.Fatalf("seed = %d, %#v !Proto %#v", seed, msg, p) - } -} - -func TestLinuxBlockIOProtoCompactText(t *testing.T) { - seed := time.Now().UnixNano() - popr := math_rand.New(math_rand.NewSource(seed)) - p := NewPopulatedLinuxBlockIO(popr, true) - dAtA := github_com_gogo_protobuf_proto.CompactTextString(p) - msg := &LinuxBlockIO{} - if err := github_com_gogo_protobuf_proto.UnmarshalText(dAtA, msg); err != nil { - t.Fatalf("seed = %d, err = %v", seed, err) - } - if !p.Equal(msg) { - t.Fatalf("seed = %d, %#v !Proto %#v", seed, msg, p) - } -} - -func TestLinuxPidsProtoText(t *testing.T) { - seed := time.Now().UnixNano() - popr := math_rand.New(math_rand.NewSource(seed)) - p := NewPopulatedLinuxPids(popr, true) - dAtA := github_com_gogo_protobuf_proto.MarshalTextString(p) - msg := &LinuxPids{} - if err := github_com_gogo_protobuf_proto.UnmarshalText(dAtA, msg); err != nil { - t.Fatalf("seed = %d, err = %v", seed, err) - } - if !p.Equal(msg) { - t.Fatalf("seed = %d, %#v !Proto %#v", seed, msg, p) - } -} - -func TestLinuxPidsProtoCompactText(t *testing.T) { - seed := time.Now().UnixNano() - popr := math_rand.New(math_rand.NewSource(seed)) - p := NewPopulatedLinuxPids(popr, true) - dAtA := github_com_gogo_protobuf_proto.CompactTextString(p) - msg := &LinuxPids{} - if err := github_com_gogo_protobuf_proto.UnmarshalText(dAtA, msg); err != nil { - t.Fatalf("seed = %d, err = %v", seed, err) - } - if !p.Equal(msg) { - t.Fatalf("seed = %d, %#v !Proto %#v", seed, msg, p) - } -} - -func TestLinuxDeviceCgroupProtoText(t *testing.T) { - seed := time.Now().UnixNano() - popr := math_rand.New(math_rand.NewSource(seed)) - p := NewPopulatedLinuxDeviceCgroup(popr, true) - dAtA := github_com_gogo_protobuf_proto.MarshalTextString(p) - msg := &LinuxDeviceCgroup{} - if err := github_com_gogo_protobuf_proto.UnmarshalText(dAtA, msg); err != nil { - t.Fatalf("seed = %d, err = %v", seed, err) - } - if !p.Equal(msg) { - t.Fatalf("seed = %d, %#v !Proto %#v", seed, msg, p) - } -} - -func TestLinuxDeviceCgroupProtoCompactText(t *testing.T) { - seed := time.Now().UnixNano() - popr := math_rand.New(math_rand.NewSource(seed)) - p := NewPopulatedLinuxDeviceCgroup(popr, true) - dAtA := github_com_gogo_protobuf_proto.CompactTextString(p) - msg := &LinuxDeviceCgroup{} - if err := github_com_gogo_protobuf_proto.UnmarshalText(dAtA, msg); err != nil { - t.Fatalf("seed = %d, err = %v", seed, err) - } - if !p.Equal(msg) { - t.Fatalf("seed = %d, %#v !Proto %#v", seed, msg, p) - } -} - -func TestLinuxNetworkProtoText(t *testing.T) { - seed := time.Now().UnixNano() - popr := math_rand.New(math_rand.NewSource(seed)) - p := NewPopulatedLinuxNetwork(popr, true) - dAtA := github_com_gogo_protobuf_proto.MarshalTextString(p) - msg := &LinuxNetwork{} - if err := github_com_gogo_protobuf_proto.UnmarshalText(dAtA, msg); err != nil { - t.Fatalf("seed = %d, err = %v", seed, err) - } - if !p.Equal(msg) { - t.Fatalf("seed = %d, %#v !Proto %#v", seed, msg, p) - } -} - -func TestLinuxNetworkProtoCompactText(t *testing.T) { - seed := time.Now().UnixNano() - popr := math_rand.New(math_rand.NewSource(seed)) - p := NewPopulatedLinuxNetwork(popr, true) - dAtA := github_com_gogo_protobuf_proto.CompactTextString(p) - msg := &LinuxNetwork{} - if err := github_com_gogo_protobuf_proto.UnmarshalText(dAtA, msg); err != nil { - t.Fatalf("seed = %d, err = %v", seed, err) - } - if !p.Equal(msg) { - t.Fatalf("seed = %d, %#v !Proto %#v", seed, msg, p) - } -} - -func TestLinuxHugepageLimitProtoText(t *testing.T) { - seed := time.Now().UnixNano() - popr := math_rand.New(math_rand.NewSource(seed)) - p := NewPopulatedLinuxHugepageLimit(popr, true) - dAtA := github_com_gogo_protobuf_proto.MarshalTextString(p) - msg := &LinuxHugepageLimit{} - if err := github_com_gogo_protobuf_proto.UnmarshalText(dAtA, msg); err != nil { - t.Fatalf("seed = %d, err = %v", seed, err) - } - if !p.Equal(msg) { - t.Fatalf("seed = %d, %#v !Proto %#v", seed, msg, p) - } -} - -func TestLinuxHugepageLimitProtoCompactText(t *testing.T) { - seed := time.Now().UnixNano() - popr := math_rand.New(math_rand.NewSource(seed)) - p := NewPopulatedLinuxHugepageLimit(popr, true) - dAtA := github_com_gogo_protobuf_proto.CompactTextString(p) - msg := &LinuxHugepageLimit{} - if err := github_com_gogo_protobuf_proto.UnmarshalText(dAtA, msg); err != nil { - t.Fatalf("seed = %d, err = %v", seed, err) - } - if !p.Equal(msg) { - t.Fatalf("seed = %d, %#v !Proto %#v", seed, msg, p) - } -} - -func TestLinuxInterfacePriorityProtoText(t *testing.T) { - seed := time.Now().UnixNano() - popr := math_rand.New(math_rand.NewSource(seed)) - p := NewPopulatedLinuxInterfacePriority(popr, true) - dAtA := github_com_gogo_protobuf_proto.MarshalTextString(p) - msg := &LinuxInterfacePriority{} - if err := github_com_gogo_protobuf_proto.UnmarshalText(dAtA, msg); err != nil { - t.Fatalf("seed = %d, err = %v", seed, err) - } - if !p.Equal(msg) { - t.Fatalf("seed = %d, %#v !Proto %#v", seed, msg, p) - } -} - -func TestLinuxInterfacePriorityProtoCompactText(t *testing.T) { - seed := time.Now().UnixNano() - popr := math_rand.New(math_rand.NewSource(seed)) - p := NewPopulatedLinuxInterfacePriority(popr, true) - dAtA := github_com_gogo_protobuf_proto.CompactTextString(p) - msg := &LinuxInterfacePriority{} - if err := github_com_gogo_protobuf_proto.UnmarshalText(dAtA, msg); err != nil { - t.Fatalf("seed = %d, err = %v", seed, err) - } - if !p.Equal(msg) { - t.Fatalf("seed = %d, %#v !Proto %#v", seed, msg, p) - } -} - -func TestLinuxSeccompProtoText(t *testing.T) { - seed := time.Now().UnixNano() - popr := math_rand.New(math_rand.NewSource(seed)) - p := NewPopulatedLinuxSeccomp(popr, true) - dAtA := github_com_gogo_protobuf_proto.MarshalTextString(p) - msg := &LinuxSeccomp{} - if err := github_com_gogo_protobuf_proto.UnmarshalText(dAtA, msg); err != nil { - t.Fatalf("seed = %d, err = %v", seed, err) - } - if !p.Equal(msg) { - t.Fatalf("seed = %d, %#v !Proto %#v", seed, msg, p) - } -} - -func TestLinuxSeccompProtoCompactText(t *testing.T) { - seed := time.Now().UnixNano() - popr := math_rand.New(math_rand.NewSource(seed)) - p := NewPopulatedLinuxSeccomp(popr, true) - dAtA := github_com_gogo_protobuf_proto.CompactTextString(p) - msg := &LinuxSeccomp{} - if err := github_com_gogo_protobuf_proto.UnmarshalText(dAtA, msg); err != nil { - t.Fatalf("seed = %d, err = %v", seed, err) - } - if !p.Equal(msg) { - t.Fatalf("seed = %d, %#v !Proto %#v", seed, msg, p) - } -} - -func TestLinuxSeccompArgProtoText(t *testing.T) { - seed := time.Now().UnixNano() - popr := math_rand.New(math_rand.NewSource(seed)) - p := NewPopulatedLinuxSeccompArg(popr, true) - dAtA := github_com_gogo_protobuf_proto.MarshalTextString(p) - msg := &LinuxSeccompArg{} - if err := github_com_gogo_protobuf_proto.UnmarshalText(dAtA, msg); err != nil { - t.Fatalf("seed = %d, err = %v", seed, err) - } - if !p.Equal(msg) { - t.Fatalf("seed = %d, %#v !Proto %#v", seed, msg, p) - } -} - -func TestLinuxSeccompArgProtoCompactText(t *testing.T) { - seed := time.Now().UnixNano() - popr := math_rand.New(math_rand.NewSource(seed)) - p := NewPopulatedLinuxSeccompArg(popr, true) - dAtA := github_com_gogo_protobuf_proto.CompactTextString(p) - msg := &LinuxSeccompArg{} - if err := github_com_gogo_protobuf_proto.UnmarshalText(dAtA, msg); err != nil { - t.Fatalf("seed = %d, err = %v", seed, err) - } - if !p.Equal(msg) { - t.Fatalf("seed = %d, %#v !Proto %#v", seed, msg, p) - } -} - -func TestLinuxSyscallProtoText(t *testing.T) { - seed := time.Now().UnixNano() - popr := math_rand.New(math_rand.NewSource(seed)) - p := NewPopulatedLinuxSyscall(popr, true) - dAtA := github_com_gogo_protobuf_proto.MarshalTextString(p) - msg := &LinuxSyscall{} - if err := github_com_gogo_protobuf_proto.UnmarshalText(dAtA, msg); err != nil { - t.Fatalf("seed = %d, err = %v", seed, err) - } - if !p.Equal(msg) { - t.Fatalf("seed = %d, %#v !Proto %#v", seed, msg, p) - } -} - -func TestLinuxSyscallProtoCompactText(t *testing.T) { - seed := time.Now().UnixNano() - popr := math_rand.New(math_rand.NewSource(seed)) - p := NewPopulatedLinuxSyscall(popr, true) - dAtA := github_com_gogo_protobuf_proto.CompactTextString(p) - msg := &LinuxSyscall{} - if err := github_com_gogo_protobuf_proto.UnmarshalText(dAtA, msg); err != nil { - t.Fatalf("seed = %d, err = %v", seed, err) - } - if !p.Equal(msg) { - t.Fatalf("seed = %d, %#v !Proto %#v", seed, msg, p) - } -} - -func TestLinuxIntelRdtProtoText(t *testing.T) { - seed := time.Now().UnixNano() - popr := math_rand.New(math_rand.NewSource(seed)) - p := NewPopulatedLinuxIntelRdt(popr, true) - dAtA := github_com_gogo_protobuf_proto.MarshalTextString(p) - msg := &LinuxIntelRdt{} - if err := github_com_gogo_protobuf_proto.UnmarshalText(dAtA, msg); err != nil { - t.Fatalf("seed = %d, err = %v", seed, err) - } - if !p.Equal(msg) { - t.Fatalf("seed = %d, %#v !Proto %#v", seed, msg, p) - } -} - -func TestLinuxIntelRdtProtoCompactText(t *testing.T) { - seed := time.Now().UnixNano() - popr := math_rand.New(math_rand.NewSource(seed)) - p := NewPopulatedLinuxIntelRdt(popr, true) - dAtA := github_com_gogo_protobuf_proto.CompactTextString(p) - msg := &LinuxIntelRdt{} - if err := github_com_gogo_protobuf_proto.UnmarshalText(dAtA, msg); err != nil { - t.Fatalf("seed = %d, err = %v", seed, err) - } - if !p.Equal(msg) { - t.Fatalf("seed = %d, %#v !Proto %#v", seed, msg, p) - } -} - -func TestSpecSize(t *testing.T) { - seed := time.Now().UnixNano() - popr := math_rand.New(math_rand.NewSource(seed)) - p := NewPopulatedSpec(popr, true) - size2 := github_com_gogo_protobuf_proto.Size(p) - dAtA, err := github_com_gogo_protobuf_proto.Marshal(p) - if err != nil { - t.Fatalf("seed = %d, err = %v", seed, err) - } - size := p.Size() - if len(dAtA) != size { - t.Errorf("seed = %d, size %v != marshalled size %v", seed, size, len(dAtA)) - } - if size2 != size { - t.Errorf("seed = %d, size %v != before marshal proto.Size %v", seed, size, size2) - } - size3 := github_com_gogo_protobuf_proto.Size(p) - if size3 != size { - t.Errorf("seed = %d, size %v != after marshal proto.Size %v", seed, size, size3) - } -} - -func BenchmarkSpecSize(b *testing.B) { - popr := math_rand.New(math_rand.NewSource(616)) - total := 0 - pops := make([]*Spec, 1000) - for i := 0; i < 1000; i++ { - pops[i] = NewPopulatedSpec(popr, false) - } - b.ResetTimer() - for i := 0; i < b.N; i++ { - total += pops[i%1000].Size() - } - b.SetBytes(int64(total / b.N)) -} - -func TestProcessSize(t *testing.T) { - seed := time.Now().UnixNano() - popr := math_rand.New(math_rand.NewSource(seed)) - p := NewPopulatedProcess(popr, true) - size2 := github_com_gogo_protobuf_proto.Size(p) - dAtA, err := github_com_gogo_protobuf_proto.Marshal(p) - if err != nil { - t.Fatalf("seed = %d, err = %v", seed, err) - } - size := p.Size() - if len(dAtA) != size { - t.Errorf("seed = %d, size %v != marshalled size %v", seed, size, len(dAtA)) - } - if size2 != size { - t.Errorf("seed = %d, size %v != before marshal proto.Size %v", seed, size, size2) - } - size3 := github_com_gogo_protobuf_proto.Size(p) - if size3 != size { - t.Errorf("seed = %d, size %v != after marshal proto.Size %v", seed, size, size3) - } -} - -func BenchmarkProcessSize(b *testing.B) { - popr := math_rand.New(math_rand.NewSource(616)) - total := 0 - pops := make([]*Process, 1000) - for i := 0; i < 1000; i++ { - pops[i] = NewPopulatedProcess(popr, false) - } - b.ResetTimer() - for i := 0; i < b.N; i++ { - total += pops[i%1000].Size() - } - b.SetBytes(int64(total / b.N)) -} - -func TestBoxSize(t *testing.T) { - seed := time.Now().UnixNano() - popr := math_rand.New(math_rand.NewSource(seed)) - p := NewPopulatedBox(popr, true) - size2 := github_com_gogo_protobuf_proto.Size(p) - dAtA, err := github_com_gogo_protobuf_proto.Marshal(p) - if err != nil { - t.Fatalf("seed = %d, err = %v", seed, err) - } - size := p.Size() - if len(dAtA) != size { - t.Errorf("seed = %d, size %v != marshalled size %v", seed, size, len(dAtA)) - } - if size2 != size { - t.Errorf("seed = %d, size %v != before marshal proto.Size %v", seed, size, size2) - } - size3 := github_com_gogo_protobuf_proto.Size(p) - if size3 != size { - t.Errorf("seed = %d, size %v != after marshal proto.Size %v", seed, size, size3) - } -} - -func BenchmarkBoxSize(b *testing.B) { - popr := math_rand.New(math_rand.NewSource(616)) - total := 0 - pops := make([]*Box, 1000) - for i := 0; i < 1000; i++ { - pops[i] = NewPopulatedBox(popr, false) - } - b.ResetTimer() - for i := 0; i < b.N; i++ { - total += pops[i%1000].Size() - } - b.SetBytes(int64(total / b.N)) -} - -func TestUserSize(t *testing.T) { - seed := time.Now().UnixNano() - popr := math_rand.New(math_rand.NewSource(seed)) - p := NewPopulatedUser(popr, true) - size2 := github_com_gogo_protobuf_proto.Size(p) - dAtA, err := github_com_gogo_protobuf_proto.Marshal(p) - if err != nil { - t.Fatalf("seed = %d, err = %v", seed, err) - } - size := p.Size() - if len(dAtA) != size { - t.Errorf("seed = %d, size %v != marshalled size %v", seed, size, len(dAtA)) - } - if size2 != size { - t.Errorf("seed = %d, size %v != before marshal proto.Size %v", seed, size, size2) - } - size3 := github_com_gogo_protobuf_proto.Size(p) - if size3 != size { - t.Errorf("seed = %d, size %v != after marshal proto.Size %v", seed, size, size3) - } -} - -func BenchmarkUserSize(b *testing.B) { - popr := math_rand.New(math_rand.NewSource(616)) - total := 0 - pops := make([]*User, 1000) - for i := 0; i < 1000; i++ { - pops[i] = NewPopulatedUser(popr, false) - } - b.ResetTimer() - for i := 0; i < b.N; i++ { - total += pops[i%1000].Size() - } - b.SetBytes(int64(total / b.N)) -} - -func TestLinuxCapabilitiesSize(t *testing.T) { - seed := time.Now().UnixNano() - popr := math_rand.New(math_rand.NewSource(seed)) - p := NewPopulatedLinuxCapabilities(popr, true) - size2 := github_com_gogo_protobuf_proto.Size(p) - dAtA, err := github_com_gogo_protobuf_proto.Marshal(p) - if err != nil { - t.Fatalf("seed = %d, err = %v", seed, err) - } - size := p.Size() - if len(dAtA) != size { - t.Errorf("seed = %d, size %v != marshalled size %v", seed, size, len(dAtA)) - } - if size2 != size { - t.Errorf("seed = %d, size %v != before marshal proto.Size %v", seed, size, size2) - } - size3 := github_com_gogo_protobuf_proto.Size(p) - if size3 != size { - t.Errorf("seed = %d, size %v != after marshal proto.Size %v", seed, size, size3) - } -} - -func BenchmarkLinuxCapabilitiesSize(b *testing.B) { - popr := math_rand.New(math_rand.NewSource(616)) - total := 0 - pops := make([]*LinuxCapabilities, 1000) - for i := 0; i < 1000; i++ { - pops[i] = NewPopulatedLinuxCapabilities(popr, false) - } - b.ResetTimer() - for i := 0; i < b.N; i++ { - total += pops[i%1000].Size() - } - b.SetBytes(int64(total / b.N)) -} - -func TestPOSIXRlimitSize(t *testing.T) { - seed := time.Now().UnixNano() - popr := math_rand.New(math_rand.NewSource(seed)) - p := NewPopulatedPOSIXRlimit(popr, true) - size2 := github_com_gogo_protobuf_proto.Size(p) - dAtA, err := github_com_gogo_protobuf_proto.Marshal(p) - if err != nil { - t.Fatalf("seed = %d, err = %v", seed, err) - } - size := p.Size() - if len(dAtA) != size { - t.Errorf("seed = %d, size %v != marshalled size %v", seed, size, len(dAtA)) - } - if size2 != size { - t.Errorf("seed = %d, size %v != before marshal proto.Size %v", seed, size, size2) - } - size3 := github_com_gogo_protobuf_proto.Size(p) - if size3 != size { - t.Errorf("seed = %d, size %v != after marshal proto.Size %v", seed, size, size3) - } -} - -func BenchmarkPOSIXRlimitSize(b *testing.B) { - popr := math_rand.New(math_rand.NewSource(616)) - total := 0 - pops := make([]*POSIXRlimit, 1000) - for i := 0; i < 1000; i++ { - pops[i] = NewPopulatedPOSIXRlimit(popr, false) - } - b.ResetTimer() - for i := 0; i < b.N; i++ { - total += pops[i%1000].Size() - } - b.SetBytes(int64(total / b.N)) -} - -func TestMountSize(t *testing.T) { - seed := time.Now().UnixNano() - popr := math_rand.New(math_rand.NewSource(seed)) - p := NewPopulatedMount(popr, true) - size2 := github_com_gogo_protobuf_proto.Size(p) - dAtA, err := github_com_gogo_protobuf_proto.Marshal(p) - if err != nil { - t.Fatalf("seed = %d, err = %v", seed, err) - } - size := p.Size() - if len(dAtA) != size { - t.Errorf("seed = %d, size %v != marshalled size %v", seed, size, len(dAtA)) - } - if size2 != size { - t.Errorf("seed = %d, size %v != before marshal proto.Size %v", seed, size, size2) - } - size3 := github_com_gogo_protobuf_proto.Size(p) - if size3 != size { - t.Errorf("seed = %d, size %v != after marshal proto.Size %v", seed, size, size3) - } -} - -func BenchmarkMountSize(b *testing.B) { - popr := math_rand.New(math_rand.NewSource(616)) - total := 0 - pops := make([]*Mount, 1000) - for i := 0; i < 1000; i++ { - pops[i] = NewPopulatedMount(popr, false) - } - b.ResetTimer() - for i := 0; i < b.N; i++ { - total += pops[i%1000].Size() - } - b.SetBytes(int64(total / b.N)) -} - -func TestRootSize(t *testing.T) { - seed := time.Now().UnixNano() - popr := math_rand.New(math_rand.NewSource(seed)) - p := NewPopulatedRoot(popr, true) - size2 := github_com_gogo_protobuf_proto.Size(p) - dAtA, err := github_com_gogo_protobuf_proto.Marshal(p) - if err != nil { - t.Fatalf("seed = %d, err = %v", seed, err) - } - size := p.Size() - if len(dAtA) != size { - t.Errorf("seed = %d, size %v != marshalled size %v", seed, size, len(dAtA)) - } - if size2 != size { - t.Errorf("seed = %d, size %v != before marshal proto.Size %v", seed, size, size2) - } - size3 := github_com_gogo_protobuf_proto.Size(p) - if size3 != size { - t.Errorf("seed = %d, size %v != after marshal proto.Size %v", seed, size, size3) - } -} - -func BenchmarkRootSize(b *testing.B) { - popr := math_rand.New(math_rand.NewSource(616)) - total := 0 - pops := make([]*Root, 1000) - for i := 0; i < 1000; i++ { - pops[i] = NewPopulatedRoot(popr, false) - } - b.ResetTimer() - for i := 0; i < b.N; i++ { - total += pops[i%1000].Size() - } - b.SetBytes(int64(total / b.N)) -} - -func TestHooksSize(t *testing.T) { - seed := time.Now().UnixNano() - popr := math_rand.New(math_rand.NewSource(seed)) - p := NewPopulatedHooks(popr, true) - size2 := github_com_gogo_protobuf_proto.Size(p) - dAtA, err := github_com_gogo_protobuf_proto.Marshal(p) - if err != nil { - t.Fatalf("seed = %d, err = %v", seed, err) - } - size := p.Size() - if len(dAtA) != size { - t.Errorf("seed = %d, size %v != marshalled size %v", seed, size, len(dAtA)) - } - if size2 != size { - t.Errorf("seed = %d, size %v != before marshal proto.Size %v", seed, size, size2) - } - size3 := github_com_gogo_protobuf_proto.Size(p) - if size3 != size { - t.Errorf("seed = %d, size %v != after marshal proto.Size %v", seed, size, size3) - } -} - -func BenchmarkHooksSize(b *testing.B) { - popr := math_rand.New(math_rand.NewSource(616)) - total := 0 - pops := make([]*Hooks, 1000) - for i := 0; i < 1000; i++ { - pops[i] = NewPopulatedHooks(popr, false) - } - b.ResetTimer() - for i := 0; i < b.N; i++ { - total += pops[i%1000].Size() - } - b.SetBytes(int64(total / b.N)) -} - -func TestHookSize(t *testing.T) { - seed := time.Now().UnixNano() - popr := math_rand.New(math_rand.NewSource(seed)) - p := NewPopulatedHook(popr, true) - size2 := github_com_gogo_protobuf_proto.Size(p) - dAtA, err := github_com_gogo_protobuf_proto.Marshal(p) - if err != nil { - t.Fatalf("seed = %d, err = %v", seed, err) - } - size := p.Size() - if len(dAtA) != size { - t.Errorf("seed = %d, size %v != marshalled size %v", seed, size, len(dAtA)) - } - if size2 != size { - t.Errorf("seed = %d, size %v != before marshal proto.Size %v", seed, size, size2) - } - size3 := github_com_gogo_protobuf_proto.Size(p) - if size3 != size { - t.Errorf("seed = %d, size %v != after marshal proto.Size %v", seed, size, size3) - } -} - -func BenchmarkHookSize(b *testing.B) { - popr := math_rand.New(math_rand.NewSource(616)) - total := 0 - pops := make([]*Hook, 1000) - for i := 0; i < 1000; i++ { - pops[i] = NewPopulatedHook(popr, false) - } - b.ResetTimer() - for i := 0; i < b.N; i++ { - total += pops[i%1000].Size() - } - b.SetBytes(int64(total / b.N)) -} - -func TestLinuxSize(t *testing.T) { - seed := time.Now().UnixNano() - popr := math_rand.New(math_rand.NewSource(seed)) - p := NewPopulatedLinux(popr, true) - size2 := github_com_gogo_protobuf_proto.Size(p) - dAtA, err := github_com_gogo_protobuf_proto.Marshal(p) - if err != nil { - t.Fatalf("seed = %d, err = %v", seed, err) - } - size := p.Size() - if len(dAtA) != size { - t.Errorf("seed = %d, size %v != marshalled size %v", seed, size, len(dAtA)) - } - if size2 != size { - t.Errorf("seed = %d, size %v != before marshal proto.Size %v", seed, size, size2) - } - size3 := github_com_gogo_protobuf_proto.Size(p) - if size3 != size { - t.Errorf("seed = %d, size %v != after marshal proto.Size %v", seed, size, size3) - } -} - -func BenchmarkLinuxSize(b *testing.B) { - popr := math_rand.New(math_rand.NewSource(616)) - total := 0 - pops := make([]*Linux, 1000) - for i := 0; i < 1000; i++ { - pops[i] = NewPopulatedLinux(popr, false) - } - b.ResetTimer() - for i := 0; i < b.N; i++ { - total += pops[i%1000].Size() - } - b.SetBytes(int64(total / b.N)) -} - -func TestWindowsSize(t *testing.T) { - seed := time.Now().UnixNano() - popr := math_rand.New(math_rand.NewSource(seed)) - p := NewPopulatedWindows(popr, true) - size2 := github_com_gogo_protobuf_proto.Size(p) - dAtA, err := github_com_gogo_protobuf_proto.Marshal(p) - if err != nil { - t.Fatalf("seed = %d, err = %v", seed, err) - } - size := p.Size() - if len(dAtA) != size { - t.Errorf("seed = %d, size %v != marshalled size %v", seed, size, len(dAtA)) - } - if size2 != size { - t.Errorf("seed = %d, size %v != before marshal proto.Size %v", seed, size, size2) - } - size3 := github_com_gogo_protobuf_proto.Size(p) - if size3 != size { - t.Errorf("seed = %d, size %v != after marshal proto.Size %v", seed, size, size3) - } -} - -func BenchmarkWindowsSize(b *testing.B) { - popr := math_rand.New(math_rand.NewSource(616)) - total := 0 - pops := make([]*Windows, 1000) - for i := 0; i < 1000; i++ { - pops[i] = NewPopulatedWindows(popr, false) - } - b.ResetTimer() - for i := 0; i < b.N; i++ { - total += pops[i%1000].Size() - } - b.SetBytes(int64(total / b.N)) -} - -func TestSolarisSize(t *testing.T) { - seed := time.Now().UnixNano() - popr := math_rand.New(math_rand.NewSource(seed)) - p := NewPopulatedSolaris(popr, true) - size2 := github_com_gogo_protobuf_proto.Size(p) - dAtA, err := github_com_gogo_protobuf_proto.Marshal(p) - if err != nil { - t.Fatalf("seed = %d, err = %v", seed, err) - } - size := p.Size() - if len(dAtA) != size { - t.Errorf("seed = %d, size %v != marshalled size %v", seed, size, len(dAtA)) - } - if size2 != size { - t.Errorf("seed = %d, size %v != before marshal proto.Size %v", seed, size, size2) - } - size3 := github_com_gogo_protobuf_proto.Size(p) - if size3 != size { - t.Errorf("seed = %d, size %v != after marshal proto.Size %v", seed, size, size3) - } -} - -func BenchmarkSolarisSize(b *testing.B) { - popr := math_rand.New(math_rand.NewSource(616)) - total := 0 - pops := make([]*Solaris, 1000) - for i := 0; i < 1000; i++ { - pops[i] = NewPopulatedSolaris(popr, false) - } - b.ResetTimer() - for i := 0; i < b.N; i++ { - total += pops[i%1000].Size() - } - b.SetBytes(int64(total / b.N)) -} - -func TestLinuxIDMappingSize(t *testing.T) { - seed := time.Now().UnixNano() - popr := math_rand.New(math_rand.NewSource(seed)) - p := NewPopulatedLinuxIDMapping(popr, true) - size2 := github_com_gogo_protobuf_proto.Size(p) - dAtA, err := github_com_gogo_protobuf_proto.Marshal(p) - if err != nil { - t.Fatalf("seed = %d, err = %v", seed, err) - } - size := p.Size() - if len(dAtA) != size { - t.Errorf("seed = %d, size %v != marshalled size %v", seed, size, len(dAtA)) - } - if size2 != size { - t.Errorf("seed = %d, size %v != before marshal proto.Size %v", seed, size, size2) - } - size3 := github_com_gogo_protobuf_proto.Size(p) - if size3 != size { - t.Errorf("seed = %d, size %v != after marshal proto.Size %v", seed, size, size3) - } -} - -func BenchmarkLinuxIDMappingSize(b *testing.B) { - popr := math_rand.New(math_rand.NewSource(616)) - total := 0 - pops := make([]*LinuxIDMapping, 1000) - for i := 0; i < 1000; i++ { - pops[i] = NewPopulatedLinuxIDMapping(popr, false) - } - b.ResetTimer() - for i := 0; i < b.N; i++ { - total += pops[i%1000].Size() - } - b.SetBytes(int64(total / b.N)) -} - -func TestLinuxNamespaceSize(t *testing.T) { - seed := time.Now().UnixNano() - popr := math_rand.New(math_rand.NewSource(seed)) - p := NewPopulatedLinuxNamespace(popr, true) - size2 := github_com_gogo_protobuf_proto.Size(p) - dAtA, err := github_com_gogo_protobuf_proto.Marshal(p) - if err != nil { - t.Fatalf("seed = %d, err = %v", seed, err) - } - size := p.Size() - if len(dAtA) != size { - t.Errorf("seed = %d, size %v != marshalled size %v", seed, size, len(dAtA)) - } - if size2 != size { - t.Errorf("seed = %d, size %v != before marshal proto.Size %v", seed, size, size2) - } - size3 := github_com_gogo_protobuf_proto.Size(p) - if size3 != size { - t.Errorf("seed = %d, size %v != after marshal proto.Size %v", seed, size, size3) - } -} - -func BenchmarkLinuxNamespaceSize(b *testing.B) { - popr := math_rand.New(math_rand.NewSource(616)) - total := 0 - pops := make([]*LinuxNamespace, 1000) - for i := 0; i < 1000; i++ { - pops[i] = NewPopulatedLinuxNamespace(popr, false) - } - b.ResetTimer() - for i := 0; i < b.N; i++ { - total += pops[i%1000].Size() - } - b.SetBytes(int64(total / b.N)) -} - -func TestLinuxDeviceSize(t *testing.T) { - seed := time.Now().UnixNano() - popr := math_rand.New(math_rand.NewSource(seed)) - p := NewPopulatedLinuxDevice(popr, true) - size2 := github_com_gogo_protobuf_proto.Size(p) - dAtA, err := github_com_gogo_protobuf_proto.Marshal(p) - if err != nil { - t.Fatalf("seed = %d, err = %v", seed, err) - } - size := p.Size() - if len(dAtA) != size { - t.Errorf("seed = %d, size %v != marshalled size %v", seed, size, len(dAtA)) - } - if size2 != size { - t.Errorf("seed = %d, size %v != before marshal proto.Size %v", seed, size, size2) - } - size3 := github_com_gogo_protobuf_proto.Size(p) - if size3 != size { - t.Errorf("seed = %d, size %v != after marshal proto.Size %v", seed, size, size3) - } -} - -func BenchmarkLinuxDeviceSize(b *testing.B) { - popr := math_rand.New(math_rand.NewSource(616)) - total := 0 - pops := make([]*LinuxDevice, 1000) - for i := 0; i < 1000; i++ { - pops[i] = NewPopulatedLinuxDevice(popr, false) - } - b.ResetTimer() - for i := 0; i < b.N; i++ { - total += pops[i%1000].Size() - } - b.SetBytes(int64(total / b.N)) -} - -func TestLinuxResourcesSize(t *testing.T) { - seed := time.Now().UnixNano() - popr := math_rand.New(math_rand.NewSource(seed)) - p := NewPopulatedLinuxResources(popr, true) - size2 := github_com_gogo_protobuf_proto.Size(p) - dAtA, err := github_com_gogo_protobuf_proto.Marshal(p) - if err != nil { - t.Fatalf("seed = %d, err = %v", seed, err) - } - size := p.Size() - if len(dAtA) != size { - t.Errorf("seed = %d, size %v != marshalled size %v", seed, size, len(dAtA)) - } - if size2 != size { - t.Errorf("seed = %d, size %v != before marshal proto.Size %v", seed, size, size2) - } - size3 := github_com_gogo_protobuf_proto.Size(p) - if size3 != size { - t.Errorf("seed = %d, size %v != after marshal proto.Size %v", seed, size, size3) - } -} - -func BenchmarkLinuxResourcesSize(b *testing.B) { - popr := math_rand.New(math_rand.NewSource(616)) - total := 0 - pops := make([]*LinuxResources, 1000) - for i := 0; i < 1000; i++ { - pops[i] = NewPopulatedLinuxResources(popr, false) - } - b.ResetTimer() - for i := 0; i < b.N; i++ { - total += pops[i%1000].Size() - } - b.SetBytes(int64(total / b.N)) -} - -func TestLinuxMemorySize(t *testing.T) { - seed := time.Now().UnixNano() - popr := math_rand.New(math_rand.NewSource(seed)) - p := NewPopulatedLinuxMemory(popr, true) - size2 := github_com_gogo_protobuf_proto.Size(p) - dAtA, err := github_com_gogo_protobuf_proto.Marshal(p) - if err != nil { - t.Fatalf("seed = %d, err = %v", seed, err) - } - size := p.Size() - if len(dAtA) != size { - t.Errorf("seed = %d, size %v != marshalled size %v", seed, size, len(dAtA)) - } - if size2 != size { - t.Errorf("seed = %d, size %v != before marshal proto.Size %v", seed, size, size2) - } - size3 := github_com_gogo_protobuf_proto.Size(p) - if size3 != size { - t.Errorf("seed = %d, size %v != after marshal proto.Size %v", seed, size, size3) - } -} - -func BenchmarkLinuxMemorySize(b *testing.B) { - popr := math_rand.New(math_rand.NewSource(616)) - total := 0 - pops := make([]*LinuxMemory, 1000) - for i := 0; i < 1000; i++ { - pops[i] = NewPopulatedLinuxMemory(popr, false) - } - b.ResetTimer() - for i := 0; i < b.N; i++ { - total += pops[i%1000].Size() - } - b.SetBytes(int64(total / b.N)) -} - -func TestLinuxCPUSize(t *testing.T) { - seed := time.Now().UnixNano() - popr := math_rand.New(math_rand.NewSource(seed)) - p := NewPopulatedLinuxCPU(popr, true) - size2 := github_com_gogo_protobuf_proto.Size(p) - dAtA, err := github_com_gogo_protobuf_proto.Marshal(p) - if err != nil { - t.Fatalf("seed = %d, err = %v", seed, err) - } - size := p.Size() - if len(dAtA) != size { - t.Errorf("seed = %d, size %v != marshalled size %v", seed, size, len(dAtA)) - } - if size2 != size { - t.Errorf("seed = %d, size %v != before marshal proto.Size %v", seed, size, size2) - } - size3 := github_com_gogo_protobuf_proto.Size(p) - if size3 != size { - t.Errorf("seed = %d, size %v != after marshal proto.Size %v", seed, size, size3) - } -} - -func BenchmarkLinuxCPUSize(b *testing.B) { - popr := math_rand.New(math_rand.NewSource(616)) - total := 0 - pops := make([]*LinuxCPU, 1000) - for i := 0; i < 1000; i++ { - pops[i] = NewPopulatedLinuxCPU(popr, false) - } - b.ResetTimer() - for i := 0; i < b.N; i++ { - total += pops[i%1000].Size() - } - b.SetBytes(int64(total / b.N)) -} - -func TestLinuxWeightDeviceSize(t *testing.T) { - seed := time.Now().UnixNano() - popr := math_rand.New(math_rand.NewSource(seed)) - p := NewPopulatedLinuxWeightDevice(popr, true) - size2 := github_com_gogo_protobuf_proto.Size(p) - dAtA, err := github_com_gogo_protobuf_proto.Marshal(p) - if err != nil { - t.Fatalf("seed = %d, err = %v", seed, err) - } - size := p.Size() - if len(dAtA) != size { - t.Errorf("seed = %d, size %v != marshalled size %v", seed, size, len(dAtA)) - } - if size2 != size { - t.Errorf("seed = %d, size %v != before marshal proto.Size %v", seed, size, size2) - } - size3 := github_com_gogo_protobuf_proto.Size(p) - if size3 != size { - t.Errorf("seed = %d, size %v != after marshal proto.Size %v", seed, size, size3) - } -} - -func BenchmarkLinuxWeightDeviceSize(b *testing.B) { - popr := math_rand.New(math_rand.NewSource(616)) - total := 0 - pops := make([]*LinuxWeightDevice, 1000) - for i := 0; i < 1000; i++ { - pops[i] = NewPopulatedLinuxWeightDevice(popr, false) - } - b.ResetTimer() - for i := 0; i < b.N; i++ { - total += pops[i%1000].Size() - } - b.SetBytes(int64(total / b.N)) -} - -func TestLinuxThrottleDeviceSize(t *testing.T) { - seed := time.Now().UnixNano() - popr := math_rand.New(math_rand.NewSource(seed)) - p := NewPopulatedLinuxThrottleDevice(popr, true) - size2 := github_com_gogo_protobuf_proto.Size(p) - dAtA, err := github_com_gogo_protobuf_proto.Marshal(p) - if err != nil { - t.Fatalf("seed = %d, err = %v", seed, err) - } - size := p.Size() - if len(dAtA) != size { - t.Errorf("seed = %d, size %v != marshalled size %v", seed, size, len(dAtA)) - } - if size2 != size { - t.Errorf("seed = %d, size %v != before marshal proto.Size %v", seed, size, size2) - } - size3 := github_com_gogo_protobuf_proto.Size(p) - if size3 != size { - t.Errorf("seed = %d, size %v != after marshal proto.Size %v", seed, size, size3) - } -} - -func BenchmarkLinuxThrottleDeviceSize(b *testing.B) { - popr := math_rand.New(math_rand.NewSource(616)) - total := 0 - pops := make([]*LinuxThrottleDevice, 1000) - for i := 0; i < 1000; i++ { - pops[i] = NewPopulatedLinuxThrottleDevice(popr, false) - } - b.ResetTimer() - for i := 0; i < b.N; i++ { - total += pops[i%1000].Size() - } - b.SetBytes(int64(total / b.N)) -} - -func TestLinuxBlockIOSize(t *testing.T) { - seed := time.Now().UnixNano() - popr := math_rand.New(math_rand.NewSource(seed)) - p := NewPopulatedLinuxBlockIO(popr, true) - size2 := github_com_gogo_protobuf_proto.Size(p) - dAtA, err := github_com_gogo_protobuf_proto.Marshal(p) - if err != nil { - t.Fatalf("seed = %d, err = %v", seed, err) - } - size := p.Size() - if len(dAtA) != size { - t.Errorf("seed = %d, size %v != marshalled size %v", seed, size, len(dAtA)) - } - if size2 != size { - t.Errorf("seed = %d, size %v != before marshal proto.Size %v", seed, size, size2) - } - size3 := github_com_gogo_protobuf_proto.Size(p) - if size3 != size { - t.Errorf("seed = %d, size %v != after marshal proto.Size %v", seed, size, size3) - } -} - -func BenchmarkLinuxBlockIOSize(b *testing.B) { - popr := math_rand.New(math_rand.NewSource(616)) - total := 0 - pops := make([]*LinuxBlockIO, 1000) - for i := 0; i < 1000; i++ { - pops[i] = NewPopulatedLinuxBlockIO(popr, false) - } - b.ResetTimer() - for i := 0; i < b.N; i++ { - total += pops[i%1000].Size() - } - b.SetBytes(int64(total / b.N)) -} - -func TestLinuxPidsSize(t *testing.T) { - seed := time.Now().UnixNano() - popr := math_rand.New(math_rand.NewSource(seed)) - p := NewPopulatedLinuxPids(popr, true) - size2 := github_com_gogo_protobuf_proto.Size(p) - dAtA, err := github_com_gogo_protobuf_proto.Marshal(p) - if err != nil { - t.Fatalf("seed = %d, err = %v", seed, err) - } - size := p.Size() - if len(dAtA) != size { - t.Errorf("seed = %d, size %v != marshalled size %v", seed, size, len(dAtA)) - } - if size2 != size { - t.Errorf("seed = %d, size %v != before marshal proto.Size %v", seed, size, size2) - } - size3 := github_com_gogo_protobuf_proto.Size(p) - if size3 != size { - t.Errorf("seed = %d, size %v != after marshal proto.Size %v", seed, size, size3) - } -} - -func BenchmarkLinuxPidsSize(b *testing.B) { - popr := math_rand.New(math_rand.NewSource(616)) - total := 0 - pops := make([]*LinuxPids, 1000) - for i := 0; i < 1000; i++ { - pops[i] = NewPopulatedLinuxPids(popr, false) - } - b.ResetTimer() - for i := 0; i < b.N; i++ { - total += pops[i%1000].Size() - } - b.SetBytes(int64(total / b.N)) -} - -func TestLinuxDeviceCgroupSize(t *testing.T) { - seed := time.Now().UnixNano() - popr := math_rand.New(math_rand.NewSource(seed)) - p := NewPopulatedLinuxDeviceCgroup(popr, true) - size2 := github_com_gogo_protobuf_proto.Size(p) - dAtA, err := github_com_gogo_protobuf_proto.Marshal(p) - if err != nil { - t.Fatalf("seed = %d, err = %v", seed, err) - } - size := p.Size() - if len(dAtA) != size { - t.Errorf("seed = %d, size %v != marshalled size %v", seed, size, len(dAtA)) - } - if size2 != size { - t.Errorf("seed = %d, size %v != before marshal proto.Size %v", seed, size, size2) - } - size3 := github_com_gogo_protobuf_proto.Size(p) - if size3 != size { - t.Errorf("seed = %d, size %v != after marshal proto.Size %v", seed, size, size3) - } -} - -func BenchmarkLinuxDeviceCgroupSize(b *testing.B) { - popr := math_rand.New(math_rand.NewSource(616)) - total := 0 - pops := make([]*LinuxDeviceCgroup, 1000) - for i := 0; i < 1000; i++ { - pops[i] = NewPopulatedLinuxDeviceCgroup(popr, false) - } - b.ResetTimer() - for i := 0; i < b.N; i++ { - total += pops[i%1000].Size() - } - b.SetBytes(int64(total / b.N)) -} - -func TestLinuxNetworkSize(t *testing.T) { - seed := time.Now().UnixNano() - popr := math_rand.New(math_rand.NewSource(seed)) - p := NewPopulatedLinuxNetwork(popr, true) - size2 := github_com_gogo_protobuf_proto.Size(p) - dAtA, err := github_com_gogo_protobuf_proto.Marshal(p) - if err != nil { - t.Fatalf("seed = %d, err = %v", seed, err) - } - size := p.Size() - if len(dAtA) != size { - t.Errorf("seed = %d, size %v != marshalled size %v", seed, size, len(dAtA)) - } - if size2 != size { - t.Errorf("seed = %d, size %v != before marshal proto.Size %v", seed, size, size2) - } - size3 := github_com_gogo_protobuf_proto.Size(p) - if size3 != size { - t.Errorf("seed = %d, size %v != after marshal proto.Size %v", seed, size, size3) - } -} - -func BenchmarkLinuxNetworkSize(b *testing.B) { - popr := math_rand.New(math_rand.NewSource(616)) - total := 0 - pops := make([]*LinuxNetwork, 1000) - for i := 0; i < 1000; i++ { - pops[i] = NewPopulatedLinuxNetwork(popr, false) - } - b.ResetTimer() - for i := 0; i < b.N; i++ { - total += pops[i%1000].Size() - } - b.SetBytes(int64(total / b.N)) -} - -func TestLinuxHugepageLimitSize(t *testing.T) { - seed := time.Now().UnixNano() - popr := math_rand.New(math_rand.NewSource(seed)) - p := NewPopulatedLinuxHugepageLimit(popr, true) - size2 := github_com_gogo_protobuf_proto.Size(p) - dAtA, err := github_com_gogo_protobuf_proto.Marshal(p) - if err != nil { - t.Fatalf("seed = %d, err = %v", seed, err) - } - size := p.Size() - if len(dAtA) != size { - t.Errorf("seed = %d, size %v != marshalled size %v", seed, size, len(dAtA)) - } - if size2 != size { - t.Errorf("seed = %d, size %v != before marshal proto.Size %v", seed, size, size2) - } - size3 := github_com_gogo_protobuf_proto.Size(p) - if size3 != size { - t.Errorf("seed = %d, size %v != after marshal proto.Size %v", seed, size, size3) - } -} - -func BenchmarkLinuxHugepageLimitSize(b *testing.B) { - popr := math_rand.New(math_rand.NewSource(616)) - total := 0 - pops := make([]*LinuxHugepageLimit, 1000) - for i := 0; i < 1000; i++ { - pops[i] = NewPopulatedLinuxHugepageLimit(popr, false) - } - b.ResetTimer() - for i := 0; i < b.N; i++ { - total += pops[i%1000].Size() - } - b.SetBytes(int64(total / b.N)) -} - -func TestLinuxInterfacePrioritySize(t *testing.T) { - seed := time.Now().UnixNano() - popr := math_rand.New(math_rand.NewSource(seed)) - p := NewPopulatedLinuxInterfacePriority(popr, true) - size2 := github_com_gogo_protobuf_proto.Size(p) - dAtA, err := github_com_gogo_protobuf_proto.Marshal(p) - if err != nil { - t.Fatalf("seed = %d, err = %v", seed, err) - } - size := p.Size() - if len(dAtA) != size { - t.Errorf("seed = %d, size %v != marshalled size %v", seed, size, len(dAtA)) - } - if size2 != size { - t.Errorf("seed = %d, size %v != before marshal proto.Size %v", seed, size, size2) - } - size3 := github_com_gogo_protobuf_proto.Size(p) - if size3 != size { - t.Errorf("seed = %d, size %v != after marshal proto.Size %v", seed, size, size3) - } -} - -func BenchmarkLinuxInterfacePrioritySize(b *testing.B) { - popr := math_rand.New(math_rand.NewSource(616)) - total := 0 - pops := make([]*LinuxInterfacePriority, 1000) - for i := 0; i < 1000; i++ { - pops[i] = NewPopulatedLinuxInterfacePriority(popr, false) - } - b.ResetTimer() - for i := 0; i < b.N; i++ { - total += pops[i%1000].Size() - } - b.SetBytes(int64(total / b.N)) -} - -func TestLinuxSeccompSize(t *testing.T) { - seed := time.Now().UnixNano() - popr := math_rand.New(math_rand.NewSource(seed)) - p := NewPopulatedLinuxSeccomp(popr, true) - size2 := github_com_gogo_protobuf_proto.Size(p) - dAtA, err := github_com_gogo_protobuf_proto.Marshal(p) - if err != nil { - t.Fatalf("seed = %d, err = %v", seed, err) - } - size := p.Size() - if len(dAtA) != size { - t.Errorf("seed = %d, size %v != marshalled size %v", seed, size, len(dAtA)) - } - if size2 != size { - t.Errorf("seed = %d, size %v != before marshal proto.Size %v", seed, size, size2) - } - size3 := github_com_gogo_protobuf_proto.Size(p) - if size3 != size { - t.Errorf("seed = %d, size %v != after marshal proto.Size %v", seed, size, size3) - } -} - -func BenchmarkLinuxSeccompSize(b *testing.B) { - popr := math_rand.New(math_rand.NewSource(616)) - total := 0 - pops := make([]*LinuxSeccomp, 1000) - for i := 0; i < 1000; i++ { - pops[i] = NewPopulatedLinuxSeccomp(popr, false) - } - b.ResetTimer() - for i := 0; i < b.N; i++ { - total += pops[i%1000].Size() - } - b.SetBytes(int64(total / b.N)) -} - -func TestLinuxSeccompArgSize(t *testing.T) { - seed := time.Now().UnixNano() - popr := math_rand.New(math_rand.NewSource(seed)) - p := NewPopulatedLinuxSeccompArg(popr, true) - size2 := github_com_gogo_protobuf_proto.Size(p) - dAtA, err := github_com_gogo_protobuf_proto.Marshal(p) - if err != nil { - t.Fatalf("seed = %d, err = %v", seed, err) - } - size := p.Size() - if len(dAtA) != size { - t.Errorf("seed = %d, size %v != marshalled size %v", seed, size, len(dAtA)) - } - if size2 != size { - t.Errorf("seed = %d, size %v != before marshal proto.Size %v", seed, size, size2) - } - size3 := github_com_gogo_protobuf_proto.Size(p) - if size3 != size { - t.Errorf("seed = %d, size %v != after marshal proto.Size %v", seed, size, size3) - } -} - -func BenchmarkLinuxSeccompArgSize(b *testing.B) { - popr := math_rand.New(math_rand.NewSource(616)) - total := 0 - pops := make([]*LinuxSeccompArg, 1000) - for i := 0; i < 1000; i++ { - pops[i] = NewPopulatedLinuxSeccompArg(popr, false) - } - b.ResetTimer() - for i := 0; i < b.N; i++ { - total += pops[i%1000].Size() - } - b.SetBytes(int64(total / b.N)) -} - -func TestLinuxSyscallSize(t *testing.T) { - seed := time.Now().UnixNano() - popr := math_rand.New(math_rand.NewSource(seed)) - p := NewPopulatedLinuxSyscall(popr, true) - size2 := github_com_gogo_protobuf_proto.Size(p) - dAtA, err := github_com_gogo_protobuf_proto.Marshal(p) - if err != nil { - t.Fatalf("seed = %d, err = %v", seed, err) - } - size := p.Size() - if len(dAtA) != size { - t.Errorf("seed = %d, size %v != marshalled size %v", seed, size, len(dAtA)) - } - if size2 != size { - t.Errorf("seed = %d, size %v != before marshal proto.Size %v", seed, size, size2) - } - size3 := github_com_gogo_protobuf_proto.Size(p) - if size3 != size { - t.Errorf("seed = %d, size %v != after marshal proto.Size %v", seed, size, size3) - } -} - -func BenchmarkLinuxSyscallSize(b *testing.B) { - popr := math_rand.New(math_rand.NewSource(616)) - total := 0 - pops := make([]*LinuxSyscall, 1000) - for i := 0; i < 1000; i++ { - pops[i] = NewPopulatedLinuxSyscall(popr, false) - } - b.ResetTimer() - for i := 0; i < b.N; i++ { - total += pops[i%1000].Size() - } - b.SetBytes(int64(total / b.N)) -} - -func TestLinuxIntelRdtSize(t *testing.T) { - seed := time.Now().UnixNano() - popr := math_rand.New(math_rand.NewSource(seed)) - p := NewPopulatedLinuxIntelRdt(popr, true) - size2 := github_com_gogo_protobuf_proto.Size(p) - dAtA, err := github_com_gogo_protobuf_proto.Marshal(p) - if err != nil { - t.Fatalf("seed = %d, err = %v", seed, err) - } - size := p.Size() - if len(dAtA) != size { - t.Errorf("seed = %d, size %v != marshalled size %v", seed, size, len(dAtA)) - } - if size2 != size { - t.Errorf("seed = %d, size %v != before marshal proto.Size %v", seed, size, size2) - } - size3 := github_com_gogo_protobuf_proto.Size(p) - if size3 != size { - t.Errorf("seed = %d, size %v != after marshal proto.Size %v", seed, size, size3) - } -} - -func BenchmarkLinuxIntelRdtSize(b *testing.B) { - popr := math_rand.New(math_rand.NewSource(616)) - total := 0 - pops := make([]*LinuxIntelRdt, 1000) - for i := 0; i < 1000; i++ { - pops[i] = NewPopulatedLinuxIntelRdt(popr, false) - } - b.ResetTimer() - for i := 0; i < b.N; i++ { - total += pops[i%1000].Size() - } - b.SetBytes(int64(total / b.N)) -} - -func TestSpecStringer(t *testing.T) { - popr := math_rand.New(math_rand.NewSource(time.Now().UnixNano())) - p := NewPopulatedSpec(popr, false) - s1 := p.String() - s2 := fmt.Sprintf("%v", p) - if s1 != s2 { - t.Fatalf("String want %v got %v", s1, s2) - } -} -func TestProcessStringer(t *testing.T) { - popr := math_rand.New(math_rand.NewSource(time.Now().UnixNano())) - p := NewPopulatedProcess(popr, false) - s1 := p.String() - s2 := fmt.Sprintf("%v", p) - if s1 != s2 { - t.Fatalf("String want %v got %v", s1, s2) - } -} -func TestBoxStringer(t *testing.T) { - popr := math_rand.New(math_rand.NewSource(time.Now().UnixNano())) - p := NewPopulatedBox(popr, false) - s1 := p.String() - s2 := fmt.Sprintf("%v", p) - if s1 != s2 { - t.Fatalf("String want %v got %v", s1, s2) - } -} -func TestUserStringer(t *testing.T) { - popr := math_rand.New(math_rand.NewSource(time.Now().UnixNano())) - p := NewPopulatedUser(popr, false) - s1 := p.String() - s2 := fmt.Sprintf("%v", p) - if s1 != s2 { - t.Fatalf("String want %v got %v", s1, s2) - } -} -func TestLinuxCapabilitiesStringer(t *testing.T) { - popr := math_rand.New(math_rand.NewSource(time.Now().UnixNano())) - p := NewPopulatedLinuxCapabilities(popr, false) - s1 := p.String() - s2 := fmt.Sprintf("%v", p) - if s1 != s2 { - t.Fatalf("String want %v got %v", s1, s2) - } -} -func TestPOSIXRlimitStringer(t *testing.T) { - popr := math_rand.New(math_rand.NewSource(time.Now().UnixNano())) - p := NewPopulatedPOSIXRlimit(popr, false) - s1 := p.String() - s2 := fmt.Sprintf("%v", p) - if s1 != s2 { - t.Fatalf("String want %v got %v", s1, s2) - } -} -func TestMountStringer(t *testing.T) { - popr := math_rand.New(math_rand.NewSource(time.Now().UnixNano())) - p := NewPopulatedMount(popr, false) - s1 := p.String() - s2 := fmt.Sprintf("%v", p) - if s1 != s2 { - t.Fatalf("String want %v got %v", s1, s2) - } -} -func TestRootStringer(t *testing.T) { - popr := math_rand.New(math_rand.NewSource(time.Now().UnixNano())) - p := NewPopulatedRoot(popr, false) - s1 := p.String() - s2 := fmt.Sprintf("%v", p) - if s1 != s2 { - t.Fatalf("String want %v got %v", s1, s2) - } -} -func TestHooksStringer(t *testing.T) { - popr := math_rand.New(math_rand.NewSource(time.Now().UnixNano())) - p := NewPopulatedHooks(popr, false) - s1 := p.String() - s2 := fmt.Sprintf("%v", p) - if s1 != s2 { - t.Fatalf("String want %v got %v", s1, s2) - } -} -func TestHookStringer(t *testing.T) { - popr := math_rand.New(math_rand.NewSource(time.Now().UnixNano())) - p := NewPopulatedHook(popr, false) - s1 := p.String() - s2 := fmt.Sprintf("%v", p) - if s1 != s2 { - t.Fatalf("String want %v got %v", s1, s2) - } -} -func TestLinuxStringer(t *testing.T) { - popr := math_rand.New(math_rand.NewSource(time.Now().UnixNano())) - p := NewPopulatedLinux(popr, false) - s1 := p.String() - s2 := fmt.Sprintf("%v", p) - if s1 != s2 { - t.Fatalf("String want %v got %v", s1, s2) - } -} -func TestWindowsStringer(t *testing.T) { - popr := math_rand.New(math_rand.NewSource(time.Now().UnixNano())) - p := NewPopulatedWindows(popr, false) - s1 := p.String() - s2 := fmt.Sprintf("%v", p) - if s1 != s2 { - t.Fatalf("String want %v got %v", s1, s2) - } -} -func TestSolarisStringer(t *testing.T) { - popr := math_rand.New(math_rand.NewSource(time.Now().UnixNano())) - p := NewPopulatedSolaris(popr, false) - s1 := p.String() - s2 := fmt.Sprintf("%v", p) - if s1 != s2 { - t.Fatalf("String want %v got %v", s1, s2) - } -} -func TestLinuxIDMappingStringer(t *testing.T) { - popr := math_rand.New(math_rand.NewSource(time.Now().UnixNano())) - p := NewPopulatedLinuxIDMapping(popr, false) - s1 := p.String() - s2 := fmt.Sprintf("%v", p) - if s1 != s2 { - t.Fatalf("String want %v got %v", s1, s2) - } -} -func TestLinuxNamespaceStringer(t *testing.T) { - popr := math_rand.New(math_rand.NewSource(time.Now().UnixNano())) - p := NewPopulatedLinuxNamespace(popr, false) - s1 := p.String() - s2 := fmt.Sprintf("%v", p) - if s1 != s2 { - t.Fatalf("String want %v got %v", s1, s2) - } -} -func TestLinuxDeviceStringer(t *testing.T) { - popr := math_rand.New(math_rand.NewSource(time.Now().UnixNano())) - p := NewPopulatedLinuxDevice(popr, false) - s1 := p.String() - s2 := fmt.Sprintf("%v", p) - if s1 != s2 { - t.Fatalf("String want %v got %v", s1, s2) - } -} -func TestLinuxResourcesStringer(t *testing.T) { - popr := math_rand.New(math_rand.NewSource(time.Now().UnixNano())) - p := NewPopulatedLinuxResources(popr, false) - s1 := p.String() - s2 := fmt.Sprintf("%v", p) - if s1 != s2 { - t.Fatalf("String want %v got %v", s1, s2) - } -} -func TestLinuxMemoryStringer(t *testing.T) { - popr := math_rand.New(math_rand.NewSource(time.Now().UnixNano())) - p := NewPopulatedLinuxMemory(popr, false) - s1 := p.String() - s2 := fmt.Sprintf("%v", p) - if s1 != s2 { - t.Fatalf("String want %v got %v", s1, s2) - } -} -func TestLinuxCPUStringer(t *testing.T) { - popr := math_rand.New(math_rand.NewSource(time.Now().UnixNano())) - p := NewPopulatedLinuxCPU(popr, false) - s1 := p.String() - s2 := fmt.Sprintf("%v", p) - if s1 != s2 { - t.Fatalf("String want %v got %v", s1, s2) - } -} -func TestLinuxWeightDeviceStringer(t *testing.T) { - popr := math_rand.New(math_rand.NewSource(time.Now().UnixNano())) - p := NewPopulatedLinuxWeightDevice(popr, false) - s1 := p.String() - s2 := fmt.Sprintf("%v", p) - if s1 != s2 { - t.Fatalf("String want %v got %v", s1, s2) - } -} -func TestLinuxThrottleDeviceStringer(t *testing.T) { - popr := math_rand.New(math_rand.NewSource(time.Now().UnixNano())) - p := NewPopulatedLinuxThrottleDevice(popr, false) - s1 := p.String() - s2 := fmt.Sprintf("%v", p) - if s1 != s2 { - t.Fatalf("String want %v got %v", s1, s2) - } -} -func TestLinuxBlockIOStringer(t *testing.T) { - popr := math_rand.New(math_rand.NewSource(time.Now().UnixNano())) - p := NewPopulatedLinuxBlockIO(popr, false) - s1 := p.String() - s2 := fmt.Sprintf("%v", p) - if s1 != s2 { - t.Fatalf("String want %v got %v", s1, s2) - } -} -func TestLinuxPidsStringer(t *testing.T) { - popr := math_rand.New(math_rand.NewSource(time.Now().UnixNano())) - p := NewPopulatedLinuxPids(popr, false) - s1 := p.String() - s2 := fmt.Sprintf("%v", p) - if s1 != s2 { - t.Fatalf("String want %v got %v", s1, s2) - } -} -func TestLinuxDeviceCgroupStringer(t *testing.T) { - popr := math_rand.New(math_rand.NewSource(time.Now().UnixNano())) - p := NewPopulatedLinuxDeviceCgroup(popr, false) - s1 := p.String() - s2 := fmt.Sprintf("%v", p) - if s1 != s2 { - t.Fatalf("String want %v got %v", s1, s2) - } -} -func TestLinuxNetworkStringer(t *testing.T) { - popr := math_rand.New(math_rand.NewSource(time.Now().UnixNano())) - p := NewPopulatedLinuxNetwork(popr, false) - s1 := p.String() - s2 := fmt.Sprintf("%v", p) - if s1 != s2 { - t.Fatalf("String want %v got %v", s1, s2) - } -} -func TestLinuxHugepageLimitStringer(t *testing.T) { - popr := math_rand.New(math_rand.NewSource(time.Now().UnixNano())) - p := NewPopulatedLinuxHugepageLimit(popr, false) - s1 := p.String() - s2 := fmt.Sprintf("%v", p) - if s1 != s2 { - t.Fatalf("String want %v got %v", s1, s2) - } -} -func TestLinuxInterfacePriorityStringer(t *testing.T) { - popr := math_rand.New(math_rand.NewSource(time.Now().UnixNano())) - p := NewPopulatedLinuxInterfacePriority(popr, false) - s1 := p.String() - s2 := fmt.Sprintf("%v", p) - if s1 != s2 { - t.Fatalf("String want %v got %v", s1, s2) - } -} -func TestLinuxSeccompStringer(t *testing.T) { - popr := math_rand.New(math_rand.NewSource(time.Now().UnixNano())) - p := NewPopulatedLinuxSeccomp(popr, false) - s1 := p.String() - s2 := fmt.Sprintf("%v", p) - if s1 != s2 { - t.Fatalf("String want %v got %v", s1, s2) - } -} -func TestLinuxSeccompArgStringer(t *testing.T) { - popr := math_rand.New(math_rand.NewSource(time.Now().UnixNano())) - p := NewPopulatedLinuxSeccompArg(popr, false) - s1 := p.String() - s2 := fmt.Sprintf("%v", p) - if s1 != s2 { - t.Fatalf("String want %v got %v", s1, s2) - } -} -func TestLinuxSyscallStringer(t *testing.T) { - popr := math_rand.New(math_rand.NewSource(time.Now().UnixNano())) - p := NewPopulatedLinuxSyscall(popr, false) - s1 := p.String() - s2 := fmt.Sprintf("%v", p) - if s1 != s2 { - t.Fatalf("String want %v got %v", s1, s2) - } -} -func TestLinuxIntelRdtStringer(t *testing.T) { - popr := math_rand.New(math_rand.NewSource(time.Now().UnixNano())) - p := NewPopulatedLinuxIntelRdt(popr, false) - s1 := p.String() - s2 := fmt.Sprintf("%v", p) - if s1 != s2 { - t.Fatalf("String want %v got %v", s1, s2) - } -} - -//These tests are generated by github.com/gogo/protobuf/plugin/testgen From 730ef51693cca9a1b0d9d6c9fc1f2fe1943e240b Mon Sep 17 00:00:00 2001 From: Beraldo Leal Date: Fri, 15 Sep 2023 11:25:35 -0400 Subject: [PATCH 2/2] deps: updating dependencies Updating dependencies after make check, make test. Signed-off-by: Beraldo Leal --- .../github.com/gogo/protobuf/jsonpb/jsonpb.go | 1435 ----------------- src/runtime/vendor/modules.txt | 1 - src/tools/agent-ctl/Cargo.lock | 304 +++- src/tools/runk/Cargo.lock | 440 +++-- src/tools/trace-forwarder/Cargo.lock | 165 +- 5 files changed, 685 insertions(+), 1660 deletions(-) delete mode 100644 src/runtime/vendor/github.com/gogo/protobuf/jsonpb/jsonpb.go diff --git a/src/runtime/vendor/github.com/gogo/protobuf/jsonpb/jsonpb.go b/src/runtime/vendor/github.com/gogo/protobuf/jsonpb/jsonpb.go deleted file mode 100644 index e8134ec8ba..0000000000 --- a/src/runtime/vendor/github.com/gogo/protobuf/jsonpb/jsonpb.go +++ /dev/null @@ -1,1435 +0,0 @@ -// Go support for Protocol Buffers - Google's data interchange format -// -// Copyright 2015 The Go Authors. All rights reserved. -// https://github.com/golang/protobuf -// -// Redistribution and use in source and binary forms, with or without -// modification, are permitted provided that the following conditions are -// met: -// -// * Redistributions of source code must retain the above copyright -// notice, this list of conditions and the following disclaimer. -// * Redistributions in binary form must reproduce the above -// copyright notice, this list of conditions and the following disclaimer -// in the documentation and/or other materials provided with the -// distribution. -// * Neither the name of Google Inc. nor the names of its -// contributors may be used to endorse or promote products derived from -// this software without specific prior written permission. -// -// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS -// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT -// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR -// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT -// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, -// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT -// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, -// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY -// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT -// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE -// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - -/* -Package jsonpb provides marshaling and unmarshaling between protocol buffers and JSON. -It follows the specification at https://developers.google.com/protocol-buffers/docs/proto3#json. - -This package produces a different output than the standard "encoding/json" package, -which does not operate correctly on protocol buffers. -*/ -package jsonpb - -import ( - "bytes" - "encoding/json" - "errors" - "fmt" - "io" - "math" - "reflect" - "sort" - "strconv" - "strings" - "time" - - "github.com/gogo/protobuf/proto" - "github.com/gogo/protobuf/types" -) - -const secondInNanos = int64(time.Second / time.Nanosecond) -const maxSecondsInDuration = 315576000000 - -// Marshaler is a configurable object for converting between -// protocol buffer objects and a JSON representation for them. -type Marshaler struct { - // Whether to render enum values as integers, as opposed to string values. - EnumsAsInts bool - - // Whether to render fields with zero values. - EmitDefaults bool - - // A string to indent each level by. The presence of this field will - // also cause a space to appear between the field separator and - // value, and for newlines to be appear between fields and array - // elements. - Indent string - - // Whether to use the original (.proto) name for fields. - OrigName bool - - // A custom URL resolver to use when marshaling Any messages to JSON. - // If unset, the default resolution strategy is to extract the - // fully-qualified type name from the type URL and pass that to - // proto.MessageType(string). - AnyResolver AnyResolver -} - -// AnyResolver takes a type URL, present in an Any message, and resolves it into -// an instance of the associated message. -type AnyResolver interface { - Resolve(typeUrl string) (proto.Message, error) -} - -func defaultResolveAny(typeUrl string) (proto.Message, error) { - // Only the part of typeUrl after the last slash is relevant. - mname := typeUrl - if slash := strings.LastIndex(mname, "/"); slash >= 0 { - mname = mname[slash+1:] - } - mt := proto.MessageType(mname) - if mt == nil { - return nil, fmt.Errorf("unknown message type %q", mname) - } - return reflect.New(mt.Elem()).Interface().(proto.Message), nil -} - -// JSONPBMarshaler is implemented by protobuf messages that customize the -// way they are marshaled to JSON. Messages that implement this should -// also implement JSONPBUnmarshaler so that the custom format can be -// parsed. -// -// The JSON marshaling must follow the proto to JSON specification: -// https://developers.google.com/protocol-buffers/docs/proto3#json -type JSONPBMarshaler interface { - MarshalJSONPB(*Marshaler) ([]byte, error) -} - -// JSONPBUnmarshaler is implemented by protobuf messages that customize -// the way they are unmarshaled from JSON. Messages that implement this -// should also implement JSONPBMarshaler so that the custom format can be -// produced. -// -// The JSON unmarshaling must follow the JSON to proto specification: -// https://developers.google.com/protocol-buffers/docs/proto3#json -type JSONPBUnmarshaler interface { - UnmarshalJSONPB(*Unmarshaler, []byte) error -} - -// Marshal marshals a protocol buffer into JSON. -func (m *Marshaler) Marshal(out io.Writer, pb proto.Message) error { - v := reflect.ValueOf(pb) - if pb == nil || (v.Kind() == reflect.Ptr && v.IsNil()) { - return errors.New("Marshal called with nil") - } - // Check for unset required fields first. - if err := checkRequiredFields(pb); err != nil { - return err - } - writer := &errWriter{writer: out} - return m.marshalObject(writer, pb, "", "") -} - -// MarshalToString converts a protocol buffer object to JSON string. -func (m *Marshaler) MarshalToString(pb proto.Message) (string, error) { - var buf bytes.Buffer - if err := m.Marshal(&buf, pb); err != nil { - return "", err - } - return buf.String(), nil -} - -type int32Slice []int32 - -var nonFinite = map[string]float64{ - `"NaN"`: math.NaN(), - `"Infinity"`: math.Inf(1), - `"-Infinity"`: math.Inf(-1), -} - -// For sorting extensions ids to ensure stable output. -func (s int32Slice) Len() int { return len(s) } -func (s int32Slice) Less(i, j int) bool { return s[i] < s[j] } -func (s int32Slice) Swap(i, j int) { s[i], s[j] = s[j], s[i] } - -type isWkt interface { - XXX_WellKnownType() string -} - -var ( - wktType = reflect.TypeOf((*isWkt)(nil)).Elem() - messageType = reflect.TypeOf((*proto.Message)(nil)).Elem() -) - -// marshalObject writes a struct to the Writer. -func (m *Marshaler) marshalObject(out *errWriter, v proto.Message, indent, typeURL string) error { - if jsm, ok := v.(JSONPBMarshaler); ok { - b, err := jsm.MarshalJSONPB(m) - if err != nil { - return err - } - if typeURL != "" { - // we are marshaling this object to an Any type - var js map[string]*json.RawMessage - if err = json.Unmarshal(b, &js); err != nil { - return fmt.Errorf("type %T produced invalid JSON: %v", v, err) - } - turl, err := json.Marshal(typeURL) - if err != nil { - return fmt.Errorf("failed to marshal type URL %q to JSON: %v", typeURL, err) - } - js["@type"] = (*json.RawMessage)(&turl) - if m.Indent != "" { - b, err = json.MarshalIndent(js, indent, m.Indent) - } else { - b, err = json.Marshal(js) - } - if err != nil { - return err - } - } - - out.write(string(b)) - return out.err - } - - s := reflect.ValueOf(v).Elem() - - // Handle well-known types. - if wkt, ok := v.(isWkt); ok { - switch wkt.XXX_WellKnownType() { - case "DoubleValue", "FloatValue", "Int64Value", "UInt64Value", - "Int32Value", "UInt32Value", "BoolValue", "StringValue", "BytesValue": - // "Wrappers use the same representation in JSON - // as the wrapped primitive type, ..." - sprop := proto.GetProperties(s.Type()) - return m.marshalValue(out, sprop.Prop[0], s.Field(0), indent) - case "Any": - // Any is a bit more involved. - return m.marshalAny(out, v, indent) - case "Duration": - s, ns := s.Field(0).Int(), s.Field(1).Int() - if s < -maxSecondsInDuration || s > maxSecondsInDuration { - return fmt.Errorf("seconds out of range %v", s) - } - if ns <= -secondInNanos || ns >= secondInNanos { - return fmt.Errorf("ns out of range (%v, %v)", -secondInNanos, secondInNanos) - } - if (s > 0 && ns < 0) || (s < 0 && ns > 0) { - return errors.New("signs of seconds and nanos do not match") - } - // Generated output always contains 0, 3, 6, or 9 fractional digits, - // depending on required precision, followed by the suffix "s". - f := "%d.%09d" - if ns < 0 { - ns = -ns - if s == 0 { - f = "-%d.%09d" - } - } - x := fmt.Sprintf(f, s, ns) - x = strings.TrimSuffix(x, "000") - x = strings.TrimSuffix(x, "000") - x = strings.TrimSuffix(x, ".000") - out.write(`"`) - out.write(x) - out.write(`s"`) - return out.err - case "Struct", "ListValue": - // Let marshalValue handle the `Struct.fields` map or the `ListValue.values` slice. - // TODO: pass the correct Properties if needed. - return m.marshalValue(out, &proto.Properties{}, s.Field(0), indent) - case "Timestamp": - // "RFC 3339, where generated output will always be Z-normalized - // and uses 0, 3, 6 or 9 fractional digits." - s, ns := s.Field(0).Int(), s.Field(1).Int() - if ns < 0 || ns >= secondInNanos { - return fmt.Errorf("ns out of range [0, %v)", secondInNanos) - } - t := time.Unix(s, ns).UTC() - // time.RFC3339Nano isn't exactly right (we need to get 3/6/9 fractional digits). - x := t.Format("2006-01-02T15:04:05.000000000") - x = strings.TrimSuffix(x, "000") - x = strings.TrimSuffix(x, "000") - x = strings.TrimSuffix(x, ".000") - out.write(`"`) - out.write(x) - out.write(`Z"`) - return out.err - case "Value": - // Value has a single oneof. - kind := s.Field(0) - if kind.IsNil() { - // "absence of any variant indicates an error" - return errors.New("nil Value") - } - // oneof -> *T -> T -> T.F - x := kind.Elem().Elem().Field(0) - // TODO: pass the correct Properties if needed. - return m.marshalValue(out, &proto.Properties{}, x, indent) - } - } - - out.write("{") - if m.Indent != "" { - out.write("\n") - } - - firstField := true - - if typeURL != "" { - if err := m.marshalTypeURL(out, indent, typeURL); err != nil { - return err - } - firstField = false - } - - for i := 0; i < s.NumField(); i++ { - value := s.Field(i) - valueField := s.Type().Field(i) - if strings.HasPrefix(valueField.Name, "XXX_") { - continue - } - - //this is not a protobuf field - if valueField.Tag.Get("protobuf") == "" && valueField.Tag.Get("protobuf_oneof") == "" { - continue - } - - // IsNil will panic on most value kinds. - switch value.Kind() { - case reflect.Chan, reflect.Func, reflect.Interface: - if value.IsNil() { - continue - } - } - - if !m.EmitDefaults { - switch value.Kind() { - case reflect.Bool: - if !value.Bool() { - continue - } - case reflect.Int32, reflect.Int64: - if value.Int() == 0 { - continue - } - case reflect.Uint32, reflect.Uint64: - if value.Uint() == 0 { - continue - } - case reflect.Float32, reflect.Float64: - if value.Float() == 0 { - continue - } - case reflect.String: - if value.Len() == 0 { - continue - } - case reflect.Map, reflect.Ptr, reflect.Slice: - if value.IsNil() { - continue - } - } - } - - // Oneof fields need special handling. - if valueField.Tag.Get("protobuf_oneof") != "" { - // value is an interface containing &T{real_value}. - sv := value.Elem().Elem() // interface -> *T -> T - value = sv.Field(0) - valueField = sv.Type().Field(0) - } - prop := jsonProperties(valueField, m.OrigName) - if !firstField { - m.writeSep(out) - } - // If the map value is a cast type, it may not implement proto.Message, therefore - // allow the struct tag to declare the underlying message type. Change the property - // of the child types, use CustomType as a passer. CastType currently property is - // not used in json encoding. - if value.Kind() == reflect.Map { - if tag := valueField.Tag.Get("protobuf"); tag != "" { - for _, v := range strings.Split(tag, ",") { - if !strings.HasPrefix(v, "castvaluetype=") { - continue - } - v = strings.TrimPrefix(v, "castvaluetype=") - prop.MapValProp.CustomType = v - break - } - } - } - if err := m.marshalField(out, prop, value, indent); err != nil { - return err - } - firstField = false - } - - // Handle proto2 extensions. - if ep, ok := v.(proto.Message); ok { - extensions := proto.RegisteredExtensions(v) - // Sort extensions for stable output. - ids := make([]int32, 0, len(extensions)) - for id, desc := range extensions { - if !proto.HasExtension(ep, desc) { - continue - } - ids = append(ids, id) - } - sort.Sort(int32Slice(ids)) - for _, id := range ids { - desc := extensions[id] - if desc == nil { - // unknown extension - continue - } - ext, extErr := proto.GetExtension(ep, desc) - if extErr != nil { - return extErr - } - value := reflect.ValueOf(ext) - var prop proto.Properties - prop.Parse(desc.Tag) - prop.JSONName = fmt.Sprintf("[%s]", desc.Name) - if !firstField { - m.writeSep(out) - } - if err := m.marshalField(out, &prop, value, indent); err != nil { - return err - } - firstField = false - } - - } - - if m.Indent != "" { - out.write("\n") - out.write(indent) - } - out.write("}") - return out.err -} - -func (m *Marshaler) writeSep(out *errWriter) { - if m.Indent != "" { - out.write(",\n") - } else { - out.write(",") - } -} - -func (m *Marshaler) marshalAny(out *errWriter, any proto.Message, indent string) error { - // "If the Any contains a value that has a special JSON mapping, - // it will be converted as follows: {"@type": xxx, "value": yyy}. - // Otherwise, the value will be converted into a JSON object, - // and the "@type" field will be inserted to indicate the actual data type." - v := reflect.ValueOf(any).Elem() - turl := v.Field(0).String() - val := v.Field(1).Bytes() - - var msg proto.Message - var err error - if m.AnyResolver != nil { - msg, err = m.AnyResolver.Resolve(turl) - } else { - msg, err = defaultResolveAny(turl) - } - if err != nil { - return err - } - - if err := proto.Unmarshal(val, msg); err != nil { - return err - } - - if _, ok := msg.(isWkt); ok { - out.write("{") - if m.Indent != "" { - out.write("\n") - } - if err := m.marshalTypeURL(out, indent, turl); err != nil { - return err - } - m.writeSep(out) - if m.Indent != "" { - out.write(indent) - out.write(m.Indent) - out.write(`"value": `) - } else { - out.write(`"value":`) - } - if err := m.marshalObject(out, msg, indent+m.Indent, ""); err != nil { - return err - } - if m.Indent != "" { - out.write("\n") - out.write(indent) - } - out.write("}") - return out.err - } - - return m.marshalObject(out, msg, indent, turl) -} - -func (m *Marshaler) marshalTypeURL(out *errWriter, indent, typeURL string) error { - if m.Indent != "" { - out.write(indent) - out.write(m.Indent) - } - out.write(`"@type":`) - if m.Indent != "" { - out.write(" ") - } - b, err := json.Marshal(typeURL) - if err != nil { - return err - } - out.write(string(b)) - return out.err -} - -// marshalField writes field description and value to the Writer. -func (m *Marshaler) marshalField(out *errWriter, prop *proto.Properties, v reflect.Value, indent string) error { - if m.Indent != "" { - out.write(indent) - out.write(m.Indent) - } - out.write(`"`) - out.write(prop.JSONName) - out.write(`":`) - if m.Indent != "" { - out.write(" ") - } - if err := m.marshalValue(out, prop, v, indent); err != nil { - return err - } - return nil -} - -// marshalValue writes the value to the Writer. -func (m *Marshaler) marshalValue(out *errWriter, prop *proto.Properties, v reflect.Value, indent string) error { - - v = reflect.Indirect(v) - - // Handle nil pointer - if v.Kind() == reflect.Invalid { - out.write("null") - return out.err - } - - // Handle repeated elements. - if v.Kind() == reflect.Slice && v.Type().Elem().Kind() != reflect.Uint8 { - out.write("[") - comma := "" - for i := 0; i < v.Len(); i++ { - sliceVal := v.Index(i) - out.write(comma) - if m.Indent != "" { - out.write("\n") - out.write(indent) - out.write(m.Indent) - out.write(m.Indent) - } - if err := m.marshalValue(out, prop, sliceVal, indent+m.Indent); err != nil { - return err - } - comma = "," - } - if m.Indent != "" { - out.write("\n") - out.write(indent) - out.write(m.Indent) - } - out.write("]") - return out.err - } - - // Handle well-known types. - // Most are handled up in marshalObject (because 99% are messages). - if v.Type().Implements(wktType) { - wkt := v.Interface().(isWkt) - switch wkt.XXX_WellKnownType() { - case "NullValue": - out.write("null") - return out.err - } - } - - if t, ok := v.Interface().(time.Time); ok { - ts, err := types.TimestampProto(t) - if err != nil { - return err - } - return m.marshalValue(out, prop, reflect.ValueOf(ts), indent) - } - - if d, ok := v.Interface().(time.Duration); ok { - dur := types.DurationProto(d) - return m.marshalValue(out, prop, reflect.ValueOf(dur), indent) - } - - // Handle enumerations. - if !m.EnumsAsInts && prop.Enum != "" { - // Unknown enum values will are stringified by the proto library as their - // value. Such values should _not_ be quoted or they will be interpreted - // as an enum string instead of their value. - enumStr := v.Interface().(fmt.Stringer).String() - var valStr string - if v.Kind() == reflect.Ptr { - valStr = strconv.Itoa(int(v.Elem().Int())) - } else { - valStr = strconv.Itoa(int(v.Int())) - } - - if m, ok := v.Interface().(interface { - MarshalJSON() ([]byte, error) - }); ok { - data, err := m.MarshalJSON() - if err != nil { - return err - } - enumStr = string(data) - enumStr, err = strconv.Unquote(enumStr) - if err != nil { - return err - } - } - - isKnownEnum := enumStr != valStr - - if isKnownEnum { - out.write(`"`) - } - out.write(enumStr) - if isKnownEnum { - out.write(`"`) - } - return out.err - } - - // Handle nested messages. - if v.Kind() == reflect.Struct { - i := v - if v.CanAddr() { - i = v.Addr() - } else { - i = reflect.New(v.Type()) - i.Elem().Set(v) - } - iface := i.Interface() - if iface == nil { - out.write(`null`) - return out.err - } - - if m, ok := v.Interface().(interface { - MarshalJSON() ([]byte, error) - }); ok { - data, err := m.MarshalJSON() - if err != nil { - return err - } - out.write(string(data)) - return nil - } - - pm, ok := iface.(proto.Message) - if !ok { - if prop.CustomType == "" { - return fmt.Errorf("%v does not implement proto.Message", v.Type()) - } - t := proto.MessageType(prop.CustomType) - if t == nil || !i.Type().ConvertibleTo(t) { - return fmt.Errorf("%v declared custom type %s but it is not convertible to %v", v.Type(), prop.CustomType, t) - } - pm = i.Convert(t).Interface().(proto.Message) - } - return m.marshalObject(out, pm, indent+m.Indent, "") - } - - // Handle maps. - // Since Go randomizes map iteration, we sort keys for stable output. - if v.Kind() == reflect.Map { - out.write(`{`) - keys := v.MapKeys() - sort.Sort(mapKeys(keys)) - for i, k := range keys { - if i > 0 { - out.write(`,`) - } - if m.Indent != "" { - out.write("\n") - out.write(indent) - out.write(m.Indent) - out.write(m.Indent) - } - - // TODO handle map key prop properly - b, err := json.Marshal(k.Interface()) - if err != nil { - return err - } - s := string(b) - - // If the JSON is not a string value, encode it again to make it one. - if !strings.HasPrefix(s, `"`) { - b, err := json.Marshal(s) - if err != nil { - return err - } - s = string(b) - } - - out.write(s) - out.write(`:`) - if m.Indent != "" { - out.write(` `) - } - - vprop := prop - if prop != nil && prop.MapValProp != nil { - vprop = prop.MapValProp - } - if err := m.marshalValue(out, vprop, v.MapIndex(k), indent+m.Indent); err != nil { - return err - } - } - if m.Indent != "" { - out.write("\n") - out.write(indent) - out.write(m.Indent) - } - out.write(`}`) - return out.err - } - - // Handle non-finite floats, e.g. NaN, Infinity and -Infinity. - if v.Kind() == reflect.Float32 || v.Kind() == reflect.Float64 { - f := v.Float() - var sval string - switch { - case math.IsInf(f, 1): - sval = `"Infinity"` - case math.IsInf(f, -1): - sval = `"-Infinity"` - case math.IsNaN(f): - sval = `"NaN"` - } - if sval != "" { - out.write(sval) - return out.err - } - } - - // Default handling defers to the encoding/json library. - b, err := json.Marshal(v.Interface()) - if err != nil { - return err - } - needToQuote := string(b[0]) != `"` && (v.Kind() == reflect.Int64 || v.Kind() == reflect.Uint64) - if needToQuote { - out.write(`"`) - } - out.write(string(b)) - if needToQuote { - out.write(`"`) - } - return out.err -} - -// Unmarshaler is a configurable object for converting from a JSON -// representation to a protocol buffer object. -type Unmarshaler struct { - // Whether to allow messages to contain unknown fields, as opposed to - // failing to unmarshal. - AllowUnknownFields bool - - // A custom URL resolver to use when unmarshaling Any messages from JSON. - // If unset, the default resolution strategy is to extract the - // fully-qualified type name from the type URL and pass that to - // proto.MessageType(string). - AnyResolver AnyResolver -} - -// UnmarshalNext unmarshals the next protocol buffer from a JSON object stream. -// This function is lenient and will decode any options permutations of the -// related Marshaler. -func (u *Unmarshaler) UnmarshalNext(dec *json.Decoder, pb proto.Message) error { - inputValue := json.RawMessage{} - if err := dec.Decode(&inputValue); err != nil { - return err - } - if err := u.unmarshalValue(reflect.ValueOf(pb).Elem(), inputValue, nil); err != nil { - return err - } - return checkRequiredFields(pb) -} - -// Unmarshal unmarshals a JSON object stream into a protocol -// buffer. This function is lenient and will decode any options -// permutations of the related Marshaler. -func (u *Unmarshaler) Unmarshal(r io.Reader, pb proto.Message) error { - dec := json.NewDecoder(r) - return u.UnmarshalNext(dec, pb) -} - -// UnmarshalNext unmarshals the next protocol buffer from a JSON object stream. -// This function is lenient and will decode any options permutations of the -// related Marshaler. -func UnmarshalNext(dec *json.Decoder, pb proto.Message) error { - return new(Unmarshaler).UnmarshalNext(dec, pb) -} - -// Unmarshal unmarshals a JSON object stream into a protocol -// buffer. This function is lenient and will decode any options -// permutations of the related Marshaler. -func Unmarshal(r io.Reader, pb proto.Message) error { - return new(Unmarshaler).Unmarshal(r, pb) -} - -// UnmarshalString will populate the fields of a protocol buffer based -// on a JSON string. This function is lenient and will decode any options -// permutations of the related Marshaler. -func UnmarshalString(str string, pb proto.Message) error { - return new(Unmarshaler).Unmarshal(strings.NewReader(str), pb) -} - -// unmarshalValue converts/copies a value into the target. -// prop may be nil. -func (u *Unmarshaler) unmarshalValue(target reflect.Value, inputValue json.RawMessage, prop *proto.Properties) error { - targetType := target.Type() - - // Allocate memory for pointer fields. - if targetType.Kind() == reflect.Ptr { - // If input value is "null" and target is a pointer type, then the field should be treated as not set - // UNLESS the target is structpb.Value, in which case it should be set to structpb.NullValue. - _, isJSONPBUnmarshaler := target.Interface().(JSONPBUnmarshaler) - if string(inputValue) == "null" && targetType != reflect.TypeOf(&types.Value{}) && !isJSONPBUnmarshaler { - return nil - } - target.Set(reflect.New(targetType.Elem())) - - return u.unmarshalValue(target.Elem(), inputValue, prop) - } - - if jsu, ok := target.Addr().Interface().(JSONPBUnmarshaler); ok { - return jsu.UnmarshalJSONPB(u, []byte(inputValue)) - } - - // Handle well-known types that are not pointers. - if w, ok := target.Addr().Interface().(isWkt); ok { - switch w.XXX_WellKnownType() { - case "DoubleValue", "FloatValue", "Int64Value", "UInt64Value", - "Int32Value", "UInt32Value", "BoolValue", "StringValue", "BytesValue": - return u.unmarshalValue(target.Field(0), inputValue, prop) - case "Any": - // Use json.RawMessage pointer type instead of value to support pre-1.8 version. - // 1.8 changed RawMessage.MarshalJSON from pointer type to value type, see - // https://github.com/golang/go/issues/14493 - var jsonFields map[string]*json.RawMessage - if err := json.Unmarshal(inputValue, &jsonFields); err != nil { - return err - } - - val, ok := jsonFields["@type"] - if !ok || val == nil { - return errors.New("Any JSON doesn't have '@type'") - } - - var turl string - if err := json.Unmarshal([]byte(*val), &turl); err != nil { - return fmt.Errorf("can't unmarshal Any's '@type': %q", *val) - } - target.Field(0).SetString(turl) - - var m proto.Message - var err error - if u.AnyResolver != nil { - m, err = u.AnyResolver.Resolve(turl) - } else { - m, err = defaultResolveAny(turl) - } - if err != nil { - return err - } - - if _, ok := m.(isWkt); ok { - val, ok := jsonFields["value"] - if !ok { - return errors.New("Any JSON doesn't have 'value'") - } - - if err = u.unmarshalValue(reflect.ValueOf(m).Elem(), *val, nil); err != nil { - return fmt.Errorf("can't unmarshal Any nested proto %T: %v", m, err) - } - } else { - delete(jsonFields, "@type") - nestedProto, uerr := json.Marshal(jsonFields) - if uerr != nil { - return fmt.Errorf("can't generate JSON for Any's nested proto to be unmarshaled: %v", uerr) - } - - if err = u.unmarshalValue(reflect.ValueOf(m).Elem(), nestedProto, nil); err != nil { - return fmt.Errorf("can't unmarshal Any nested proto %T: %v", m, err) - } - } - - b, err := proto.Marshal(m) - if err != nil { - return fmt.Errorf("can't marshal proto %T into Any.Value: %v", m, err) - } - target.Field(1).SetBytes(b) - - return nil - case "Duration": - unq, err := unquote(string(inputValue)) - if err != nil { - return err - } - - d, err := time.ParseDuration(unq) - if err != nil { - return fmt.Errorf("bad Duration: %v", err) - } - - ns := d.Nanoseconds() - s := ns / 1e9 - ns %= 1e9 - target.Field(0).SetInt(s) - target.Field(1).SetInt(ns) - return nil - case "Timestamp": - unq, err := unquote(string(inputValue)) - if err != nil { - return err - } - - t, err := time.Parse(time.RFC3339Nano, unq) - if err != nil { - return fmt.Errorf("bad Timestamp: %v", err) - } - - target.Field(0).SetInt(t.Unix()) - target.Field(1).SetInt(int64(t.Nanosecond())) - return nil - case "Struct": - var m map[string]json.RawMessage - if err := json.Unmarshal(inputValue, &m); err != nil { - return fmt.Errorf("bad StructValue: %v", err) - } - target.Field(0).Set(reflect.ValueOf(map[string]*types.Value{})) - for k, jv := range m { - pv := &types.Value{} - if err := u.unmarshalValue(reflect.ValueOf(pv).Elem(), jv, prop); err != nil { - return fmt.Errorf("bad value in StructValue for key %q: %v", k, err) - } - target.Field(0).SetMapIndex(reflect.ValueOf(k), reflect.ValueOf(pv)) - } - return nil - case "ListValue": - var s []json.RawMessage - if err := json.Unmarshal(inputValue, &s); err != nil { - return fmt.Errorf("bad ListValue: %v", err) - } - - target.Field(0).Set(reflect.ValueOf(make([]*types.Value, len(s)))) - for i, sv := range s { - if err := u.unmarshalValue(target.Field(0).Index(i), sv, prop); err != nil { - return err - } - } - return nil - case "Value": - ivStr := string(inputValue) - if ivStr == "null" { - target.Field(0).Set(reflect.ValueOf(&types.Value_NullValue{})) - } else if v, err := strconv.ParseFloat(ivStr, 0); err == nil { - target.Field(0).Set(reflect.ValueOf(&types.Value_NumberValue{NumberValue: v})) - } else if v, err := unquote(ivStr); err == nil { - target.Field(0).Set(reflect.ValueOf(&types.Value_StringValue{StringValue: v})) - } else if v, err := strconv.ParseBool(ivStr); err == nil { - target.Field(0).Set(reflect.ValueOf(&types.Value_BoolValue{BoolValue: v})) - } else if err := json.Unmarshal(inputValue, &[]json.RawMessage{}); err == nil { - lv := &types.ListValue{} - target.Field(0).Set(reflect.ValueOf(&types.Value_ListValue{ListValue: lv})) - return u.unmarshalValue(reflect.ValueOf(lv).Elem(), inputValue, prop) - } else if err := json.Unmarshal(inputValue, &map[string]json.RawMessage{}); err == nil { - sv := &types.Struct{} - target.Field(0).Set(reflect.ValueOf(&types.Value_StructValue{StructValue: sv})) - return u.unmarshalValue(reflect.ValueOf(sv).Elem(), inputValue, prop) - } else { - return fmt.Errorf("unrecognized type for Value %q", ivStr) - } - return nil - } - } - - if t, ok := target.Addr().Interface().(*time.Time); ok { - ts := &types.Timestamp{} - if err := u.unmarshalValue(reflect.ValueOf(ts).Elem(), inputValue, prop); err != nil { - return err - } - tt, err := types.TimestampFromProto(ts) - if err != nil { - return err - } - *t = tt - return nil - } - - if d, ok := target.Addr().Interface().(*time.Duration); ok { - dur := &types.Duration{} - if err := u.unmarshalValue(reflect.ValueOf(dur).Elem(), inputValue, prop); err != nil { - return err - } - dd, err := types.DurationFromProto(dur) - if err != nil { - return err - } - *d = dd - return nil - } - - // Handle enums, which have an underlying type of int32, - // and may appear as strings. - // The case of an enum appearing as a number is handled - // at the bottom of this function. - if inputValue[0] == '"' && prop != nil && prop.Enum != "" { - vmap := proto.EnumValueMap(prop.Enum) - // Don't need to do unquoting; valid enum names - // are from a limited character set. - s := inputValue[1 : len(inputValue)-1] - n, ok := vmap[string(s)] - if !ok { - return fmt.Errorf("unknown value %q for enum %s", s, prop.Enum) - } - if target.Kind() == reflect.Ptr { // proto2 - target.Set(reflect.New(targetType.Elem())) - target = target.Elem() - } - if targetType.Kind() != reflect.Int32 { - return fmt.Errorf("invalid target %q for enum %s", targetType.Kind(), prop.Enum) - } - target.SetInt(int64(n)) - return nil - } - - if prop != nil && len(prop.CustomType) > 0 && target.CanAddr() { - if m, ok := target.Addr().Interface().(interface { - UnmarshalJSON([]byte) error - }); ok { - return json.Unmarshal(inputValue, m) - } - } - - // Handle nested messages. - if targetType.Kind() == reflect.Struct { - var jsonFields map[string]json.RawMessage - if err := json.Unmarshal(inputValue, &jsonFields); err != nil { - return err - } - - consumeField := func(prop *proto.Properties) (json.RawMessage, bool) { - // Be liberal in what names we accept; both orig_name and camelName are okay. - fieldNames := acceptedJSONFieldNames(prop) - - vOrig, okOrig := jsonFields[fieldNames.orig] - vCamel, okCamel := jsonFields[fieldNames.camel] - if !okOrig && !okCamel { - return nil, false - } - // If, for some reason, both are present in the data, favour the camelName. - var raw json.RawMessage - if okOrig { - raw = vOrig - delete(jsonFields, fieldNames.orig) - } - if okCamel { - raw = vCamel - delete(jsonFields, fieldNames.camel) - } - return raw, true - } - - sprops := proto.GetProperties(targetType) - for i := 0; i < target.NumField(); i++ { - ft := target.Type().Field(i) - if strings.HasPrefix(ft.Name, "XXX_") { - continue - } - valueForField, ok := consumeField(sprops.Prop[i]) - if !ok { - continue - } - - if err := u.unmarshalValue(target.Field(i), valueForField, sprops.Prop[i]); err != nil { - return err - } - } - // Check for any oneof fields. - if len(jsonFields) > 0 { - for _, oop := range sprops.OneofTypes { - raw, ok := consumeField(oop.Prop) - if !ok { - continue - } - nv := reflect.New(oop.Type.Elem()) - target.Field(oop.Field).Set(nv) - if err := u.unmarshalValue(nv.Elem().Field(0), raw, oop.Prop); err != nil { - return err - } - } - } - // Handle proto2 extensions. - if len(jsonFields) > 0 { - if ep, ok := target.Addr().Interface().(proto.Message); ok { - for _, ext := range proto.RegisteredExtensions(ep) { - name := fmt.Sprintf("[%s]", ext.Name) - raw, ok := jsonFields[name] - if !ok { - continue - } - delete(jsonFields, name) - nv := reflect.New(reflect.TypeOf(ext.ExtensionType).Elem()) - if err := u.unmarshalValue(nv.Elem(), raw, nil); err != nil { - return err - } - if err := proto.SetExtension(ep, ext, nv.Interface()); err != nil { - return err - } - } - } - } - if !u.AllowUnknownFields && len(jsonFields) > 0 { - // Pick any field to be the scapegoat. - var f string - for fname := range jsonFields { - f = fname - break - } - return fmt.Errorf("unknown field %q in %v", f, targetType) - } - return nil - } - - // Handle arrays - if targetType.Kind() == reflect.Slice { - if targetType.Elem().Kind() == reflect.Uint8 { - outRef := reflect.New(targetType) - outVal := outRef.Interface() - //CustomType with underlying type []byte - if _, ok := outVal.(interface { - UnmarshalJSON([]byte) error - }); ok { - if err := json.Unmarshal(inputValue, outVal); err != nil { - return err - } - target.Set(outRef.Elem()) - return nil - } - // Special case for encoded bytes. Pre-go1.5 doesn't support unmarshalling - // strings into aliased []byte types. - // https://github.com/golang/go/commit/4302fd0409da5e4f1d71471a6770dacdc3301197 - // https://github.com/golang/go/commit/c60707b14d6be26bf4213114d13070bff00d0b0a - var out []byte - if err := json.Unmarshal(inputValue, &out); err != nil { - return err - } - target.SetBytes(out) - return nil - } - - var slc []json.RawMessage - if err := json.Unmarshal(inputValue, &slc); err != nil { - return err - } - if slc != nil { - l := len(slc) - target.Set(reflect.MakeSlice(targetType, l, l)) - for i := 0; i < l; i++ { - if err := u.unmarshalValue(target.Index(i), slc[i], prop); err != nil { - return err - } - } - } - return nil - } - - // Handle maps (whose keys are always strings) - if targetType.Kind() == reflect.Map { - var mp map[string]json.RawMessage - if err := json.Unmarshal(inputValue, &mp); err != nil { - return err - } - if mp != nil { - target.Set(reflect.MakeMap(targetType)) - for ks, raw := range mp { - // Unmarshal map key. The core json library already decoded the key into a - // string, so we handle that specially. Other types were quoted post-serialization. - var k reflect.Value - if targetType.Key().Kind() == reflect.String { - k = reflect.ValueOf(ks) - } else { - k = reflect.New(targetType.Key()).Elem() - var kprop *proto.Properties - if prop != nil && prop.MapKeyProp != nil { - kprop = prop.MapKeyProp - } - if err := u.unmarshalValue(k, json.RawMessage(ks), kprop); err != nil { - return err - } - } - - if !k.Type().AssignableTo(targetType.Key()) { - k = k.Convert(targetType.Key()) - } - - // Unmarshal map value. - v := reflect.New(targetType.Elem()).Elem() - var vprop *proto.Properties - if prop != nil && prop.MapValProp != nil { - vprop = prop.MapValProp - } - if err := u.unmarshalValue(v, raw, vprop); err != nil { - return err - } - target.SetMapIndex(k, v) - } - } - return nil - } - - // Non-finite numbers can be encoded as strings. - isFloat := targetType.Kind() == reflect.Float32 || targetType.Kind() == reflect.Float64 - if isFloat { - if num, ok := nonFinite[string(inputValue)]; ok { - target.SetFloat(num) - return nil - } - } - - // integers & floats can be encoded as strings. In this case we drop - // the quotes and proceed as normal. - isNum := targetType.Kind() == reflect.Int64 || targetType.Kind() == reflect.Uint64 || - targetType.Kind() == reflect.Int32 || targetType.Kind() == reflect.Uint32 || - targetType.Kind() == reflect.Float32 || targetType.Kind() == reflect.Float64 - if isNum && strings.HasPrefix(string(inputValue), `"`) { - inputValue = inputValue[1 : len(inputValue)-1] - } - - // Use the encoding/json for parsing other value types. - return json.Unmarshal(inputValue, target.Addr().Interface()) -} - -func unquote(s string) (string, error) { - var ret string - err := json.Unmarshal([]byte(s), &ret) - return ret, err -} - -// jsonProperties returns parsed proto.Properties for the field and corrects JSONName attribute. -func jsonProperties(f reflect.StructField, origName bool) *proto.Properties { - var prop proto.Properties - prop.Init(f.Type, f.Name, f.Tag.Get("protobuf"), &f) - if origName || prop.JSONName == "" { - prop.JSONName = prop.OrigName - } - return &prop -} - -type fieldNames struct { - orig, camel string -} - -func acceptedJSONFieldNames(prop *proto.Properties) fieldNames { - opts := fieldNames{orig: prop.OrigName, camel: prop.OrigName} - if prop.JSONName != "" { - opts.camel = prop.JSONName - } - return opts -} - -// Writer wrapper inspired by https://blog.golang.org/errors-are-values -type errWriter struct { - writer io.Writer - err error -} - -func (w *errWriter) write(str string) { - if w.err != nil { - return - } - _, w.err = w.writer.Write([]byte(str)) -} - -// Map fields may have key types of non-float scalars, strings and enums. -// The easiest way to sort them in some deterministic order is to use fmt. -// If this turns out to be inefficient we can always consider other options, -// such as doing a Schwartzian transform. -// -// Numeric keys are sorted in numeric order per -// https://developers.google.com/protocol-buffers/docs/proto#maps. -type mapKeys []reflect.Value - -func (s mapKeys) Len() int { return len(s) } -func (s mapKeys) Swap(i, j int) { s[i], s[j] = s[j], s[i] } -func (s mapKeys) Less(i, j int) bool { - if k := s[i].Kind(); k == s[j].Kind() { - switch k { - case reflect.String: - return s[i].String() < s[j].String() - case reflect.Int32, reflect.Int64: - return s[i].Int() < s[j].Int() - case reflect.Uint32, reflect.Uint64: - return s[i].Uint() < s[j].Uint() - } - } - return fmt.Sprint(s[i].Interface()) < fmt.Sprint(s[j].Interface()) -} - -// checkRequiredFields returns an error if any required field in the given proto message is not set. -// This function is used by both Marshal and Unmarshal. While required fields only exist in a -// proto2 message, a proto3 message can contain proto2 message(s). -func checkRequiredFields(pb proto.Message) error { - // Most well-known type messages do not contain required fields. The "Any" type may contain - // a message that has required fields. - // - // When an Any message is being marshaled, the code will invoked proto.Unmarshal on Any.Value - // field in order to transform that into JSON, and that should have returned an error if a - // required field is not set in the embedded message. - // - // When an Any message is being unmarshaled, the code will have invoked proto.Marshal on the - // embedded message to store the serialized message in Any.Value field, and that should have - // returned an error if a required field is not set. - if _, ok := pb.(isWkt); ok { - return nil - } - - v := reflect.ValueOf(pb) - // Skip message if it is not a struct pointer. - if v.Kind() != reflect.Ptr { - return nil - } - v = v.Elem() - if v.Kind() != reflect.Struct { - return nil - } - - for i := 0; i < v.NumField(); i++ { - field := v.Field(i) - sfield := v.Type().Field(i) - - if sfield.PkgPath != "" { - // blank PkgPath means the field is exported; skip if not exported - continue - } - - if strings.HasPrefix(sfield.Name, "XXX_") { - continue - } - - // Oneof field is an interface implemented by wrapper structs containing the actual oneof - // field, i.e. an interface containing &T{real_value}. - if sfield.Tag.Get("protobuf_oneof") != "" { - if field.Kind() != reflect.Interface { - continue - } - v := field.Elem() - if v.Kind() != reflect.Ptr || v.IsNil() { - continue - } - v = v.Elem() - if v.Kind() != reflect.Struct || v.NumField() < 1 { - continue - } - field = v.Field(0) - sfield = v.Type().Field(0) - } - - protoTag := sfield.Tag.Get("protobuf") - if protoTag == "" { - continue - } - var prop proto.Properties - prop.Init(sfield.Type, sfield.Name, protoTag, &sfield) - - switch field.Kind() { - case reflect.Map: - if field.IsNil() { - continue - } - // Check each map value. - keys := field.MapKeys() - for _, k := range keys { - v := field.MapIndex(k) - if err := checkRequiredFieldsInValue(v); err != nil { - return err - } - } - case reflect.Slice: - // Handle non-repeated type, e.g. bytes. - if !prop.Repeated { - if prop.Required && field.IsNil() { - return fmt.Errorf("required field %q is not set", prop.Name) - } - continue - } - - // Handle repeated type. - if field.IsNil() { - continue - } - // Check each slice item. - for i := 0; i < field.Len(); i++ { - v := field.Index(i) - if err := checkRequiredFieldsInValue(v); err != nil { - return err - } - } - case reflect.Ptr: - if field.IsNil() { - if prop.Required { - return fmt.Errorf("required field %q is not set", prop.Name) - } - continue - } - if err := checkRequiredFieldsInValue(field); err != nil { - return err - } - } - } - - // Handle proto2 extensions. - for _, ext := range proto.RegisteredExtensions(pb) { - if !proto.HasExtension(pb, ext) { - continue - } - ep, err := proto.GetExtension(pb, ext) - if err != nil { - return err - } - err = checkRequiredFieldsInValue(reflect.ValueOf(ep)) - if err != nil { - return err - } - } - - return nil -} - -func checkRequiredFieldsInValue(v reflect.Value) error { - if v.Type().Implements(messageType) { - return checkRequiredFields(v.Interface().(proto.Message)) - } - return nil -} diff --git a/src/runtime/vendor/modules.txt b/src/runtime/vendor/modules.txt index d594a7aa75..f50f3bdb92 100644 --- a/src/runtime/vendor/modules.txt +++ b/src/runtime/vendor/modules.txt @@ -222,7 +222,6 @@ github.com/godbus/dbus/v5 # github.com/gogo/protobuf v1.3.2 ## explicit; go 1.15 github.com/gogo/protobuf/gogoproto -github.com/gogo/protobuf/jsonpb github.com/gogo/protobuf/proto github.com/gogo/protobuf/protoc-gen-gogo/descriptor github.com/gogo/protobuf/sortkeys diff --git a/src/tools/agent-ctl/Cargo.lock b/src/tools/agent-ctl/Cargo.lock index 8f536f1303..5fd51e13b7 100644 --- a/src/tools/agent-ctl/Cargo.lock +++ b/src/tools/agent-ctl/Cargo.lock @@ -49,13 +49,12 @@ checksum = "bddcadddf5e9015d310179a59bb28c4d4b9920ad0f11e8e14dbadf654890c9a6" [[package]] name = "async-broadcast" -version = "0.4.1" +version = "0.5.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6d26004fe83b2d1cd3a97609b21e39f9a31535822210fe83205d2ce48866ea61" +checksum = "7c48ccdbf6ca6b121e0f586cbc0e73ae440e56c67c30fa0873b4e110d9c26d2b" dependencies = [ "event-listener", "futures-core", - "parking_lot", ] [[package]] @@ -83,6 +82,18 @@ dependencies = [ "slab", ] +[[package]] +name = "async-fs" +version = "1.6.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "279cf904654eeebfa37ac9bb1598880884924aab82e290aa65c9e77a0e142e06" +dependencies = [ + "async-lock", + "autocfg", + "blocking", + "futures-lite", +] + [[package]] name = "async-io" version = "1.13.0" @@ -113,14 +124,32 @@ dependencies = [ ] [[package]] -name = "async-recursion" -version = "0.3.2" +name = "async-process" +version = "1.7.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d7d78656ba01f1b93024b7c3a0467f1608e4be67d725749fdcd7d2c7678fd7a2" +checksum = "7a9d28b1d97e08915212e2e45310d47854eafa69600756fc735fb788f75199c9" +dependencies = [ + "async-io", + "async-lock", + "autocfg", + "blocking", + "cfg-if 1.0.0", + "event-listener", + "futures-lite", + "rustix", + "signal-hook", + "windows-sys 0.48.0", +] + +[[package]] +name = "async-recursion" +version = "1.0.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "5fd55a5ba1179988837d24ab4c7cc8ed6efdeff578ede0416b4225a5fca35bd0" dependencies = [ "proc-macro2", "quote", - "syn 1.0.109", + "syn 2.0.18", ] [[package]] @@ -140,6 +169,12 @@ dependencies = [ "syn 2.0.18", ] +[[package]] +name = "atomic-waker" +version = "1.1.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1181e1e0d1fce796a03db1ae795d67167da795f9cf4a39c37589e85ef57f26d3" + [[package]] name = "atty" version = "0.2.14" @@ -185,6 +220,30 @@ dependencies = [ "syn 1.0.109", ] +[[package]] +name = "block-buffer" +version = "0.10.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "3078c7629b62d3f0439517fa394996acacc5cbc91c5a20d8c658e77abd503a71" +dependencies = [ + "generic-array", +] + +[[package]] +name = "blocking" +version = "1.3.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "77231a1c8f801696fc0123ec6150ce92cffb8e164a02afb9c8ddee0e9b65ad65" +dependencies = [ + "async-channel", + "async-lock", + "async-task", + "atomic-waker", + "fastrand", + "futures-lite", + "log", +] + [[package]] name = "bumpalo" version = "3.13.0" @@ -312,6 +371,15 @@ version = "0.8.4" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "e496a50fda8aacccc86d7529e2c1e0892dbd0f898a6b5645b5561b89c3210efa" +[[package]] +name = "cpufeatures" +version = "0.2.9" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a17b76ff3a4162b0b27f354a0c87015ddad39d35f9c0c36607a3bdd175dde1f1" +dependencies = [ + "libc", +] + [[package]] name = "crossbeam-channel" version = "0.5.8" @@ -331,6 +399,16 @@ dependencies = [ "cfg-if 1.0.0", ] +[[package]] +name = "crypto-common" +version = "0.1.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1bfb12502f3fc46cca1bb51ac28df9d618d813cdc3d2f25b9fe775a34af26bb3" +dependencies = [ + "generic-array", + "typenum", +] + [[package]] name = "derivative" version = "2.2.0" @@ -354,19 +432,30 @@ dependencies = [ ] [[package]] -name = "dirs" -version = "4.0.0" +name = "digest" +version = "0.10.7" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ca3aa72a6f96ea37bbc5aa912f6788242832f75369bdfdadcb0e38423f100059" +checksum = "9ed9a281f7bc9b7576e61468ba615a66a5c8cfdff42420a70aa82701a3b1e292" dependencies = [ - "dirs-sys", + "block-buffer", + "crypto-common", ] [[package]] -name = "dirs-sys" -version = "0.3.7" +name = "dirs-next" +version = "2.0.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1b1d1d91c932ef41c0f2663aa8b0ca0342d444d842c06914aa0a7e352d0bada6" +checksum = "b98cf8ebf19c3d1b223e151f99a4f9f0690dca41414773390fc824184ac833e1" +dependencies = [ + "cfg-if 1.0.0", + "dirs-sys-next", +] + +[[package]] +name = "dirs-sys-next" +version = "0.1.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "4ebda144c4fe02d1f7ea1a7d9641b6fc6b580adcfa024ae48797ecdeb6825b4d" dependencies = [ "libc", "redox_users", @@ -557,6 +646,16 @@ dependencies = [ "slab", ] +[[package]] +name = "generic-array" +version = "0.14.7" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "85649ca51fd72272d7821adaf274ad91c288277713d9c18820d8499a7ff69e9a" +dependencies = [ + "typenum", + "version_check", +] + [[package]] name = "getrandom" version = "0.2.9" @@ -753,6 +852,7 @@ dependencies = [ name = "kata-sys-util" version = "0.1.0" dependencies = [ + "anyhow", "byteorder", "cgroups-rs", "chrono", @@ -812,16 +912,6 @@ version = "0.3.8" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "ef53942eb7bf7ff43a617b3e2c1c4a5ecf5944a7c1bc12d7ee39bbb15e5c1519" -[[package]] -name = "lock_api" -version = "0.4.9" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "435011366fe56583b16cf956f9df0095b405b82d76425bc8981c0e22e60ec4df" -dependencies = [ - "autocfg", - "scopeguard", -] - [[package]] name = "log" version = "0.4.18" @@ -837,6 +927,7 @@ dependencies = [ "slog-async", "slog-json", "slog-scope", + "slog-term", ] [[package]] @@ -854,6 +945,15 @@ dependencies = [ "autocfg", ] +[[package]] +name = "memoffset" +version = "0.7.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "5de893c32cde5f383baa4c04c5d6dbdd735cfd4a794b0debdb2bb1b421da5ff4" +dependencies = [ + "autocfg", +] + [[package]] name = "mio" version = "0.8.8" @@ -881,7 +981,7 @@ dependencies = [ "cc", "cfg-if 1.0.0", "libc", - "memoffset", + "memoffset 0.6.5", ] [[package]] @@ -893,7 +993,7 @@ dependencies = [ "bitflags", "cfg-if 1.0.0", "libc", - "memoffset", + "memoffset 0.6.5", ] [[package]] @@ -908,6 +1008,18 @@ dependencies = [ "libc", ] +[[package]] +name = "nix" +version = "0.26.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "598beaf3cc6fdd9a5dfb1630c2800c7acd31df7aaf0f565796fba2b53ca1af1b" +dependencies = [ + "bitflags", + "cfg-if 1.0.0", + "libc", + "memoffset 0.7.1", +] + [[package]] name = "num-traits" version = "0.2.15" @@ -927,6 +1039,15 @@ dependencies = [ "libc", ] +[[package]] +name = "num_threads" +version = "0.1.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "2819ce041d2ee131036f4fc9d6ae7ae125a3a40e97ba64d04fe799ad9dabbb44" +dependencies = [ + "libc", +] + [[package]] name = "oci" version = "0.1.0" @@ -945,9 +1066,9 @@ checksum = "dd8b5dd2ae5ed71462c540258bedcb51965123ad7e7ccf4b9a8cafaa4a63576d" [[package]] name = "ordered-stream" -version = "0.0.1" +version = "0.2.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "44630c059eacfd6e08bdaa51b1db2ce33119caa4ddc1235e923109aa5f25ccb1" +checksum = "9aa2b01e1d916879f73a53d01d1d6cee68adbb31d6d9177a8cfce093cced1d50" dependencies = [ "futures-core", "pin-project-lite", @@ -959,29 +1080,6 @@ version = "2.1.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "14f2252c834a40ed9bb5422029649578e63aa341ac401f74e719dd1afda8394e" -[[package]] -name = "parking_lot" -version = "0.12.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3742b2c103b9f06bc9fff0a37ff4912935851bee6d36f3c02bcc755bcfec228f" -dependencies = [ - "lock_api", - "parking_lot_core", -] - -[[package]] -name = "parking_lot_core" -version = "0.9.7" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9069cbb9f99e3a5083476ccb29ceb1de18b9118cafa53e90c9551235de2b9521" -dependencies = [ - "cfg-if 1.0.0", - "libc", - "redox_syscall 0.2.16", - "smallvec", - "windows-sys 0.45.0", -] - [[package]] name = "path-absolutize" version = "1.2.1" @@ -1336,6 +1434,12 @@ dependencies = [ "zbus", ] +[[package]] +name = "rustversion" +version = "1.0.14" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "7ffc183a10b4478d04cbbbfc96d0873219d962dd5accaff2ffbd4ceb7df837f4" + [[package]] name = "ryu" version = "1.0.13" @@ -1408,18 +1512,24 @@ dependencies = [ [[package]] name = "sha1" -version = "0.6.1" +version = "0.10.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c1da05c97445caa12d05e848c4a4fcbbea29e748ac28f7e80e9b010392063770" +checksum = "f04293dc80c3993519f2d7f6f511707ee7094fe0c6d3406feb330cdb3540eba3" dependencies = [ - "sha1_smol", + "cfg-if 1.0.0", + "cpufeatures", + "digest", ] [[package]] -name = "sha1_smol" -version = "1.0.0" +name = "signal-hook" +version = "0.3.17" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ae1a47186c03a32177042e55dbc5fd5aee900b8e0069a8d70fba96a9375cd012" +checksum = "8621587d4798caf8eb44879d42e56b9a93ea5dcd315a6487c357130095b62801" +dependencies = [ + "libc", + "signal-hook-registry", +] [[package]] name = "signal-hook-registry" @@ -1487,10 +1597,17 @@ dependencies = [ ] [[package]] -name = "smallvec" -version = "1.10.0" +name = "slog-term" +version = "2.9.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a507befe795404456341dfab10cef66ead4c041f62b8b11bbb92bffe5d0953e0" +checksum = "87d29185c55b7b258b4f120eab00f48557d4d9bc814f41713f449d35b0f8977c" +dependencies = [ + "atty", + "slog", + "term", + "thread_local", + "time 0.3.21", +] [[package]] name = "socket2" @@ -1565,6 +1682,17 @@ dependencies = [ "windows-sys 0.45.0", ] +[[package]] +name = "term" +version = "0.7.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c59df8ac95d96ff9bede18eb7300b0fda5e5d8d90960e76f8e14ae765eedbf1f" +dependencies = [ + "dirs-next", + "rustversion", + "winapi", +] + [[package]] name = "textwrap" version = "0.11.0" @@ -1622,6 +1750,8 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "8f3403384eaacbca9923fa06940178ac13e4edb725486d70e8e15881d0c836cc" dependencies = [ "itoa", + "libc", + "num_threads", "serde", "time-core", "time-macros", @@ -1770,6 +1900,12 @@ dependencies = [ "tempfile", ] +[[package]] +name = "typenum" +version = "1.16.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "497961ef93d974e23eb6f433eb5fe1b7930b659f06d12dec6fc44a8f554c0bba" + [[package]] name = "uds_windows" version = "1.0.2" @@ -1804,6 +1940,12 @@ version = "0.8.2" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "f1bddf1187be692e79c5ffeab891132dfb0f236ed36a43c7ed39f1165ee20191" +[[package]] +name = "version_check" +version = "0.9.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "49874b5167b65d7193b8aba1567f5c7d93d001cafc34600cee003eda787e483f" + [[package]] name = "waker-fn" version = "1.1.0" @@ -2069,30 +2211,40 @@ dependencies = [ ] [[package]] -name = "zbus" -version = "2.3.2" +name = "xdg-home" +version = "1.0.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2d8f1a037b2c4a67d9654dc7bdfa8ff2e80555bbefdd3c1833c1d1b27c963a6b" +checksum = "2769203cd13a0c6015d515be729c526d041e9cf2c0cc478d57faee85f40c6dcd" +dependencies = [ + "nix 0.26.4", + "winapi", +] + +[[package]] +name = "zbus" +version = "3.14.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "31de390a2d872e4cd04edd71b425e29853f786dc99317ed72d73d6fcf5ebb948" dependencies = [ "async-broadcast", - "async-channel", "async-executor", + "async-fs", "async-io", "async-lock", + "async-process", "async-recursion", "async-task", "async-trait", + "blocking", "byteorder", "derivative", - "dirs", "enumflags2", "event-listener", "futures-core", "futures-sink", "futures-util", "hex", - "lazy_static", - "nix 0.23.2", + "nix 0.26.4", "once_cell", "ordered-stream", "rand", @@ -2103,6 +2255,7 @@ dependencies = [ "tracing", "uds_windows", "winapi", + "xdg-home", "zbus_macros", "zbus_names", "zvariant", @@ -2110,22 +2263,23 @@ dependencies = [ [[package]] name = "zbus_macros" -version = "2.3.2" +version = "3.14.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1f8fb5186d1c87ae88cf234974c240671238b4a679158ad3b94ec465237349a6" +checksum = "41d1794a946878c0e807f55a397187c11fc7a038ba5d868e7db4f3bd7760bc9d" dependencies = [ "proc-macro-crate", "proc-macro2", "quote", "regex", "syn 1.0.109", + "zvariant_utils", ] [[package]] name = "zbus_names" -version = "2.5.1" +version = "2.6.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "82441e6033be0a741157a72951a3e4957d519698f3a824439cc131c5ba77ac2a" +checksum = "fb80bb776dbda6e23d705cf0123c3b95df99c4ebeaec6c2599d4a5419902b4a9" dependencies = [ "serde", "static_assertions", @@ -2134,9 +2288,9 @@ dependencies = [ [[package]] name = "zvariant" -version = "3.14.0" +version = "3.15.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "622cc473f10cef1b0d73b7b34a266be30ebdcfaea40ec297dd8cbda088f9f93c" +checksum = "44b291bee0d960c53170780af148dca5fa260a63cdd24f1962fa82e03e53338c" dependencies = [ "byteorder", "enumflags2", @@ -2148,9 +2302,9 @@ dependencies = [ [[package]] name = "zvariant_derive" -version = "3.14.0" +version = "3.15.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5d9c1b57352c25b778257c661f3c4744b7cefb7fc09dd46909a153cce7773da2" +checksum = "934d7a7dfc310d6ee06c87ffe88ef4eca7d3e37bb251dece2ef93da8f17d8ecd" dependencies = [ "proc-macro-crate", "proc-macro2", diff --git a/src/tools/runk/Cargo.lock b/src/tools/runk/Cargo.lock index f653ba9ccb..3c377bb8d9 100644 --- a/src/tools/runk/Cargo.lock +++ b/src/tools/runk/Cargo.lock @@ -31,13 +31,12 @@ checksum = "c5d78ce20460b82d3fa150275ed9d55e21064fc7951177baacf86a145c4a4b1f" [[package]] name = "async-broadcast" -version = "0.4.1" +version = "0.5.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6d26004fe83b2d1cd3a97609b21e39f9a31535822210fe83205d2ce48866ea61" +checksum = "7c48ccdbf6ca6b121e0f586cbc0e73ae440e56c67c30fa0873b4e110d9c26d2b" dependencies = [ "event-listener", "futures-core", - "parking_lot", ] [[package]] @@ -46,63 +45,93 @@ version = "1.7.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "e14485364214912d3b19cc3435dde4df66065127f05fa0d75c712f36f12c2f28" dependencies = [ - "concurrent-queue", + "concurrent-queue 1.2.4", "event-listener", "futures-core", ] [[package]] name = "async-executor" -version = "1.4.1" +version = "1.5.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "871f9bb5e0a22eeb7e8cf16641feb87c9dc67032ccf8ff49e772eb9941d3a965" +checksum = "6fa3dc5f2a8564f07759c008b9109dc0d39de92a88d5588b8a5036d286383afb" dependencies = [ + "async-lock", "async-task", - "concurrent-queue", + "concurrent-queue 2.2.0", "fastrand", "futures-lite", - "once_cell", "slab", ] +[[package]] +name = "async-fs" +version = "1.6.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "279cf904654eeebfa37ac9bb1598880884924aab82e290aa65c9e77a0e142e06" +dependencies = [ + "async-lock", + "autocfg", + "blocking", + "futures-lite", +] + [[package]] name = "async-io" -version = "1.9.0" +version = "1.13.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "83e21f3a490c72b3b0cf44962180e60045de2925d8dff97918f7ee43c8f637c7" +checksum = "0fc5b45d93ef0529756f812ca52e44c221b35341892d3dcc34132ac02f3dd2af" dependencies = [ + "async-lock", "autocfg", - "concurrent-queue", + "cfg-if 1.0.0", + "concurrent-queue 2.2.0", "futures-lite", - "libc", "log", - "once_cell", "parking", "polling", + "rustix 0.37.23", "slab", "socket2", "waker-fn", - "winapi", ] [[package]] name = "async-lock" -version = "2.5.0" +version = "2.8.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e97a171d191782fba31bb902b14ad94e24a68145032b7eedf871ab0bc0d077b6" +checksum = "287272293e9d8c41773cec55e365490fe034813a2f172f502d6ddcf75b2f582b" dependencies = [ "event-listener", ] [[package]] -name = "async-recursion" -version = "0.3.2" +name = "async-process" +version = "1.7.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d7d78656ba01f1b93024b7c3a0467f1608e4be67d725749fdcd7d2c7678fd7a2" +checksum = "7a9d28b1d97e08915212e2e45310d47854eafa69600756fc735fb788f75199c9" +dependencies = [ + "async-io", + "async-lock", + "autocfg", + "blocking", + "cfg-if 1.0.0", + "event-listener", + "futures-lite", + "rustix 0.37.23", + "signal-hook", + "windows-sys 0.48.0", +] + +[[package]] +name = "async-recursion" +version = "1.0.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "5fd55a5ba1179988837d24ab4c7cc8ed6efdeff578ede0416b4225a5fca35bd0" dependencies = [ "proc-macro2", "quote", - "syn 1.0.91", + "syn 2.0.16", ] [[package]] @@ -113,22 +142,28 @@ checksum = "7a40729d2133846d9ed0ea60a8b9541bccddab49cd30f0715a1da672fe9a2524" [[package]] name = "async-trait" -version = "0.1.53" +version = "0.1.69" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ed6aa3524a2dfcf9fe180c51eae2b58738348d819517ceadf95789c51fff7600" +checksum = "7b2d0f03b3640e3a630367e40c468cb7f309529c708ed1d88597047b0e7c6ef7" dependencies = [ "proc-macro2", "quote", - "syn 1.0.91", + "syn 2.0.16", ] +[[package]] +name = "atomic-waker" +version = "1.1.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1181e1e0d1fce796a03db1ae795d67167da795f9cf4a39c37589e85ef57f26d3" + [[package]] name = "atty" version = "0.2.14" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "d9b39be18770d11421cdb1b9947a45dd3f37e93092cbf377614828a319d5fee8" dependencies = [ - "hermit-abi", + "hermit-abi 0.1.19", "libc", "winapi", ] @@ -164,7 +199,31 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "fd9e32d7420c85055e8107e5b2463c4eeefeaac18b52359fe9f9c08a18f342b2" dependencies = [ "quote", - "syn 1.0.91", + "syn 1.0.109", +] + +[[package]] +name = "block-buffer" +version = "0.10.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "3078c7629b62d3f0439517fa394996acacc5cbc91c5a20d8c658e77abd503a71" +dependencies = [ + "generic-array", +] + +[[package]] +name = "blocking" +version = "1.3.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "77231a1c8f801696fc0123ec6150ce92cffb8e164a02afb9c8ddee0e9b65ad65" +dependencies = [ + "async-channel", + "async-lock", + "async-task", + "atomic-waker", + "fastrand", + "futures-lite", + "log", ] [[package]] @@ -208,7 +267,7 @@ version = "0.5.3" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "61bf7211aad104ce2769ec05efcdfabf85ee84ac92461d142f22cf8badd0e54c" dependencies = [ - "errno", + "errno 0.2.8", "libc", "thiserror", ] @@ -285,7 +344,7 @@ dependencies = [ "proc-macro-error", "proc-macro2", "quote", - "syn 1.0.91", + "syn 1.0.109", ] [[package]] @@ -312,6 +371,24 @@ dependencies = [ "cache-padded", ] +[[package]] +name = "concurrent-queue" +version = "2.2.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "62ec6771ecfa0762d24683ee5a32ad78487a3d3afdc0fb8cae19d2c5deb50b7c" +dependencies = [ + "crossbeam-utils", +] + +[[package]] +name = "cpufeatures" +version = "0.2.9" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a17b76ff3a4162b0b27f354a0c87015ddad39d35f9c0c36607a3bdd175dde1f1" +dependencies = [ + "libc", +] + [[package]] name = "crc32fast" version = "1.3.2" @@ -333,12 +410,21 @@ dependencies = [ [[package]] name = "crossbeam-utils" -version = "0.8.8" +version = "0.8.16" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0bf124c720b7686e3c2663cf54062ab0f68a88af2fb6a030e87e30bf721fcb38" +checksum = "5a22b2d63d4d1dc0b7f1b6b2747dd0088008a9be28b6ddf0b1e7d335e3037294" dependencies = [ "cfg-if 1.0.0", - "lazy_static", +] + +[[package]] +name = "crypto-common" +version = "0.1.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1bfb12502f3fc46cca1bb51ac28df9d618d813cdc3d2f25b9fe775a34af26bb3" +dependencies = [ + "generic-array", + "typenum", ] [[package]] @@ -362,7 +448,7 @@ dependencies = [ "proc-macro2", "quote", "strsim", - "syn 1.0.91", + "syn 1.0.109", ] [[package]] @@ -373,7 +459,7 @@ checksum = "29b5acf0dea37a7f66f7b25d2c5e93fd46f8f6968b1a5d7a3e02e97768afc95a" dependencies = [ "darling_core", "quote", - "syn 1.0.91", + "syn 1.0.109", ] [[package]] @@ -384,7 +470,7 @@ checksum = "fcc3dd5e9e9c0b295d6e1e4d811fb6f157d5ffd784b8d202fc62eac8035a770b" dependencies = [ "proc-macro2", "quote", - "syn 1.0.91", + "syn 1.0.109", ] [[package]] @@ -395,7 +481,7 @@ checksum = "3418329ca0ad70234b9735dc4ceed10af4df60eff9c8e7b06cb5e520d92c3535" dependencies = [ "proc-macro2", "quote", - "syn 1.0.91", + "syn 1.0.109", ] [[package]] @@ -416,7 +502,7 @@ dependencies = [ "darling", "proc-macro2", "quote", - "syn 1.0.91", + "syn 1.0.109", ] [[package]] @@ -426,16 +512,17 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "58a94ace95092c5acb1e97a7e846b310cfbd499652f72297da7493f618a98d73" dependencies = [ "derive_builder_core", - "syn 1.0.91", + "syn 1.0.109", ] [[package]] -name = "dirs" -version = "4.0.0" +name = "digest" +version = "0.10.7" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ca3aa72a6f96ea37bbc5aa912f6788242832f75369bdfdadcb0e38423f100059" +checksum = "9ed9a281f7bc9b7576e61468ba615a66a5c8cfdff42420a70aa82701a3b1e292" dependencies = [ - "dirs-sys", + "block-buffer", + "crypto-common", ] [[package]] @@ -448,17 +535,6 @@ dependencies = [ "dirs-sys-next", ] -[[package]] -name = "dirs-sys" -version = "0.3.7" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1b1d1d91c932ef41c0f2663aa8b0ca0342d444d842c06914aa0a7e352d0bada6" -dependencies = [ - "libc", - "redox_users", - "winapi", -] - [[package]] name = "dirs-sys-next" version = "0.1.2" @@ -478,9 +554,9 @@ checksum = "e78d4f1cc4ae33bbfc157ed5d5a5ef3bc29227303d595861deb238fcec4e9457" [[package]] name = "enumflags2" -version = "0.7.5" +version = "0.7.8" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e75d4cd21b95383444831539909fbb14b9dc3fdceb2a6f5d36577329a1f55ccb" +checksum = "5998b4f30320c9d93aed72f63af821bfdac50465b75428fce77b48ec482c3939" dependencies = [ "enumflags2_derive", "serde", @@ -488,13 +564,13 @@ dependencies = [ [[package]] name = "enumflags2_derive" -version = "0.7.4" +version = "0.7.8" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f58dc3c5e468259f19f2d46304a6b28f1c3d034442e14b322d2b850e36f6d5ae" +checksum = "f95e2801cd355d4a1a3e3953ce6ee5ae9603a5c833455343a8bfe3f44d418246" dependencies = [ "proc-macro2", "quote", - "syn 1.0.91", + "syn 2.0.16", ] [[package]] @@ -508,6 +584,17 @@ dependencies = [ "winapi", ] +[[package]] +name = "errno" +version = "0.3.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "136526188508e25c6fef639d7927dfb3e0e3084488bf202267829cf7fc23dbdd" +dependencies = [ + "errno-dragonfly", + "libc", + "windows-sys 0.48.0", +] + [[package]] name = "errno-dragonfly" version = "0.1.2" @@ -583,9 +670,9 @@ dependencies = [ [[package]] name = "futures-channel" -version = "0.3.21" +version = "0.3.28" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c3083ce4b914124575708913bca19bfe887522d6e2e6d0952943f5eac4a74010" +checksum = "955518d47e09b25bbebc7a18df10b81f0c766eaf4c4f1cccef2fca5f2a4fb5f2" dependencies = [ "futures-core", "futures-sink", @@ -593,9 +680,9 @@ dependencies = [ [[package]] name = "futures-core" -version = "0.3.21" +version = "0.3.28" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0c09fd04b7e4073ac7156a9539b57a484a8ea920f79c7c675d05d289ab6110d3" +checksum = "4bca583b7e26f571124fe5b7561d49cb2868d79116cfa0eefce955557c6fee8c" [[package]] name = "futures-executor" @@ -610,9 +697,9 @@ dependencies = [ [[package]] name = "futures-io" -version = "0.3.21" +version = "0.3.28" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "fc4045962a5a5e935ee2fdedaa4e08284547402885ab326734432bed5d12966b" +checksum = "4fff74096e71ed47f8e023204cfd0aa1289cd54ae5430a9523be060cdb849964" [[package]] name = "futures-lite" @@ -631,32 +718,32 @@ dependencies = [ [[package]] name = "futures-macro" -version = "0.3.21" +version = "0.3.28" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "33c1e13800337f4d4d7a316bf45a567dbcb6ffe087f16424852d97e97a91f512" +checksum = "89ca545a94061b6365f2c7355b4b32bd20df3ff95f02da9329b34ccc3bd6ee72" dependencies = [ "proc-macro2", "quote", - "syn 1.0.91", + "syn 2.0.16", ] [[package]] name = "futures-sink" -version = "0.3.21" +version = "0.3.28" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "21163e139fa306126e6eedaf49ecdb4588f939600f0b1e770f4205ee4b7fa868" +checksum = "f43be4fe21a13b9781a69afa4985b0f6ee0e1afab2c6f454a8cf30e2b2237b6e" [[package]] name = "futures-task" -version = "0.3.21" +version = "0.3.28" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "57c66a976bf5909d801bbef33416c41372779507e7a6b3a5e25e4749c58f776a" +checksum = "76d3d132be6c0e6aa1534069c705a74a5997a356c0dc2f86a47765e5617c5b65" [[package]] name = "futures-util" -version = "0.3.21" +version = "0.3.28" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d8b7abd5d659d9b90c8cba917f6ec750a74e2dc23902ef9cd4cc8c8b22e6036a" +checksum = "26b01e40b772d54cf6c6d721c1d1abd0647a0106a12ecaa1c186273392a69533" dependencies = [ "futures-channel", "futures-core", @@ -670,6 +757,16 @@ dependencies = [ "slab", ] +[[package]] +name = "generic-array" +version = "0.14.7" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "85649ca51fd72272d7821adaf274ad91c288277713d9c18820d8499a7ff69e9a" +dependencies = [ + "typenum", + "version_check", +] + [[package]] name = "getrandom" version = "0.2.7" @@ -717,6 +814,12 @@ dependencies = [ "libc", ] +[[package]] +name = "hermit-abi" +version = "0.3.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "443144c8cdadd93ebf52ddb4056d257f5b52c04d3c804e657d19eb73fc33668b" + [[package]] name = "hex" version = "0.4.3" @@ -776,6 +879,17 @@ version = "0.7.2" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "24c3f4eff5495aee4c0399d7b6a0dc2b6e81be84242ffbfcf253ebacccc1d0cb" +[[package]] +name = "io-lifetimes" +version = "1.0.11" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "eae7b9aee968036d54dce06cebaefd919e4472e753296daccd6d344e3e2df0c2" +dependencies = [ + "hermit-abi 0.3.2", + "libc", + "windows-sys 0.48.0", +] + [[package]] name = "itertools" version = "0.10.3" @@ -905,6 +1019,12 @@ version = "0.0.46" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "d4d2456c373231a208ad294c33dc5bff30051eafd954cd4caae83a712b12854d" +[[package]] +name = "linux-raw-sys" +version = "0.3.8" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ef53942eb7bf7ff43a617b3e2c1c4a5ecf5944a7c1bc12d7ee39bbb15e5c1519" + [[package]] name = "lock_api" version = "0.4.7" @@ -917,12 +1037,9 @@ dependencies = [ [[package]] name = "log" -version = "0.4.16" +version = "0.4.20" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6389c490849ff5bc16be905ae24bc913a9c8892e19b2341dbc175e14c341c2b8" -dependencies = [ - "cfg-if 1.0.0", -] +checksum = "b5e6163cb8c49088c2c36f57875e58ccd8c87c7427f7fbd50ea6710b2f3f2e8f" [[package]] name = "logging" @@ -951,6 +1068,15 @@ dependencies = [ "autocfg", ] +[[package]] +name = "memoffset" +version = "0.7.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "5de893c32cde5f383baa4c04c5d6dbdd735cfd4a794b0debdb2bb1b421da5ff4" +dependencies = [ + "autocfg", +] + [[package]] name = "miniz_oxide" version = "0.5.3" @@ -988,7 +1114,7 @@ dependencies = [ "cc", "cfg-if 1.0.0", "libc", - "memoffset", + "memoffset 0.6.5", ] [[package]] @@ -1000,7 +1126,7 @@ dependencies = [ "bitflags", "cfg-if 1.0.0", "libc", - "memoffset", + "memoffset 0.6.5", ] [[package]] @@ -1015,6 +1141,18 @@ dependencies = [ "libc", ] +[[package]] +name = "nix" +version = "0.26.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "598beaf3cc6fdd9a5dfb1630c2800c7acd31df7aaf0f565796fba2b53ca1af1b" +dependencies = [ + "bitflags", + "cfg-if 1.0.0", + "libc", + "memoffset 0.7.1", +] + [[package]] name = "num-integer" version = "0.1.44" @@ -1040,7 +1178,7 @@ version = "1.13.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "19e64526ebdee182341572e50e9ad03965aa510cd94427a4549448f285e957a1" dependencies = [ - "hermit-abi", + "hermit-abi 0.1.19", "libc", ] @@ -1071,9 +1209,9 @@ checksum = "2f7254b99e31cad77da24b08ebf628882739a608578bb1bcdfc1f9c21260d7c0" [[package]] name = "ordered-stream" -version = "0.0.1" +version = "0.2.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "44630c059eacfd6e08bdaa51b1db2ce33119caa4ddc1235e923109aa5f25ccb1" +checksum = "9aa2b01e1d916879f73a53d01d1d6cee68adbb31d6d9177a8cfce093cced1d50" dependencies = [ "futures-core", "pin-project-lite", @@ -1201,7 +1339,7 @@ dependencies = [ "proc-macro-error-attr", "proc-macro2", "quote", - "syn 1.0.91", + "syn 1.0.109", "version_check", ] @@ -1237,7 +1375,7 @@ dependencies = [ "flate2", "hex", "lazy_static", - "rustix", + "rustix 0.35.7", ] [[package]] @@ -1278,7 +1416,7 @@ dependencies = [ "itertools", "proc-macro2", "quote", - "syn 1.0.91", + "syn 1.0.109", ] [[package]] @@ -1492,13 +1630,27 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "d51cc38aa10f6bbb377ed28197aa052aa4e2b762c22be9d3153d01822587e787" dependencies = [ "bitflags", - "errno", - "io-lifetimes", + "errno 0.2.8", + "io-lifetimes 0.7.2", "libc", - "linux-raw-sys", + "linux-raw-sys 0.0.46", "windows-sys 0.36.1", ] +[[package]] +name = "rustix" +version = "0.37.23" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "4d69718bf81c6127a49dc64e44a742e8bb9213c0ff8869a22c308f84c1d4ab06" +dependencies = [ + "bitflags", + "errno 0.3.3", + "io-lifetimes 1.0.11", + "libc", + "linux-raw-sys 0.3.8", + "windows-sys 0.48.0", +] + [[package]] name = "rustjail" version = "0.1.0" @@ -1586,7 +1738,7 @@ checksum = "08597e7152fcd306f41838ed3e37be9eaeed2b61c42e2117266a554fab4662f9" dependencies = [ "proc-macro2", "quote", - "syn 1.0.91", + "syn 1.0.109", ] [[package]] @@ -1608,23 +1760,29 @@ checksum = "1fe39d9fbb0ebf5eb2c7cb7e2a47e4f462fad1379f1166b8ae49ad9eae89a7ca" dependencies = [ "proc-macro2", "quote", - "syn 1.0.91", + "syn 1.0.109", ] [[package]] name = "sha1" -version = "0.6.1" +version = "0.10.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c1da05c97445caa12d05e848c4a4fcbbea29e748ac28f7e80e9b010392063770" +checksum = "f04293dc80c3993519f2d7f6f511707ee7094fe0c6d3406feb330cdb3540eba3" dependencies = [ - "sha1_smol", + "cfg-if 1.0.0", + "cpufeatures", + "digest", ] [[package]] -name = "sha1_smol" -version = "1.0.0" +name = "signal-hook" +version = "0.3.17" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ae1a47186c03a32177042e55dbc5fd5aee900b8e0069a8d70fba96a9375cd012" +checksum = "8621587d4798caf8eb44879d42e56b9a93ea5dcd315a6487c357130095b62801" +dependencies = [ + "libc", + "signal-hook-registry", +] [[package]] name = "signal-hook-registry" @@ -1741,13 +1899,13 @@ dependencies = [ [[package]] name = "syn" -version = "1.0.91" +version = "1.0.109" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b683b2b825c8eef438b77c36a06dc262294da3d5a5813fac20da149241dcd44d" +checksum = "72b64191b275b66ffe2469e8af2c1cfe3bafa67b529ead792a6d0160888b4237" dependencies = [ "proc-macro2", "quote", - "unicode-xid", + "unicode-ident", ] [[package]] @@ -1840,7 +1998,7 @@ checksum = "aa32fd3f627f367fe16f893e2597ae3c05020f8bba2666a4e6ea73d377e5714b" dependencies = [ "proc-macro2", "quote", - "syn 1.0.91", + "syn 1.0.109", ] [[package]] @@ -1922,9 +2080,9 @@ dependencies = [ [[package]] name = "tracing" -version = "0.1.36" +version = "0.1.37" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2fce9567bd60a67d08a16488756721ba392f24f29006402881e43b19aac64307" +checksum = "8ce8c33a8d48bd45d624a6e523445fd21ec13d3653cd51f681abf67418f54eb8" dependencies = [ "cfg-if 1.0.0", "pin-project-lite", @@ -1934,20 +2092,20 @@ dependencies = [ [[package]] name = "tracing-attributes" -version = "0.1.22" +version = "0.1.26" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "11c75893af559bc8e10716548bdef5cb2b983f8e637db9d0e15126b61b484ee2" +checksum = "5f4f31f56159e98206da9efd823404b79b6ef3143b4a7ab76e67b1751b25a4ab" dependencies = [ "proc-macro2", "quote", - "syn 1.0.91", + "syn 2.0.16", ] [[package]] name = "tracing-core" -version = "0.1.29" +version = "0.1.31" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5aeea4303076558a00714b823f9ad67d58a3bbda1df83d8827d21193156e22f7" +checksum = "0955b8137a1df6f1a2e9a37d8a6656291ff0297c1a97c24e0d8425fe2312f79a" dependencies = [ "once_cell", ] @@ -1994,6 +2152,12 @@ dependencies = [ "tempfile", ] +[[package]] +name = "typenum" +version = "1.16.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "497961ef93d974e23eb6f433eb5fe1b7930b659f06d12dec6fc44a8f554c0bba" + [[package]] name = "uds_windows" version = "1.0.2" @@ -2022,12 +2186,6 @@ version = "0.1.9" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "3ed742d4ea2bd1176e236172c8429aaf54486e7ac098db29ffe6529e0ce50973" -[[package]] -name = "unicode-xid" -version = "0.2.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8ccb82d61f80a663efe1f787a51b16b5a51e3314d6ac365b08639f52387b33f3" - [[package]] name = "users" version = "0.11.0" @@ -2341,30 +2499,40 @@ dependencies = [ ] [[package]] -name = "zbus" -version = "2.3.2" +name = "xdg-home" +version = "1.0.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2d8f1a037b2c4a67d9654dc7bdfa8ff2e80555bbefdd3c1833c1d1b27c963a6b" +checksum = "2769203cd13a0c6015d515be729c526d041e9cf2c0cc478d57faee85f40c6dcd" +dependencies = [ + "nix 0.26.4", + "winapi", +] + +[[package]] +name = "zbus" +version = "3.14.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "31de390a2d872e4cd04edd71b425e29853f786dc99317ed72d73d6fcf5ebb948" dependencies = [ "async-broadcast", - "async-channel", "async-executor", + "async-fs", "async-io", "async-lock", + "async-process", "async-recursion", "async-task", "async-trait", + "blocking", "byteorder", "derivative", - "dirs", "enumflags2", "event-listener", "futures-core", "futures-sink", "futures-util", "hex", - "lazy_static", - "nix 0.23.1", + "nix 0.26.4", "once_cell", "ordered-stream", "rand", @@ -2375,6 +2543,7 @@ dependencies = [ "tracing", "uds_windows", "winapi", + "xdg-home", "zbus_macros", "zbus_names", "zvariant", @@ -2382,22 +2551,23 @@ dependencies = [ [[package]] name = "zbus_macros" -version = "2.3.2" +version = "3.14.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1f8fb5186d1c87ae88cf234974c240671238b4a679158ad3b94ec465237349a6" +checksum = "41d1794a946878c0e807f55a397187c11fc7a038ba5d868e7db4f3bd7760bc9d" dependencies = [ "proc-macro-crate", "proc-macro2", "quote", "regex", - "syn 1.0.91", + "syn 1.0.109", + "zvariant_utils", ] [[package]] name = "zbus_names" -version = "2.2.0" +version = "2.6.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "41a408fd8a352695690f53906dc7fd036be924ec51ea5e05666ff42685ed0af5" +checksum = "fb80bb776dbda6e23d705cf0123c3b95df99c4ebeaec6c2599d4a5419902b4a9" dependencies = [ "serde", "static_assertions", @@ -2406,9 +2576,9 @@ dependencies = [ [[package]] name = "zvariant" -version = "3.6.0" +version = "3.15.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1bd68e4e6432ef19df47d7e90e2e72b5e7e3d778e0ae3baddf12b951265cc758" +checksum = "44b291bee0d960c53170780af148dca5fa260a63cdd24f1962fa82e03e53338c" dependencies = [ "byteorder", "enumflags2", @@ -2420,12 +2590,24 @@ dependencies = [ [[package]] name = "zvariant_derive" -version = "3.6.0" +version = "3.15.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "08e977eaa3af652f63d479ce50d924254ad76722a6289ec1a1eac3231ca30430" +checksum = "934d7a7dfc310d6ee06c87ffe88ef4eca7d3e37bb251dece2ef93da8f17d8ecd" dependencies = [ "proc-macro-crate", "proc-macro2", "quote", - "syn 1.0.91", + "syn 1.0.109", + "zvariant_utils", +] + +[[package]] +name = "zvariant_utils" +version = "1.0.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "7234f0d811589db492d16893e3f21e8e2fd282e6d01b0cddee310322062cc200" +dependencies = [ + "proc-macro2", + "quote", + "syn 1.0.109", ] diff --git a/src/tools/trace-forwarder/Cargo.lock b/src/tools/trace-forwarder/Cargo.lock index 7a6a7c0ac7..7a1af6842f 100644 --- a/src/tools/trace-forwarder/Cargo.lock +++ b/src/tools/trace-forwarder/Cargo.lock @@ -31,7 +31,7 @@ checksum = "061a7acccaa286c011ddc30970520b98fa40e00c9d644633fb26b5fc63a265e3" dependencies = [ "proc-macro2", "quote", - "syn", + "syn 1.0.82", ] [[package]] @@ -99,7 +99,7 @@ dependencies = [ "js-sys", "num-integer", "num-traits", - "time", + "time 0.1.43", "wasm-bindgen", "winapi", ] @@ -139,6 +139,33 @@ dependencies = [ "lazy_static", ] +[[package]] +name = "deranged" +version = "0.3.8" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f2696e8a945f658fd14dc3b87242e6b80cd0f36ff04ea560fa39082368847946" + +[[package]] +name = "dirs-next" +version = "2.0.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b98cf8ebf19c3d1b223e151f99a4f9f0690dca41414773390fc824184ac833e1" +dependencies = [ + "cfg-if", + "dirs-sys-next", +] + +[[package]] +name = "dirs-sys-next" +version = "0.1.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "4ebda144c4fe02d1f7ea1a7d9641b6fc6b580adcfa024ae48797ecdeb6825b4d" +dependencies = [ + "libc", + "redox_users", + "winapi", +] + [[package]] name = "futures" version = "0.3.17" @@ -197,7 +224,7 @@ dependencies = [ "proc-macro-hack", "proc-macro2", "quote", - "syn", + "syn 1.0.82", ] [[package]] @@ -329,6 +356,7 @@ dependencies = [ "slog-async", "slog-json", "slog-scope", + "slog-term", ] [[package]] @@ -388,6 +416,15 @@ dependencies = [ "libc", ] +[[package]] +name = "num_threads" +version = "0.1.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "2819ce041d2ee131036f4fc9d6ae7ae125a3a40e97ba64d04fe799ad9dabbb44" +dependencies = [ + "libc", +] + [[package]] name = "once_cell" version = "1.9.0" @@ -474,7 +511,7 @@ checksum = "6e8fe8163d14ce7f0cdac2e040116f22eac817edabff0be91e8aff7e9accf389" dependencies = [ "proc-macro2", "quote", - "syn", + "syn 1.0.82", ] [[package]] @@ -519,18 +556,18 @@ checksum = "bc881b2c22681370c6a780e47af9840ef841837bc98118431d4e1868bd0c1086" [[package]] name = "proc-macro2" -version = "1.0.34" +version = "1.0.67" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2f84e92c0f7c9d58328b85a78557813e4bd845130db68d7184635344399423b1" +checksum = "3d433d9f1a3e8c1263d9456598b16fec66f4acc9a74dacffd35c7bb09b3a1328" dependencies = [ - "unicode-xid", + "unicode-ident", ] [[package]] name = "quote" -version = "1.0.10" +version = "1.0.33" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "38bc8cc6a5f2e3655e0899c1b848643b2562f853f114bfec7be120678e3ace05" +checksum = "5267fca4496028628a95160fc423a33e8b2e6af8a5302579e322e4b520293cae" dependencies = [ "proc-macro2", ] @@ -577,13 +614,24 @@ dependencies = [ [[package]] name = "redox_syscall" -version = "0.2.10" +version = "0.2.16" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8383f39639269cde97d255a32bdb68c047337295414940c68bdd30c2e13203ff" +checksum = "fb5a58c1855b4b6819d59012155603f0b22ad30cad752600aadfcb695265519a" dependencies = [ "bitflags", ] +[[package]] +name = "redox_users" +version = "0.4.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b033d837a7cf162d7993aded9304e30a83213c648b6e389db233191f891e5c2b" +dependencies = [ + "getrandom", + "redox_syscall", + "thiserror", +] + [[package]] name = "remove_dir_all" version = "0.5.3" @@ -593,6 +641,12 @@ dependencies = [ "winapi", ] +[[package]] +name = "rustversion" +version = "1.0.14" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "7ffc183a10b4478d04cbbbfc96d0873219d962dd5accaff2ffbd4ceb7df837f4" + [[package]] name = "ryu" version = "1.0.9" @@ -601,22 +655,22 @@ checksum = "73b4b750c782965c211b42f022f59af1fbceabdd026623714f104152f1ec149f" [[package]] name = "serde" -version = "1.0.132" +version = "1.0.188" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8b9875c23cf305cd1fd7eb77234cbb705f21ea6a72c637a5c6db5fe4b8e7f008" +checksum = "cf9e0fcba69a370eed61bcf2b728575f726b50b55cba78064753d708ddc7549e" dependencies = [ "serde_derive", ] [[package]] name = "serde_derive" -version = "1.0.132" +version = "1.0.188" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ecc0db5cb2556c0e558887d9bbdcf6ac4471e83ff66cf696e5419024d1606276" +checksum = "4eca7ac642d82aa35b60049a6eccb4be6be75e599bd2e9adb5f875a737654af2" dependencies = [ "proc-macro2", "quote", - "syn", + "syn 2.0.33", ] [[package]] @@ -686,6 +740,19 @@ dependencies = [ "slog", ] +[[package]] +name = "slog-term" +version = "2.9.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "87d29185c55b7b258b4f120eab00f48557d4d9bc814f41713f449d35b0f8977c" +dependencies = [ + "atty", + "slog", + "term", + "thread_local", + "time 0.3.28", +] + [[package]] name = "smallvec" version = "1.7.0" @@ -709,6 +776,17 @@ dependencies = [ "unicode-xid", ] +[[package]] +name = "syn" +version = "2.0.33" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "9caece70c63bfba29ec2fed841a09851b14a235c60010fa4de58089b6c025668" +dependencies = [ + "proc-macro2", + "quote", + "unicode-ident", +] + [[package]] name = "take_mut" version = "0.2.2" @@ -729,6 +807,17 @@ dependencies = [ "winapi", ] +[[package]] +name = "term" +version = "0.7.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c59df8ac95d96ff9bede18eb7300b0fda5e5d8d90960e76f8e14ae765eedbf1f" +dependencies = [ + "dirs-next", + "rustversion", + "winapi", +] + [[package]] name = "textwrap" version = "0.11.0" @@ -755,7 +844,7 @@ checksum = "aa32fd3f627f367fe16f893e2597ae3c05020f8bba2666a4e6ea73d377e5714b" dependencies = [ "proc-macro2", "quote", - "syn", + "syn 1.0.82", ] [[package]] @@ -799,6 +888,36 @@ dependencies = [ "winapi", ] +[[package]] +name = "time" +version = "0.3.28" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "17f6bb557fd245c28e6411aa56b6403c689ad95061f50e4be16c274e70a17e48" +dependencies = [ + "deranged", + "itoa", + "libc", + "num_threads", + "serde", + "time-core", + "time-macros", +] + +[[package]] +name = "time-core" +version = "0.1.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "7300fbefb4dadc1af235a9cef3737cea692a9d97e1b9cbcd4ebdae6f8868e6fb" + +[[package]] +name = "time-macros" +version = "0.2.14" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1a942f44339478ef67935ab2bbaec2fb0322496cf3cbe84b261e06ac3814c572" +dependencies = [ + "time-core", +] + [[package]] name = "tracing" version = "0.1.29" @@ -819,7 +938,7 @@ checksum = "f4f480b8f81512e825f337ad51e94c1eb5d3bbdf2b363dcd01e2b19a9ffe3f8e" dependencies = [ "proc-macro2", "quote", - "syn", + "syn 1.0.82", ] [[package]] @@ -869,6 +988,12 @@ dependencies = [ "tracing-log", ] +[[package]] +name = "unicode-ident" +version = "1.0.12" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "3354b9ac3fae1ff6755cb6db53683adb661634f67557942dea4facebec0fee4b" + [[package]] name = "unicode-width" version = "0.1.9" @@ -924,7 +1049,7 @@ dependencies = [ "log", "proc-macro2", "quote", - "syn", + "syn 1.0.82", "wasm-bindgen-shared", ] @@ -946,7 +1071,7 @@ checksum = "7803e0eea25835f8abdc585cd3021b3deb11543c6fe226dcd30b228857c5c5ab" dependencies = [ "proc-macro2", "quote", - "syn", + "syn 1.0.82", "wasm-bindgen-backend", "wasm-bindgen-shared", ]