khenaidoo | 2bc4828 | 2019-07-16 18:13:46 -0400 | [diff] [blame] | 1 | /* |
| 2 | * Copyright 2019-present Open Networking Foundation |
| 3 | * |
| 4 | * Licensed under the Apache License, Version 2.0 (the "License"); |
| 5 | * you may not use this file except in compliance with the License. |
| 6 | * You may obtain a copy of the License at |
| 7 | * |
| 8 | * http://www.apache.org/licenses/LICENSE-2.0 |
| 9 | * |
| 10 | * Unless required by applicable law or agreed to in writing, software |
| 11 | * distributed under the License is distributed on an "AS IS" BASIS, |
| 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. |
| 13 | * See the License for the specific language governing permissions and |
| 14 | * limitations under the License. |
| 15 | */ |
Kent Hagerman | 2b21604 | 2020-04-03 18:28:56 -0400 | [diff] [blame] | 16 | package device |
khenaidoo | 2bc4828 | 2019-07-16 18:13:46 -0400 | [diff] [blame] | 17 | |
| 18 | import ( |
khenaidoo | 6e55d9e | 2019-12-12 18:26:26 -0500 | [diff] [blame] | 19 | "context" |
David Bainbridge | d1afd66 | 2020-03-26 18:27:41 -0700 | [diff] [blame] | 20 | "math/rand" |
Neha Sharma | d1387da | 2020-05-07 20:07:28 +0000 | [diff] [blame] | 21 | "strconv" |
David Bainbridge | d1afd66 | 2020-03-26 18:27:41 -0700 | [diff] [blame] | 22 | "sync" |
| 23 | "testing" |
| 24 | "time" |
| 25 | |
Kent Hagerman | f5a6735 | 2020-04-30 15:15:26 -0400 | [diff] [blame] | 26 | "github.com/gogo/protobuf/proto" |
Mahir Gunyel | addb66a | 2020-04-29 18:08:50 -0700 | [diff] [blame] | 27 | "github.com/opencord/voltha-go/db/model" |
Kent Hagerman | f5a6735 | 2020-04-30 15:15:26 -0400 | [diff] [blame] | 28 | "github.com/opencord/voltha-go/rw_core/config" |
Mahir Gunyel | addb66a | 2020-04-29 18:08:50 -0700 | [diff] [blame] | 29 | "github.com/opencord/voltha-go/rw_core/core/adapter" |
Mahir Gunyel | 03de0d3 | 2020-06-03 01:36:59 -0700 | [diff] [blame] | 30 | tst "github.com/opencord/voltha-go/rw_core/test" |
Kent Hagerman | f5a6735 | 2020-04-30 15:15:26 -0400 | [diff] [blame] | 31 | com "github.com/opencord/voltha-lib-go/v3/pkg/adapters/common" |
Mahir Gunyel | addb66a | 2020-04-29 18:08:50 -0700 | [diff] [blame] | 32 | "github.com/opencord/voltha-lib-go/v3/pkg/db" |
| 33 | fu "github.com/opencord/voltha-lib-go/v3/pkg/flows" |
serkant.uluderya | 2ae470f | 2020-01-21 11:13:09 -0800 | [diff] [blame] | 34 | "github.com/opencord/voltha-lib-go/v3/pkg/kafka" |
Matteo Scandolo | d525ae3 | 2020-04-02 17:27:29 -0700 | [diff] [blame] | 35 | mock_etcd "github.com/opencord/voltha-lib-go/v3/pkg/mocks/etcd" |
| 36 | mock_kafka "github.com/opencord/voltha-lib-go/v3/pkg/mocks/kafka" |
serkant.uluderya | 2ae470f | 2020-01-21 11:13:09 -0800 | [diff] [blame] | 37 | ofp "github.com/opencord/voltha-protos/v3/go/openflow_13" |
| 38 | "github.com/opencord/voltha-protos/v3/go/voltha" |
khenaidoo | 6e55d9e | 2019-12-12 18:26:26 -0500 | [diff] [blame] | 39 | "github.com/phayes/freeport" |
khenaidoo | 2bc4828 | 2019-07-16 18:13:46 -0400 | [diff] [blame] | 40 | "github.com/stretchr/testify/assert" |
khenaidoo | 2bc4828 | 2019-07-16 18:13:46 -0400 | [diff] [blame] | 41 | ) |
| 42 | |
khenaidoo | 6e55d9e | 2019-12-12 18:26:26 -0500 | [diff] [blame] | 43 | type LDATest struct { |
Kent Hagerman | 2b21604 | 2020-04-03 18:28:56 -0400 | [diff] [blame] | 44 | etcdServer *mock_etcd.EtcdServer |
| 45 | deviceMgr *Manager |
| 46 | kmp kafka.InterContainerProxy |
| 47 | logicalDeviceMgr *LogicalManager |
| 48 | kClient kafka.Client |
| 49 | kvClientPort int |
| 50 | oltAdapterName string |
| 51 | onuAdapterName string |
| 52 | coreInstanceID string |
| 53 | defaultTimeout time.Duration |
| 54 | maxTimeout time.Duration |
| 55 | logicalDevice *voltha.LogicalDevice |
| 56 | deviceIds []string |
| 57 | done chan int |
khenaidoo | 6e55d9e | 2019-12-12 18:26:26 -0500 | [diff] [blame] | 58 | } |
| 59 | |
| 60 | func newLDATest() *LDATest { |
| 61 | test := &LDATest{} |
| 62 | // Start the embedded etcd server |
| 63 | var err error |
Mahir Gunyel | 03de0d3 | 2020-06-03 01:36:59 -0700 | [diff] [blame] | 64 | test.etcdServer, test.kvClientPort, err = tst.StartEmbeddedEtcdServer("voltha.rwcore.lda.test", "voltha.rwcore.lda.etcd", "error") |
khenaidoo | 6e55d9e | 2019-12-12 18:26:26 -0500 | [diff] [blame] | 65 | if err != nil { |
Girish Kumar | f56a468 | 2020-03-20 20:07:46 +0000 | [diff] [blame] | 66 | logger.Fatal(err) |
khenaidoo | 6e55d9e | 2019-12-12 18:26:26 -0500 | [diff] [blame] | 67 | } |
| 68 | // Create the kafka client |
Matteo Scandolo | d525ae3 | 2020-04-02 17:27:29 -0700 | [diff] [blame] | 69 | test.kClient = mock_kafka.NewKafkaClient() |
khenaidoo | 6e55d9e | 2019-12-12 18:26:26 -0500 | [diff] [blame] | 70 | test.oltAdapterName = "olt_adapter_mock" |
| 71 | test.onuAdapterName = "onu_adapter_mock" |
| 72 | test.coreInstanceID = "rw-da-test" |
| 73 | test.defaultTimeout = 5 * time.Second |
| 74 | test.maxTimeout = 20 * time.Second |
| 75 | test.done = make(chan int) |
| 76 | test.deviceIds = []string{com.GetRandomString(10), com.GetRandomString(10), com.GetRandomString(10)} |
| 77 | test.logicalDevice = &voltha.LogicalDevice{ |
| 78 | Desc: &ofp.OfpDesc{ |
| 79 | HwDesc: "olt_adapter_mock", |
| 80 | SwDesc: "olt_adapter_mock", |
| 81 | SerialNum: com.GetRandomSerialNumber(), |
| 82 | }, |
| 83 | SwitchFeatures: &ofp.OfpSwitchFeatures{ |
| 84 | NBuffers: 256, |
| 85 | NTables: 2, |
| 86 | Capabilities: uint32(ofp.OfpCapabilities_OFPC_FLOW_STATS | |
| 87 | ofp.OfpCapabilities_OFPC_TABLE_STATS | |
| 88 | ofp.OfpCapabilities_OFPC_PORT_STATS | |
| 89 | ofp.OfpCapabilities_OFPC_GROUP_STATS), |
| 90 | }, |
| 91 | RootDeviceId: test.deviceIds[0], |
| 92 | Ports: []*voltha.LogicalPort{ |
| 93 | { |
| 94 | Id: "1001", |
| 95 | DeviceId: test.deviceIds[0], |
| 96 | DevicePortNo: 1, |
| 97 | RootPort: true, |
| 98 | OfpPort: &ofp.OfpPort{ |
| 99 | PortNo: 1, |
| 100 | Name: "port1", |
| 101 | Config: 4, |
| 102 | State: 4, |
| 103 | }, |
| 104 | }, |
| 105 | { |
| 106 | Id: "1002", |
| 107 | DeviceId: test.deviceIds[1], |
| 108 | DevicePortNo: 2, |
| 109 | RootPort: false, |
| 110 | OfpPort: &ofp.OfpPort{ |
| 111 | PortNo: 2, |
| 112 | Name: "port2", |
| 113 | Config: 4, |
| 114 | State: 4, |
| 115 | }, |
| 116 | }, |
| 117 | { |
| 118 | Id: "1003", |
| 119 | DeviceId: test.deviceIds[2], |
| 120 | DevicePortNo: 3, |
| 121 | RootPort: false, |
| 122 | OfpPort: &ofp.OfpPort{ |
Kent Hagerman | fa9d6d4 | 2020-05-25 11:49:40 -0400 | [diff] [blame] | 123 | PortNo: 3, |
khenaidoo | 6e55d9e | 2019-12-12 18:26:26 -0500 | [diff] [blame] | 124 | Name: "port3", |
| 125 | Config: 4, |
| 126 | State: 4, |
| 127 | }, |
| 128 | }, |
| 129 | }, |
| 130 | } |
| 131 | return test |
| 132 | } |
| 133 | |
| 134 | func (lda *LDATest) startCore(inCompeteMode bool) { |
| 135 | cfg := config.NewRWCoreFlags() |
serkant.uluderya | 8ff291d | 2020-05-20 00:58:00 -0700 | [diff] [blame] | 136 | cfg.CoreTopic = "rw_core" |
khenaidoo | 442e7c7 | 2020-03-10 16:13:48 -0400 | [diff] [blame] | 137 | cfg.DefaultRequestTimeout = lda.defaultTimeout |
Neha Sharma | d1387da | 2020-05-07 20:07:28 +0000 | [diff] [blame] | 138 | cfg.KVStoreAddress = "127.0.0.1" + ":" + strconv.Itoa(lda.kvClientPort) |
khenaidoo | 6e55d9e | 2019-12-12 18:26:26 -0500 | [diff] [blame] | 139 | grpcPort, err := freeport.GetFreePort() |
| 140 | if err != nil { |
Girish Kumar | f56a468 | 2020-03-20 20:07:46 +0000 | [diff] [blame] | 141 | logger.Fatal("Cannot get a freeport for grpc") |
khenaidoo | 6e55d9e | 2019-12-12 18:26:26 -0500 | [diff] [blame] | 142 | } |
Neha Sharma | d1387da | 2020-05-07 20:07:28 +0000 | [diff] [blame] | 143 | cfg.GrpcAddress = "127.0.0.1" + ":" + strconv.Itoa(grpcPort) |
Mahir Gunyel | 03de0d3 | 2020-06-03 01:36:59 -0700 | [diff] [blame] | 144 | client := tst.SetupKVClient(cfg, lda.coreInstanceID) |
Kent Hagerman | 2b21604 | 2020-04-03 18:28:56 -0400 | [diff] [blame] | 145 | backend := &db.Backend{ |
| 146 | Client: client, |
| 147 | StoreType: cfg.KVStoreType, |
Neha Sharma | d1387da | 2020-05-07 20:07:28 +0000 | [diff] [blame] | 148 | Address: cfg.KVStoreAddress, |
Kent Hagerman | 2b21604 | 2020-04-03 18:28:56 -0400 | [diff] [blame] | 149 | Timeout: cfg.KVStoreTimeout, |
serkant.uluderya | 8ff291d | 2020-05-20 00:58:00 -0700 | [diff] [blame] | 150 | LivenessChannelInterval: cfg.LiveProbeInterval / 2} |
Kent Hagerman | 2b21604 | 2020-04-03 18:28:56 -0400 | [diff] [blame] | 151 | lda.kmp = kafka.NewInterContainerProxy( |
Neha Sharma | d1387da | 2020-05-07 20:07:28 +0000 | [diff] [blame] | 152 | kafka.InterContainerAddress(cfg.KafkaAdapterAddress), |
Kent Hagerman | 2b21604 | 2020-04-03 18:28:56 -0400 | [diff] [blame] | 153 | kafka.MsgClient(lda.kClient), |
David Bainbridge | 9ae1313 | 2020-06-22 17:28:01 -0700 | [diff] [blame] | 154 | kafka.DefaultTopic(&kafka.Topic{Name: cfg.CoreTopic})) |
Kent Hagerman | 2b21604 | 2020-04-03 18:28:56 -0400 | [diff] [blame] | 155 | |
| 156 | endpointMgr := kafka.NewEndpointManager(backend) |
Kent Hagerman | f5a6735 | 2020-04-30 15:15:26 -0400 | [diff] [blame] | 157 | proxy := model.NewDBPath(backend) |
Kent Hagerman | 2b21604 | 2020-04-03 18:28:56 -0400 | [diff] [blame] | 158 | adapterMgr := adapter.NewAdapterManager(proxy, lda.coreInstanceID, lda.kClient) |
| 159 | |
serkant.uluderya | 8ff291d | 2020-05-20 00:58:00 -0700 | [diff] [blame] | 160 | lda.deviceMgr, lda.logicalDeviceMgr = NewManagers(proxy, adapterMgr, lda.kmp, endpointMgr, cfg.CoreTopic, lda.coreInstanceID, cfg.DefaultCoreTimeout) |
Kent Hagerman | 2b21604 | 2020-04-03 18:28:56 -0400 | [diff] [blame] | 161 | if err = lda.kmp.Start(); err != nil { |
| 162 | logger.Fatal("Cannot start InterContainerProxy") |
Thomas Lee S | e5a4401 | 2019-11-07 20:32:24 +0530 | [diff] [blame] | 163 | } |
Kent Hagerman | 2f0d055 | 2020-04-23 17:28:52 -0400 | [diff] [blame] | 164 | adapterMgr.Start(context.Background()) |
khenaidoo | 6e55d9e | 2019-12-12 18:26:26 -0500 | [diff] [blame] | 165 | } |
| 166 | |
| 167 | func (lda *LDATest) stopAll() { |
| 168 | if lda.kClient != nil { |
| 169 | lda.kClient.Stop() |
| 170 | } |
Kent Hagerman | 2b21604 | 2020-04-03 18:28:56 -0400 | [diff] [blame] | 171 | if lda.kmp != nil { |
| 172 | lda.kmp.Stop() |
khenaidoo | 6e55d9e | 2019-12-12 18:26:26 -0500 | [diff] [blame] | 173 | } |
| 174 | if lda.etcdServer != nil { |
Mahir Gunyel | 03de0d3 | 2020-06-03 01:36:59 -0700 | [diff] [blame] | 175 | tst.StopEmbeddedEtcdServer(lda.etcdServer) |
khenaidoo | 6e55d9e | 2019-12-12 18:26:26 -0500 | [diff] [blame] | 176 | } |
| 177 | } |
| 178 | |
Kent Hagerman | 2b21604 | 2020-04-03 18:28:56 -0400 | [diff] [blame] | 179 | func (lda *LDATest) createLogicalDeviceAgent(t *testing.T) *LogicalAgent { |
| 180 | lDeviceMgr := lda.logicalDeviceMgr |
| 181 | deviceMgr := lda.deviceMgr |
khenaidoo | 6e55d9e | 2019-12-12 18:26:26 -0500 | [diff] [blame] | 182 | clonedLD := proto.Clone(lda.logicalDevice).(*voltha.LogicalDevice) |
| 183 | clonedLD.Id = com.GetRandomString(10) |
| 184 | clonedLD.DatapathId = rand.Uint64() |
Mahir Gunyel | 03de0d3 | 2020-06-03 01:36:59 -0700 | [diff] [blame] | 185 | lDeviceAgent := newLogicalAgent(clonedLD.Id, clonedLD.Id, clonedLD.RootDeviceId, lDeviceMgr, deviceMgr, lDeviceMgr.dbPath, lDeviceMgr.ldProxy, lDeviceMgr.defaultTimeout) |
khenaidoo | 6e55d9e | 2019-12-12 18:26:26 -0500 | [diff] [blame] | 186 | lDeviceAgent.logicalDevice = clonedLD |
Kent Hagerman | fa9d6d4 | 2020-05-25 11:49:40 -0400 | [diff] [blame] | 187 | for _, port := range clonedLD.Ports { |
| 188 | handle, created, err := lDeviceAgent.portLoader.LockOrCreate(context.Background(), port) |
| 189 | if err != nil { |
| 190 | panic(err) |
| 191 | } |
| 192 | handle.Unlock() |
| 193 | if !created { |
| 194 | t.Errorf("port %d already exists", port.OfpPort.PortNo) |
| 195 | } |
| 196 | } |
Kent Hagerman | f5a6735 | 2020-04-30 15:15:26 -0400 | [diff] [blame] | 197 | err := lDeviceAgent.ldProxy.Set(context.Background(), clonedLD.Id, clonedLD) |
Thomas Lee S | e5a4401 | 2019-11-07 20:32:24 +0530 | [diff] [blame] | 198 | assert.Nil(t, err) |
khenaidoo | 6e55d9e | 2019-12-12 18:26:26 -0500 | [diff] [blame] | 199 | lDeviceMgr.addLogicalDeviceAgentToMap(lDeviceAgent) |
| 200 | return lDeviceAgent |
| 201 | } |
| 202 | |
Kent Hagerman | 2b21604 | 2020-04-03 18:28:56 -0400 | [diff] [blame] | 203 | func (lda *LDATest) updateLogicalDeviceConcurrently(t *testing.T, ldAgent *LogicalAgent, globalWG *sync.WaitGroup) { |
khenaidoo | 442e7c7 | 2020-03-10 16:13:48 -0400 | [diff] [blame] | 204 | originalLogicalDevice, _ := ldAgent.GetLogicalDevice(context.Background()) |
khenaidoo | 6e55d9e | 2019-12-12 18:26:26 -0500 | [diff] [blame] | 205 | assert.NotNil(t, originalLogicalDevice) |
| 206 | var localWG sync.WaitGroup |
| 207 | |
| 208 | // Change the state of the first port to FAILED |
| 209 | localWG.Add(1) |
| 210 | go func() { |
Kent Hagerman | fa9d6d4 | 2020-05-25 11:49:40 -0400 | [diff] [blame] | 211 | err := ldAgent.updatePortState(context.Background(), lda.logicalDevice.Ports[0].DevicePortNo, voltha.OperStatus_FAILED) |
khenaidoo | 6e55d9e | 2019-12-12 18:26:26 -0500 | [diff] [blame] | 212 | assert.Nil(t, err) |
| 213 | localWG.Done() |
| 214 | }() |
| 215 | |
| 216 | // Change the state of the second port to TESTING |
| 217 | localWG.Add(1) |
| 218 | go func() { |
Kent Hagerman | fa9d6d4 | 2020-05-25 11:49:40 -0400 | [diff] [blame] | 219 | err := ldAgent.updatePortState(context.Background(), lda.logicalDevice.Ports[1].DevicePortNo, voltha.OperStatus_TESTING) |
khenaidoo | 6e55d9e | 2019-12-12 18:26:26 -0500 | [diff] [blame] | 220 | assert.Nil(t, err) |
| 221 | localWG.Done() |
| 222 | }() |
| 223 | |
| 224 | // Change the state of the third port to UNKNOWN and then back to ACTIVE |
| 225 | localWG.Add(1) |
| 226 | go func() { |
Kent Hagerman | fa9d6d4 | 2020-05-25 11:49:40 -0400 | [diff] [blame] | 227 | err := ldAgent.updatePortState(context.Background(), lda.logicalDevice.Ports[2].DevicePortNo, voltha.OperStatus_UNKNOWN) |
khenaidoo | 6e55d9e | 2019-12-12 18:26:26 -0500 | [diff] [blame] | 228 | assert.Nil(t, err) |
Kent Hagerman | fa9d6d4 | 2020-05-25 11:49:40 -0400 | [diff] [blame] | 229 | err = ldAgent.updatePortState(context.Background(), lda.logicalDevice.Ports[2].DevicePortNo, voltha.OperStatus_ACTIVE) |
khenaidoo | 6e55d9e | 2019-12-12 18:26:26 -0500 | [diff] [blame] | 230 | assert.Nil(t, err) |
| 231 | localWG.Done() |
| 232 | }() |
| 233 | |
| 234 | // Add a meter to the logical device |
| 235 | meterMod := &ofp.OfpMeterMod{ |
| 236 | Command: ofp.OfpMeterModCommand_OFPMC_ADD, |
| 237 | Flags: rand.Uint32(), |
| 238 | MeterId: rand.Uint32(), |
| 239 | Bands: []*ofp.OfpMeterBandHeader{ |
| 240 | {Type: ofp.OfpMeterBandType_OFPMBT_EXPERIMENTER, |
| 241 | Rate: rand.Uint32(), |
| 242 | BurstSize: rand.Uint32(), |
| 243 | Data: nil, |
| 244 | }, |
| 245 | }, |
| 246 | } |
| 247 | localWG.Add(1) |
| 248 | go func() { |
npujar | 467fe75 | 2020-01-16 20:17:45 +0530 | [diff] [blame] | 249 | err := ldAgent.meterAdd(context.Background(), meterMod) |
khenaidoo | 6e55d9e | 2019-12-12 18:26:26 -0500 | [diff] [blame] | 250 | assert.Nil(t, err) |
| 251 | localWG.Done() |
| 252 | }() |
khenaidoo | 6e55d9e | 2019-12-12 18:26:26 -0500 | [diff] [blame] | 253 | // wait for go routines to be done |
| 254 | localWG.Wait() |
Mahir Gunyel | addb66a | 2020-04-29 18:08:50 -0700 | [diff] [blame] | 255 | meterEntry := fu.MeterEntryFromMeterMod(meterMod) |
| 256 | |
Kent Hagerman | 433a31a | 2020-05-20 19:04:48 -0400 | [diff] [blame] | 257 | meterHandle, have := ldAgent.meterLoader.Lock(meterMod.MeterId) |
| 258 | assert.Equal(t, have, true) |
| 259 | if have { |
| 260 | assert.True(t, proto.Equal(meterEntry, meterHandle.GetReadOnly())) |
| 261 | meterHandle.Unlock() |
| 262 | } |
khenaidoo | 6e55d9e | 2019-12-12 18:26:26 -0500 | [diff] [blame] | 263 | |
| 264 | expectedChange := proto.Clone(originalLogicalDevice).(*voltha.LogicalDevice) |
| 265 | expectedChange.Ports[0].OfpPort.Config = originalLogicalDevice.Ports[0].OfpPort.Config | uint32(ofp.OfpPortConfig_OFPPC_PORT_DOWN) |
| 266 | expectedChange.Ports[0].OfpPort.State = uint32(ofp.OfpPortState_OFPPS_LINK_DOWN) |
| 267 | expectedChange.Ports[1].OfpPort.Config = originalLogicalDevice.Ports[0].OfpPort.Config | uint32(ofp.OfpPortConfig_OFPPC_PORT_DOWN) |
| 268 | expectedChange.Ports[1].OfpPort.State = uint32(ofp.OfpPortState_OFPPS_LINK_DOWN) |
| 269 | expectedChange.Ports[2].OfpPort.Config = originalLogicalDevice.Ports[0].OfpPort.Config & ^uint32(ofp.OfpPortConfig_OFPPC_PORT_DOWN) |
| 270 | expectedChange.Ports[2].OfpPort.State = uint32(ofp.OfpPortState_OFPPS_LIVE) |
Kent Hagerman | fa9d6d4 | 2020-05-25 11:49:40 -0400 | [diff] [blame] | 271 | |
| 272 | updatedLogicalDevicePorts := ldAgent.listLogicalDevicePorts() |
| 273 | for _, p := range expectedChange.Ports { |
| 274 | assert.True(t, proto.Equal(p, updatedLogicalDevicePorts[p.DevicePortNo])) |
| 275 | } |
khenaidoo | 6e55d9e | 2019-12-12 18:26:26 -0500 | [diff] [blame] | 276 | globalWG.Done() |
| 277 | } |
| 278 | |
| 279 | func TestConcurrentLogicalDeviceUpdate(t *testing.T) { |
| 280 | lda := newLDATest() |
| 281 | assert.NotNil(t, lda) |
| 282 | defer lda.stopAll() |
| 283 | |
| 284 | // Start the Core |
| 285 | lda.startCore(false) |
| 286 | |
| 287 | var wg sync.WaitGroup |
khenaidoo | 442e7c7 | 2020-03-10 16:13:48 -0400 | [diff] [blame] | 288 | numConCurrentLogicalDeviceAgents := 3 |
khenaidoo | 6e55d9e | 2019-12-12 18:26:26 -0500 | [diff] [blame] | 289 | for i := 0; i < numConCurrentLogicalDeviceAgents; i++ { |
| 290 | wg.Add(1) |
| 291 | a := lda.createLogicalDeviceAgent(t) |
| 292 | go lda.updateLogicalDeviceConcurrently(t, a, &wg) |
| 293 | } |
| 294 | |
| 295 | wg.Wait() |
| 296 | } |