Extract lab and test platform API for test planning

BUG=chromium:1069063
TEST=./generate.sh

Change-Id: Ia9acc83eff8852bc51c616516999033e5cd0f787
Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/infra/proto/+/2142326
Commit-Queue: Prathmesh Prabhu <pprabhu@chromium.org>
Tested-by: Prathmesh Prabhu <pprabhu@chromium.org>
Reviewed-by: Alex Zamorzaev <zamorzaev@chromium.org>
diff --git a/go/test/fleet/v1/dut.pb.go b/go/test/fleet/v1/dut.pb.go
new file mode 100644
index 0000000..be3f80d
--- /dev/null
+++ b/go/test/fleet/v1/dut.pb.go
@@ -0,0 +1,165 @@
+// Code generated by protoc-gen-go. DO NOT EDIT.
+// source: test/fleet/v1/dut.proto
+
+package fleet
+
+import (
+	fmt "fmt"
+	proto "github.com/golang/protobuf/proto"
+	v1 "go.chromium.org/chromiumos/config/go/api/test/dut/v1"
+	math "math"
+)
+
+// Reference imports to suppress errors if they are not otherwise used.
+var _ = proto.Marshal
+var _ = fmt.Errorf
+var _ = math.Inf
+
+// This is a compile-time assertion to ensure that this generated file
+// is compatible with the proto package it is being compiled against.
+// A compilation error at this line likely means your copy of the
+// proto package needs to be updated.
+const _ = proto.ProtoPackageIsVersion3 // please upgrade the proto package
+
+// Fleet DeviceUnderTest is referenced in test plan specifications.
+// See test/plan/v1/plan.proto
+type DeviceUnderTest struct {
+	// Name identifying the device in the fleet.
+	//
+	// MUST be valid resource name per https://aip.dev/122.
+	//
+	// Pattern: duts/{dut}
+	Name string `protobuf:"bytes,1,opt,name=name,proto3" json:"name,omitempty"`
+	// The setup of the device in the fleet.
+	// Contains information about the manual modifications and peripherals
+	// attached during deployement of the device to the fleet.
+	Setup *v1.DeviceUnderTest `protobuf:"bytes,2,opt,name=setup,proto3" json:"setup,omitempty"`
+	// Configuration of scheduler options that apply to tasks that can execute on
+	// this DUT.
+	Scheduler            *Scheduler `protobuf:"bytes,3,opt,name=scheduler,proto3" json:"scheduler,omitempty"`
+	XXX_NoUnkeyedLiteral struct{}   `json:"-"`
+	XXX_unrecognized     []byte     `json:"-"`
+	XXX_sizecache        int32      `json:"-"`
+}
+
+func (m *DeviceUnderTest) Reset()         { *m = DeviceUnderTest{} }
+func (m *DeviceUnderTest) String() string { return proto.CompactTextString(m) }
+func (*DeviceUnderTest) ProtoMessage()    {}
+func (*DeviceUnderTest) Descriptor() ([]byte, []int) {
+	return fileDescriptor_8fb9559b7923438a, []int{0}
+}
+
+func (m *DeviceUnderTest) XXX_Unmarshal(b []byte) error {
+	return xxx_messageInfo_DeviceUnderTest.Unmarshal(m, b)
+}
+func (m *DeviceUnderTest) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) {
+	return xxx_messageInfo_DeviceUnderTest.Marshal(b, m, deterministic)
+}
+func (m *DeviceUnderTest) XXX_Merge(src proto.Message) {
+	xxx_messageInfo_DeviceUnderTest.Merge(m, src)
+}
+func (m *DeviceUnderTest) XXX_Size() int {
+	return xxx_messageInfo_DeviceUnderTest.Size(m)
+}
+func (m *DeviceUnderTest) XXX_DiscardUnknown() {
+	xxx_messageInfo_DeviceUnderTest.DiscardUnknown(m)
+}
+
+var xxx_messageInfo_DeviceUnderTest proto.InternalMessageInfo
+
+func (m *DeviceUnderTest) GetName() string {
+	if m != nil {
+		return m.Name
+	}
+	return ""
+}
+
+func (m *DeviceUnderTest) GetSetup() *v1.DeviceUnderTest {
+	if m != nil {
+		return m.Setup
+	}
+	return nil
+}
+
+func (m *DeviceUnderTest) GetScheduler() *Scheduler {
+	if m != nil {
+		return m.Scheduler
+	}
+	return nil
+}
+
+type Scheduler struct {
+	// The task scheduling pools this device may be used for.
+	//
+	// Historical note: The concept of managed pools (e.g.: DUT_POOL_CQ) was used
+	// for automatic balancing of healthy devices in critical pools. Due to
+	// merging of critical pools into a common scheduler pool, this auto-balancing
+	// service is no longer required.
+	//
+	// Old enum values are now serialized to the JSON encoding of those enums
+	// (e.g. "DUT_POOL_QUOTA").
+	// See lab/device.proto:DeviceUnderTest::DutPool.
+	Pools                []string `protobuf:"bytes,1,rep,name=pools,proto3" json:"pools,omitempty"`
+	XXX_NoUnkeyedLiteral struct{} `json:"-"`
+	XXX_unrecognized     []byte   `json:"-"`
+	XXX_sizecache        int32    `json:"-"`
+}
+
+func (m *Scheduler) Reset()         { *m = Scheduler{} }
+func (m *Scheduler) String() string { return proto.CompactTextString(m) }
+func (*Scheduler) ProtoMessage()    {}
+func (*Scheduler) Descriptor() ([]byte, []int) {
+	return fileDescriptor_8fb9559b7923438a, []int{1}
+}
+
+func (m *Scheduler) XXX_Unmarshal(b []byte) error {
+	return xxx_messageInfo_Scheduler.Unmarshal(m, b)
+}
+func (m *Scheduler) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) {
+	return xxx_messageInfo_Scheduler.Marshal(b, m, deterministic)
+}
+func (m *Scheduler) XXX_Merge(src proto.Message) {
+	xxx_messageInfo_Scheduler.Merge(m, src)
+}
+func (m *Scheduler) XXX_Size() int {
+	return xxx_messageInfo_Scheduler.Size(m)
+}
+func (m *Scheduler) XXX_DiscardUnknown() {
+	xxx_messageInfo_Scheduler.DiscardUnknown(m)
+}
+
+var xxx_messageInfo_Scheduler proto.InternalMessageInfo
+
+func (m *Scheduler) GetPools() []string {
+	if m != nil {
+		return m.Pools
+	}
+	return nil
+}
+
+func init() {
+	proto.RegisterType((*DeviceUnderTest)(nil), "test.fleet.v1.DeviceUnderTest")
+	proto.RegisterType((*Scheduler)(nil), "test.fleet.v1.Scheduler")
+}
+
+func init() { proto.RegisterFile("test/fleet/v1/dut.proto", fileDescriptor_8fb9559b7923438a) }
+
+var fileDescriptor_8fb9559b7923438a = []byte{
+	// 249 bytes of a gzipped FileDescriptorProto
+	0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0x5c, 0x90, 0x4d, 0x4b, 0xf4, 0x30,
+	0x10, 0x80, 0xe9, 0xbb, 0xef, 0x0a, 0x8d, 0x88, 0x10, 0x04, 0x83, 0xa7, 0xba, 0xa7, 0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, 0x98, 0x0c, 0xd8, 0x76, 0xf8, 0xeb, 0x16, 0x7a, 0x6c, 0x6d, 0x85, 0x71, 0x6d,
+	0xec, 0x18, 0x17, 0xd7, 0xbc, 0x8f, 0xc1, 0xe7, 0x49, 0xa4, 0xb7, 0xdf, 0x01, 0x00, 0x00, 0xff,
+	0xff, 0x5b, 0xa0, 0x89, 0x09, 0x6b, 0x01, 0x00, 0x00,
+}
diff --git a/src/test/fleet/v1/dut.proto b/src/test/fleet/v1/dut.proto
new file mode 100644
index 0000000..8199dcc
--- /dev/null
+++ b/src/test/fleet/v1/dut.proto
@@ -0,0 +1,46 @@
+// Copyright 2020 The Chromium OS Authors. All rights reserved.
+// Use of this source code is governed by a BSD-style license that can be
+// found in the LICENSE file.
+
+syntax = "proto3";
+
+package test.fleet.v1;
+
+option go_package = "go.chromium.org/chromiumos/infra/proto/go/test/fleet/v1;fleet";
+
+// From chromiumos/config repo.
+import "chromiumos/config/api/test/dut/v1/dut.proto";
+
+// Fleet DeviceUnderTest is referenced in test plan specifications.
+// See test/plan/v1/plan.proto
+message DeviceUnderTest {
+  // Name identifying the device in the fleet.
+  //
+  // MUST be valid resource name per https://aip.dev/122.
+  //
+  // Pattern: duts/{dut}
+  string name = 1;
+
+  // The setup of the device in the fleet.
+  // Contains information about the manual modifications and peripherals
+  // attached during deployement of the device to the fleet.
+  chromiumos.config.api.test.dut.v1.DeviceUnderTest setup = 2;
+
+  // Configuration of scheduler options that apply to tasks that can execute on
+  // this DUT.
+  Scheduler scheduler = 3;
+}
+
+message Scheduler {
+  // The task scheduling pools this device may be used for.
+  //
+  // Historical note: The concept of managed pools (e.g.: DUT_POOL_CQ) was used
+  // for automatic balancing of healthy devices in critical pools. Due to
+  // merging of critical pools into a common scheduler pool, this auto-balancing
+  // service is no longer required.
+  //
+  // Old enum values are now serialized to the JSON encoding of those enums
+  // (e.g. "DUT_POOL_QUOTA").
+  // See lab/device.proto:DeviceUnderTest::DutPool.
+  repeated string pools = 1;
+}
\ No newline at end of file