sbarbari | 17d7e22 | 2019-11-05 10:02:29 -0500 | [diff] [blame] | 1 | /* |
| 2 | * Copyright 2018-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 | */ |
| 16 | package model |
| 17 | |
| 18 | import ( |
| 19 | "context" |
| 20 | "encoding/hex" |
| 21 | "encoding/json" |
sbarbari | 17d7e22 | 2019-11-05 10:02:29 -0500 | [diff] [blame] | 22 | "github.com/google/uuid" |
Kent Hagerman | 4f355f5 | 2020-03-30 16:01:33 -0400 | [diff] [blame] | 23 | "github.com/opencord/voltha-lib-go/v3/pkg/db" |
| 24 | "github.com/opencord/voltha-lib-go/v3/pkg/db/kvstore" |
serkant.uluderya | 2ae470f | 2020-01-21 11:13:09 -0800 | [diff] [blame] | 25 | "github.com/opencord/voltha-lib-go/v3/pkg/log" |
| 26 | "github.com/opencord/voltha-protos/v3/go/common" |
| 27 | "github.com/opencord/voltha-protos/v3/go/openflow_13" |
| 28 | "github.com/opencord/voltha-protos/v3/go/voltha" |
Thomas Lee S | e5a4401 | 2019-11-07 20:32:24 +0530 | [diff] [blame] | 29 | "github.com/stretchr/testify/assert" |
Kent Hagerman | 4f355f5 | 2020-03-30 16:01:33 -0400 | [diff] [blame] | 30 | "strconv" |
| 31 | "strings" |
| 32 | "sync" |
| 33 | "testing" |
sbarbari | 17d7e22 | 2019-11-05 10:02:29 -0500 | [diff] [blame] | 34 | ) |
| 35 | |
| 36 | var ( |
Kent Hagerman | 4f355f5 | 2020-03-30 16:01:33 -0400 | [diff] [blame] | 37 | BenchmarkProxyLogger log.Logger |
npujar | 9a30c70 | 2019-11-14 17:06:39 +0530 | [diff] [blame] | 38 | TestProxyRootLogicalDevice *Proxy |
| 39 | TestProxyRootDevice *Proxy |
| 40 | TestProxyRootAdapter *Proxy |
| 41 | TestProxyDeviceID string |
| 42 | TestProxyAdapterID string |
| 43 | TestProxyLogicalDeviceID string |
| 44 | TestProxyTargetDeviceID string |
| 45 | TestProxyTargetLogicalDeviceID string |
| 46 | TestProxyLogicalPorts []*voltha.LogicalPort |
| 47 | TestProxyPorts []*voltha.Port |
| 48 | TestProxyStats *openflow_13.OfpFlowStats |
| 49 | TestProxyFlows *openflow_13.Flows |
| 50 | TestProxyDevice *voltha.Device |
| 51 | TestProxyLogicalDevice *voltha.LogicalDevice |
| 52 | TestProxyAdapter *voltha.Adapter |
sbarbari | 17d7e22 | 2019-11-05 10:02:29 -0500 | [diff] [blame] | 53 | ) |
| 54 | |
| 55 | func init() { |
Neha Sharma | be48593 | 2020-05-25 21:52:55 +0000 | [diff] [blame^] | 56 | ctx := context.Background() |
Kent Hagerman | 4f355f5 | 2020-03-30 16:01:33 -0400 | [diff] [blame] | 57 | BenchmarkProxyLogger, _ = log.AddPackage(log.JSON, log.DebugLevel, log.Fields{"instanceId": "PLT"}) |
| 58 | //log.UpdateAllLoggers(log.Fields{"instanceId": "PROXY_LOAD_TEST"}) |
| 59 | //Setup default logger - applies for packages that do not have specific logger set |
| 60 | if _, err := log.SetDefaultLogger(log.JSON, log.DebugLevel, log.Fields{"instanceId": "PLT"}); err != nil { |
| 61 | log.With(log.Fields{"error": err}).Fatal("Cannot setup logging") |
Thomas Lee S | e5a4401 | 2019-11-07 20:32:24 +0530 | [diff] [blame] | 62 | } |
Kent Hagerman | 4f355f5 | 2020-03-30 16:01:33 -0400 | [diff] [blame] | 63 | |
| 64 | // Update all loggers (provisioned via init) with a common field |
| 65 | if err := log.UpdateAllLoggers(log.Fields{"instanceId": "PLT"}); err != nil { |
| 66 | log.With(log.Fields{"error": err}).Fatal("Cannot setup logging") |
Thomas Lee S | e5a4401 | 2019-11-07 20:32:24 +0530 | [diff] [blame] | 67 | } |
Kent Hagerman | 4f355f5 | 2020-03-30 16:01:33 -0400 | [diff] [blame] | 68 | log.SetPackageLogLevel("github.com/opencord/voltha-go/db/model", log.DebugLevel) |
| 69 | |
Neha Sharma | be48593 | 2020-05-25 21:52:55 +0000 | [diff] [blame^] | 70 | TestProxyRootLogicalDevice = NewProxy(ctx, mockBackend, "/") |
| 71 | TestProxyRootDevice = NewProxy(ctx, mockBackend, "/") |
| 72 | TestProxyRootAdapter = NewProxy(ctx, mockBackend, "/") |
sbarbari | 17d7e22 | 2019-11-05 10:02:29 -0500 | [diff] [blame] | 73 | |
npujar | 9a30c70 | 2019-11-14 17:06:39 +0530 | [diff] [blame] | 74 | TestProxyLogicalPorts = []*voltha.LogicalPort{ |
sbarbari | 17d7e22 | 2019-11-05 10:02:29 -0500 | [diff] [blame] | 75 | { |
| 76 | Id: "123", |
| 77 | DeviceId: "logicalport-0-device-id", |
| 78 | DevicePortNo: 123, |
| 79 | RootPort: false, |
| 80 | }, |
| 81 | } |
npujar | 9a30c70 | 2019-11-14 17:06:39 +0530 | [diff] [blame] | 82 | TestProxyPorts = []*voltha.Port{ |
sbarbari | 17d7e22 | 2019-11-05 10:02:29 -0500 | [diff] [blame] | 83 | { |
| 84 | PortNo: 123, |
| 85 | Label: "test-port-0", |
| 86 | Type: voltha.Port_PON_OLT, |
| 87 | AdminState: common.AdminState_ENABLED, |
| 88 | OperStatus: common.OperStatus_ACTIVE, |
| 89 | DeviceId: "etcd_port-0-device-id", |
| 90 | Peers: []*voltha.Port_PeerPort{}, |
| 91 | }, |
| 92 | } |
| 93 | |
npujar | 9a30c70 | 2019-11-14 17:06:39 +0530 | [diff] [blame] | 94 | TestProxyStats = &openflow_13.OfpFlowStats{ |
sbarbari | 17d7e22 | 2019-11-05 10:02:29 -0500 | [diff] [blame] | 95 | Id: 1111, |
| 96 | } |
npujar | 9a30c70 | 2019-11-14 17:06:39 +0530 | [diff] [blame] | 97 | TestProxyFlows = &openflow_13.Flows{ |
| 98 | Items: []*openflow_13.OfpFlowStats{TestProxyStats}, |
sbarbari | 17d7e22 | 2019-11-05 10:02:29 -0500 | [diff] [blame] | 99 | } |
npujar | 9a30c70 | 2019-11-14 17:06:39 +0530 | [diff] [blame] | 100 | TestProxyDevice = &voltha.Device{ |
| 101 | Id: TestProxyDeviceID, |
sbarbari | 17d7e22 | 2019-11-05 10:02:29 -0500 | [diff] [blame] | 102 | Type: "simulated_olt", |
| 103 | Address: &voltha.Device_HostAndPort{HostAndPort: "1.2.3.4:5555"}, |
| 104 | AdminState: voltha.AdminState_PREPROVISIONED, |
npujar | 9a30c70 | 2019-11-14 17:06:39 +0530 | [diff] [blame] | 105 | Flows: TestProxyFlows, |
| 106 | Ports: TestProxyPorts, |
sbarbari | 17d7e22 | 2019-11-05 10:02:29 -0500 | [diff] [blame] | 107 | } |
| 108 | |
npujar | 9a30c70 | 2019-11-14 17:06:39 +0530 | [diff] [blame] | 109 | TestProxyLogicalDevice = &voltha.LogicalDevice{ |
| 110 | Id: TestProxyDeviceID, |
sbarbari | 17d7e22 | 2019-11-05 10:02:29 -0500 | [diff] [blame] | 111 | DatapathId: 0, |
npujar | 9a30c70 | 2019-11-14 17:06:39 +0530 | [diff] [blame] | 112 | Ports: TestProxyLogicalPorts, |
| 113 | Flows: TestProxyFlows, |
sbarbari | 17d7e22 | 2019-11-05 10:02:29 -0500 | [diff] [blame] | 114 | } |
| 115 | |
npujar | 9a30c70 | 2019-11-14 17:06:39 +0530 | [diff] [blame] | 116 | TestProxyAdapter = &voltha.Adapter{ |
| 117 | Id: TestProxyAdapterID, |
sbarbari | 17d7e22 | 2019-11-05 10:02:29 -0500 | [diff] [blame] | 118 | Vendor: "test-adapter-vendor", |
| 119 | Version: "test-adapter-version", |
| 120 | } |
| 121 | } |
| 122 | |
Kent Hagerman | 4f355f5 | 2020-03-30 16:01:33 -0400 | [diff] [blame] | 123 | type mockKV struct { |
| 124 | kvstore.Client // pretend we implement everything |
| 125 | |
| 126 | mutex sync.RWMutex |
| 127 | data map[string]interface{} |
| 128 | } |
| 129 | |
| 130 | func (kv *mockKV) List(_ context.Context, key string) (map[string]*kvstore.KVPair, error) { |
| 131 | kv.mutex.RLock() |
| 132 | defer kv.mutex.RUnlock() |
| 133 | |
| 134 | ret := make(map[string]*kvstore.KVPair, len(kv.data)) |
| 135 | for k, v := range kv.data { |
| 136 | if strings.HasPrefix(k, key) { |
| 137 | ret[k] = &kvstore.KVPair{Key: k, Value: v} |
| 138 | } |
| 139 | } |
| 140 | return ret, nil |
| 141 | } |
| 142 | func (kv *mockKV) Get(_ context.Context, key string) (*kvstore.KVPair, error) { |
| 143 | kv.mutex.RLock() |
| 144 | defer kv.mutex.RUnlock() |
| 145 | |
| 146 | if val, have := kv.data[key]; have { |
| 147 | return &kvstore.KVPair{Key: key, Value: val}, nil |
| 148 | } |
| 149 | return nil, nil |
| 150 | } |
| 151 | func (kv *mockKV) Put(_ context.Context, key string, value interface{}) error { |
| 152 | kv.mutex.Lock() |
| 153 | defer kv.mutex.Unlock() |
| 154 | |
| 155 | kv.data[key] = value |
| 156 | return nil |
| 157 | } |
| 158 | func (kv *mockKV) Delete(_ context.Context, key string) error { |
| 159 | kv.mutex.Lock() |
| 160 | defer kv.mutex.Unlock() |
| 161 | |
| 162 | delete(kv.data, key) |
| 163 | return nil |
| 164 | } |
| 165 | |
| 166 | var mockBackend = &db.Backend{Client: &mockKV{data: make(map[string]interface{})}} |
| 167 | |
sbarbari | 17d7e22 | 2019-11-05 10:02:29 -0500 | [diff] [blame] | 168 | func TestProxy_1_1_1_Add_NewDevice(t *testing.T) { |
| 169 | devIDBin, _ := uuid.New().MarshalBinary() |
npujar | 9a30c70 | 2019-11-14 17:06:39 +0530 | [diff] [blame] | 170 | TestProxyDeviceID = "0001" + hex.EncodeToString(devIDBin)[:12] |
| 171 | TestProxyDevice.Id = TestProxyDeviceID |
sbarbari | 17d7e22 | 2019-11-05 10:02:29 -0500 | [diff] [blame] | 172 | |
Kent Hagerman | 4f355f5 | 2020-03-30 16:01:33 -0400 | [diff] [blame] | 173 | if err := TestProxyRootDevice.AddWithID(context.Background(), "devices", TestProxyDeviceID, TestProxyDevice); err != nil { |
npujar | 9a30c70 | 2019-11-14 17:06:39 +0530 | [diff] [blame] | 174 | BenchmarkProxyLogger.Errorf("Failed to add test proxy device due to error: %v", err) |
Kent Hagerman | 4f355f5 | 2020-03-30 16:01:33 -0400 | [diff] [blame] | 175 | t.Errorf("failed to add device: %s", err) |
Thomas Lee S | e5a4401 | 2019-11-07 20:32:24 +0530 | [diff] [blame] | 176 | } |
Kent Hagerman | 4f355f5 | 2020-03-30 16:01:33 -0400 | [diff] [blame] | 177 | t.Logf("Added device : %+v", TestProxyDevice.Id) |
sbarbari | 17d7e22 | 2019-11-05 10:02:29 -0500 | [diff] [blame] | 178 | |
| 179 | // Verify that the added device can now be retrieved |
Kent Hagerman | 4f355f5 | 2020-03-30 16:01:33 -0400 | [diff] [blame] | 180 | d := &voltha.Device{} |
| 181 | if have, err := TestProxyRootDevice.Get(context.Background(), "devices/"+TestProxyDeviceID, d); err != nil { |
npujar | 9a30c70 | 2019-11-14 17:06:39 +0530 | [diff] [blame] | 182 | BenchmarkProxyLogger.Errorf("Failed get device info from test proxy due to error: %v", err) |
Thomas Lee S | e5a4401 | 2019-11-07 20:32:24 +0530 | [diff] [blame] | 183 | assert.NotNil(t, err) |
Kent Hagerman | 4f355f5 | 2020-03-30 16:01:33 -0400 | [diff] [blame] | 184 | } else if !have { |
sbarbari | 17d7e22 | 2019-11-05 10:02:29 -0500 | [diff] [blame] | 185 | t.Error("Failed to find added device") |
| 186 | } else { |
| 187 | djson, _ := json.Marshal(d) |
| 188 | t.Logf("Found device: %s", string(djson)) |
| 189 | } |
| 190 | } |
| 191 | |
| 192 | func TestProxy_1_1_2_Add_ExistingDevice(t *testing.T) { |
npujar | 9a30c70 | 2019-11-14 17:06:39 +0530 | [diff] [blame] | 193 | TestProxyDevice.Id = TestProxyDeviceID |
sbarbari | 17d7e22 | 2019-11-05 10:02:29 -0500 | [diff] [blame] | 194 | |
Kent Hagerman | 4f355f5 | 2020-03-30 16:01:33 -0400 | [diff] [blame] | 195 | if err := TestProxyRootDevice.add(context.Background(), "devices", TestProxyDevice); err != nil { |
npujar | 9a30c70 | 2019-11-14 17:06:39 +0530 | [diff] [blame] | 196 | BenchmarkProxyLogger.Errorf("Failed to add device to test proxy due to error: %v", err) |
Thomas Lee S | e5a4401 | 2019-11-07 20:32:24 +0530 | [diff] [blame] | 197 | assert.NotNil(t, err) |
| 198 | } |
sbarbari | 17d7e22 | 2019-11-05 10:02:29 -0500 | [diff] [blame] | 199 | |
Kent Hagerman | 4f355f5 | 2020-03-30 16:01:33 -0400 | [diff] [blame] | 200 | d := &voltha.Device{} |
| 201 | if have, err := TestProxyRootDevice.Get(context.Background(), "devices/"+TestProxyDeviceID, d); err != nil { |
| 202 | BenchmarkProxyLogger.Errorf("Failed get device info from test proxy due to error: %v", err) |
| 203 | assert.NotNil(t, err) |
| 204 | } else if !have { |
| 205 | t.Error("Failed to find added device") |
| 206 | } else { |
| 207 | if d.String() != TestProxyDevice.String() { |
| 208 | t.Errorf("Devices don't match - existing: %+v returned: %+v", TestProxyLogicalDevice, d) |
| 209 | } |
| 210 | djson, _ := json.Marshal(d) |
| 211 | t.Logf("Found device: %s", string(djson)) |
sbarbari | 17d7e22 | 2019-11-05 10:02:29 -0500 | [diff] [blame] | 212 | } |
Kent Hagerman | 4f355f5 | 2020-03-30 16:01:33 -0400 | [diff] [blame] | 213 | |
sbarbari | 17d7e22 | 2019-11-05 10:02:29 -0500 | [diff] [blame] | 214 | } |
| 215 | |
| 216 | func TestProxy_1_1_3_Add_NewAdapter(t *testing.T) { |
npujar | 9a30c70 | 2019-11-14 17:06:39 +0530 | [diff] [blame] | 217 | TestProxyAdapterID = "test-adapter" |
| 218 | TestProxyAdapter.Id = TestProxyAdapterID |
sbarbari | 17d7e22 | 2019-11-05 10:02:29 -0500 | [diff] [blame] | 219 | |
| 220 | // Add the adapter |
Kent Hagerman | 4f355f5 | 2020-03-30 16:01:33 -0400 | [diff] [blame] | 221 | if err := TestProxyRootAdapter.AddWithID(context.Background(), "adapters", TestProxyAdapterID, TestProxyAdapter); err != nil { |
npujar | 9a30c70 | 2019-11-14 17:06:39 +0530 | [diff] [blame] | 222 | BenchmarkProxyLogger.Errorf("Failed to add adapter to test proxy due to error: %v", err) |
Thomas Lee S | e5a4401 | 2019-11-07 20:32:24 +0530 | [diff] [blame] | 223 | assert.NotNil(t, err) |
sbarbari | 17d7e22 | 2019-11-05 10:02:29 -0500 | [diff] [blame] | 224 | } else { |
Kent Hagerman | 4f355f5 | 2020-03-30 16:01:33 -0400 | [diff] [blame] | 225 | t.Logf("Added adapter : %+v", TestProxyAdapter.Id) |
sbarbari | 17d7e22 | 2019-11-05 10:02:29 -0500 | [diff] [blame] | 226 | } |
| 227 | |
sbarbari | 17d7e22 | 2019-11-05 10:02:29 -0500 | [diff] [blame] | 228 | // Verify that the added device can now be retrieved |
Kent Hagerman | 4f355f5 | 2020-03-30 16:01:33 -0400 | [diff] [blame] | 229 | d := &voltha.Device{} |
| 230 | if have, err := TestProxyRootAdapter.Get(context.Background(), "adapters/"+TestProxyAdapterID, d); err != nil { |
npujar | 9a30c70 | 2019-11-14 17:06:39 +0530 | [diff] [blame] | 231 | BenchmarkProxyLogger.Errorf("Failed to retrieve device info from test proxy due to error: %v", err) |
Thomas Lee S | e5a4401 | 2019-11-07 20:32:24 +0530 | [diff] [blame] | 232 | assert.NotNil(t, err) |
Kent Hagerman | 4f355f5 | 2020-03-30 16:01:33 -0400 | [diff] [blame] | 233 | } else if !have { |
sbarbari | 17d7e22 | 2019-11-05 10:02:29 -0500 | [diff] [blame] | 234 | t.Error("Failed to find added adapter") |
| 235 | } else { |
| 236 | djson, _ := json.Marshal(d) |
| 237 | t.Logf("Found adapter: %s", string(djson)) |
| 238 | } |
| 239 | |
sbarbari | 17d7e22 | 2019-11-05 10:02:29 -0500 | [diff] [blame] | 240 | } |
| 241 | |
| 242 | func TestProxy_1_2_1_Get_AllDevices(t *testing.T) { |
Kent Hagerman | 4f355f5 | 2020-03-30 16:01:33 -0400 | [diff] [blame] | 243 | var devices []*voltha.Device |
| 244 | if err := TestProxyRootDevice.List(context.Background(), "devices", &devices); err != nil { |
npujar | 9a30c70 | 2019-11-14 17:06:39 +0530 | [diff] [blame] | 245 | BenchmarkProxyLogger.Errorf("Failed to get all devices info from test proxy due to error: %v", err) |
Thomas Lee S | e5a4401 | 2019-11-07 20:32:24 +0530 | [diff] [blame] | 246 | assert.NotNil(t, err) |
| 247 | } |
Kent Hagerman | 4f355f5 | 2020-03-30 16:01:33 -0400 | [diff] [blame] | 248 | if len(devices) == 0 { |
sbarbari | 17d7e22 | 2019-11-05 10:02:29 -0500 | [diff] [blame] | 249 | t.Error("there are no available devices to retrieve") |
| 250 | } else { |
| 251 | // Save the target device id for later tests |
Kent Hagerman | 4f355f5 | 2020-03-30 16:01:33 -0400 | [diff] [blame] | 252 | TestProxyTargetDeviceID = devices[0].Id |
sbarbari | 17d7e22 | 2019-11-05 10:02:29 -0500 | [diff] [blame] | 253 | t.Logf("retrieved all devices: %+v", devices) |
| 254 | } |
| 255 | } |
| 256 | |
| 257 | func TestProxy_1_2_2_Get_SingleDevice(t *testing.T) { |
Kent Hagerman | 4f355f5 | 2020-03-30 16:01:33 -0400 | [diff] [blame] | 258 | d := &voltha.Device{} |
| 259 | if have, err := TestProxyRootDevice.Get(context.Background(), "devices/"+TestProxyTargetDeviceID, d); err != nil { |
npujar | 9a30c70 | 2019-11-14 17:06:39 +0530 | [diff] [blame] | 260 | BenchmarkProxyLogger.Errorf("Failed to get single device info from test proxy due to error: %v", err) |
Thomas Lee S | e5a4401 | 2019-11-07 20:32:24 +0530 | [diff] [blame] | 261 | assert.NotNil(t, err) |
Kent Hagerman | 4f355f5 | 2020-03-30 16:01:33 -0400 | [diff] [blame] | 262 | } else if !have { |
npujar | 9a30c70 | 2019-11-14 17:06:39 +0530 | [diff] [blame] | 263 | t.Errorf("Failed to find device : %s", TestProxyTargetDeviceID) |
sbarbari | 17d7e22 | 2019-11-05 10:02:29 -0500 | [diff] [blame] | 264 | } else { |
| 265 | djson, _ := json.Marshal(d) |
| 266 | t.Logf("Found device: %s", string(djson)) |
| 267 | } |
| 268 | } |
| 269 | |
| 270 | func TestProxy_1_3_1_Update_Device(t *testing.T) { |
| 271 | var fwVersion int |
| 272 | |
Kent Hagerman | 4f355f5 | 2020-03-30 16:01:33 -0400 | [diff] [blame] | 273 | retrieved := &voltha.Device{} |
| 274 | if have, err := TestProxyRootDevice.Get(context.Background(), "devices/"+TestProxyTargetDeviceID, retrieved); err != nil { |
npujar | 9a30c70 | 2019-11-14 17:06:39 +0530 | [diff] [blame] | 275 | BenchmarkProxyLogger.Errorf("Failed to get device info from test proxy due to error: %v", err) |
Thomas Lee S | e5a4401 | 2019-11-07 20:32:24 +0530 | [diff] [blame] | 276 | assert.NotNil(t, err) |
Kent Hagerman | 4f355f5 | 2020-03-30 16:01:33 -0400 | [diff] [blame] | 277 | } else if !have { |
sbarbari | 17d7e22 | 2019-11-05 10:02:29 -0500 | [diff] [blame] | 278 | t.Error("Failed to get device") |
| 279 | } else { |
| 280 | t.Logf("Found raw device (root proxy): %+v", retrieved) |
| 281 | |
Kent Hagerman | 4f355f5 | 2020-03-30 16:01:33 -0400 | [diff] [blame] | 282 | if retrieved.FirmwareVersion == "n/a" { |
sbarbari | 17d7e22 | 2019-11-05 10:02:29 -0500 | [diff] [blame] | 283 | fwVersion = 0 |
| 284 | } else { |
Kent Hagerman | 4f355f5 | 2020-03-30 16:01:33 -0400 | [diff] [blame] | 285 | fwVersion, _ = strconv.Atoi(retrieved.FirmwareVersion) |
sbarbari | 17d7e22 | 2019-11-05 10:02:29 -0500 | [diff] [blame] | 286 | fwVersion++ |
| 287 | } |
| 288 | |
Kent Hagerman | 4f355f5 | 2020-03-30 16:01:33 -0400 | [diff] [blame] | 289 | retrieved.FirmwareVersion = strconv.Itoa(fwVersion) |
sbarbari | 17d7e22 | 2019-11-05 10:02:29 -0500 | [diff] [blame] | 290 | |
Kent Hagerman | 4f355f5 | 2020-03-30 16:01:33 -0400 | [diff] [blame] | 291 | if err := TestProxyRootDevice.Update(context.Background(), "devices/"+TestProxyTargetDeviceID, retrieved); err != nil { |
npujar | 9a30c70 | 2019-11-14 17:06:39 +0530 | [diff] [blame] | 292 | BenchmarkProxyLogger.Errorf("Failed to update device info test proxy due to error: %v", err) |
Thomas Lee S | e5a4401 | 2019-11-07 20:32:24 +0530 | [diff] [blame] | 293 | assert.NotNil(t, err) |
| 294 | } |
Kent Hagerman | 4f355f5 | 2020-03-30 16:01:33 -0400 | [diff] [blame] | 295 | afterUpdate := &voltha.Device{} |
| 296 | if have, err := TestProxyRootDevice.Get(context.Background(), "devices/"+TestProxyTargetDeviceID, afterUpdate); err != nil { |
| 297 | BenchmarkProxyLogger.Errorf("Failed to get device info from test proxy due to error: %v", err) |
| 298 | } else if !have { |
sbarbari | 17d7e22 | 2019-11-05 10:02:29 -0500 | [diff] [blame] | 299 | t.Error("Failed to update device") |
| 300 | } else { |
| 301 | t.Logf("Updated device : %+v", afterUpdate) |
| 302 | } |
| 303 | |
Kent Hagerman | 4f355f5 | 2020-03-30 16:01:33 -0400 | [diff] [blame] | 304 | d := &voltha.Device{} |
| 305 | if have, err := TestProxyRootDevice.Get(context.Background(), "devices/"+TestProxyTargetDeviceID, d); err != nil { |
npujar | 9a30c70 | 2019-11-14 17:06:39 +0530 | [diff] [blame] | 306 | BenchmarkProxyLogger.Errorf("Failed to get device info from test proxy due to error: %v", err) |
Thomas Lee S | e5a4401 | 2019-11-07 20:32:24 +0530 | [diff] [blame] | 307 | assert.NotNil(t, err) |
Kent Hagerman | 4f355f5 | 2020-03-30 16:01:33 -0400 | [diff] [blame] | 308 | } else if !have { |
sbarbari | 17d7e22 | 2019-11-05 10:02:29 -0500 | [diff] [blame] | 309 | t.Error("Failed to find updated device (root proxy)") |
| 310 | } else { |
| 311 | djson, _ := json.Marshal(d) |
| 312 | t.Logf("Found device (root proxy): %s raw: %+v", string(djson), d) |
| 313 | } |
| 314 | } |
| 315 | } |
| 316 | |
sbarbari | 17d7e22 | 2019-11-05 10:02:29 -0500 | [diff] [blame] | 317 | func TestProxy_1_3_3_Update_Adapter(t *testing.T) { |
Neha Sharma | be48593 | 2020-05-25 21:52:55 +0000 | [diff] [blame^] | 318 | ctx := context.Background() |
| 319 | adaptersProxy := NewProxy(ctx, mockBackend, "/adapters") |
Kent Hagerman | 4f355f5 | 2020-03-30 16:01:33 -0400 | [diff] [blame] | 320 | |
| 321 | retrieved := &voltha.Adapter{} |
| 322 | if have, err := TestProxyRootAdapter.Get(context.Background(), "adapters/"+TestProxyAdapterID, retrieved); err != nil { |
npujar | 9a30c70 | 2019-11-14 17:06:39 +0530 | [diff] [blame] | 323 | BenchmarkProxyLogger.Errorf("Failed to retrieve adapter info from adapters proxy due to error: %v", err) |
Thomas Lee S | e5a4401 | 2019-11-07 20:32:24 +0530 | [diff] [blame] | 324 | assert.NotNil(t, err) |
Kent Hagerman | 4f355f5 | 2020-03-30 16:01:33 -0400 | [diff] [blame] | 325 | } else if !have { |
sbarbari | 17d7e22 | 2019-11-05 10:02:29 -0500 | [diff] [blame] | 326 | t.Error("Failed to get adapter") |
| 327 | } else { |
| 328 | t.Logf("Found raw adapter (root proxy): %+v", retrieved) |
| 329 | |
Kent Hagerman | 4f355f5 | 2020-03-30 16:01:33 -0400 | [diff] [blame] | 330 | retrieved.Version = "test-adapter-version-2" |
sbarbari | 17d7e22 | 2019-11-05 10:02:29 -0500 | [diff] [blame] | 331 | |
Kent Hagerman | 4f355f5 | 2020-03-30 16:01:33 -0400 | [diff] [blame] | 332 | if err := adaptersProxy.Update(context.Background(), TestProxyAdapterID, retrieved); err != nil { |
npujar | 9a30c70 | 2019-11-14 17:06:39 +0530 | [diff] [blame] | 333 | BenchmarkProxyLogger.Errorf("Failed to update adapter info in adapters proxy due to error: %v", err) |
Thomas Lee S | e5a4401 | 2019-11-07 20:32:24 +0530 | [diff] [blame] | 334 | assert.NotNil(t, err) |
sbarbari | 17d7e22 | 2019-11-05 10:02:29 -0500 | [diff] [blame] | 335 | } else { |
Kent Hagerman | 4f355f5 | 2020-03-30 16:01:33 -0400 | [diff] [blame] | 336 | t.Logf("Updated adapter : %s", retrieved.Id) |
sbarbari | 17d7e22 | 2019-11-05 10:02:29 -0500 | [diff] [blame] | 337 | } |
| 338 | |
Kent Hagerman | 4f355f5 | 2020-03-30 16:01:33 -0400 | [diff] [blame] | 339 | d := &voltha.Adapter{} |
| 340 | if have, err := TestProxyRootAdapter.Get(context.Background(), "adapters/"+TestProxyAdapterID, d); err != nil { |
npujar | 9a30c70 | 2019-11-14 17:06:39 +0530 | [diff] [blame] | 341 | BenchmarkProxyLogger.Errorf("Failed to get updated adapter info from adapters proxy due to error: %v", err) |
Thomas Lee S | e5a4401 | 2019-11-07 20:32:24 +0530 | [diff] [blame] | 342 | assert.NotNil(t, err) |
Kent Hagerman | 4f355f5 | 2020-03-30 16:01:33 -0400 | [diff] [blame] | 343 | } else if !have { |
sbarbari | 17d7e22 | 2019-11-05 10:02:29 -0500 | [diff] [blame] | 344 | t.Error("Failed to find updated adapter (root proxy)") |
| 345 | } else { |
| 346 | djson, _ := json.Marshal(d) |
| 347 | t.Logf("Found adapter (root proxy): %s raw: %+v", string(djson), d) |
| 348 | } |
| 349 | } |
| 350 | } |
| 351 | |
| 352 | func TestProxy_1_4_1_Remove_Device(t *testing.T) { |
Kent Hagerman | 4f355f5 | 2020-03-30 16:01:33 -0400 | [diff] [blame] | 353 | if err := TestProxyRootDevice.Remove(context.Background(), "devices/"+TestProxyDeviceID); err != nil { |
npujar | 9a30c70 | 2019-11-14 17:06:39 +0530 | [diff] [blame] | 354 | BenchmarkProxyLogger.Errorf("Failed to remove device from devices proxy due to error: %v", err) |
Kent Hagerman | 4f355f5 | 2020-03-30 16:01:33 -0400 | [diff] [blame] | 355 | t.Errorf("failed to remove device: %s", err) |
sbarbari | 17d7e22 | 2019-11-05 10:02:29 -0500 | [diff] [blame] | 356 | } else { |
Kent Hagerman | 4f355f5 | 2020-03-30 16:01:33 -0400 | [diff] [blame] | 357 | t.Logf("Removed device : %+v", TestProxyDeviceID) |
sbarbari | 17d7e22 | 2019-11-05 10:02:29 -0500 | [diff] [blame] | 358 | } |
| 359 | |
Kent Hagerman | 4f355f5 | 2020-03-30 16:01:33 -0400 | [diff] [blame] | 360 | d := &voltha.Device{} |
| 361 | have, err := TestProxyRootDevice.Get(context.Background(), "devices/"+TestProxyDeviceID, d) |
Thomas Lee S | e5a4401 | 2019-11-07 20:32:24 +0530 | [diff] [blame] | 362 | if err != nil { |
npujar | 9a30c70 | 2019-11-14 17:06:39 +0530 | [diff] [blame] | 363 | BenchmarkProxyLogger.Errorf("Failed to get device info from devices proxy due to error: %v", err) |
Thomas Lee S | e5a4401 | 2019-11-07 20:32:24 +0530 | [diff] [blame] | 364 | assert.NotNil(t, err) |
Kent Hagerman | 4f355f5 | 2020-03-30 16:01:33 -0400 | [diff] [blame] | 365 | } else if have { |
sbarbari | 17d7e22 | 2019-11-05 10:02:29 -0500 | [diff] [blame] | 366 | djson, _ := json.Marshal(d) |
| 367 | t.Errorf("Device was not removed - %s", djson) |
| 368 | } else { |
npujar | 9a30c70 | 2019-11-14 17:06:39 +0530 | [diff] [blame] | 369 | t.Logf("Device was removed: %s", TestProxyDeviceID) |
sbarbari | 17d7e22 | 2019-11-05 10:02:29 -0500 | [diff] [blame] | 370 | } |
| 371 | } |
| 372 | |
| 373 | func TestProxy_2_1_1_Add_NewLogicalDevice(t *testing.T) { |
| 374 | |
| 375 | ldIDBin, _ := uuid.New().MarshalBinary() |
npujar | 9a30c70 | 2019-11-14 17:06:39 +0530 | [diff] [blame] | 376 | TestProxyLogicalDeviceID = "0001" + hex.EncodeToString(ldIDBin)[:12] |
| 377 | TestProxyLogicalDevice.Id = TestProxyLogicalDeviceID |
sbarbari | 17d7e22 | 2019-11-05 10:02:29 -0500 | [diff] [blame] | 378 | |
Kent Hagerman | 4f355f5 | 2020-03-30 16:01:33 -0400 | [diff] [blame] | 379 | if err := TestProxyRootLogicalDevice.AddWithID(context.Background(), "logical_devices", TestProxyLogicalDeviceID, TestProxyLogicalDevice); err != nil { |
npujar | 9a30c70 | 2019-11-14 17:06:39 +0530 | [diff] [blame] | 380 | BenchmarkProxyLogger.Errorf("Failed to add new logical device into proxy due to error: %v", err) |
Thomas Lee S | e5a4401 | 2019-11-07 20:32:24 +0530 | [diff] [blame] | 381 | assert.NotNil(t, err) |
sbarbari | 17d7e22 | 2019-11-05 10:02:29 -0500 | [diff] [blame] | 382 | } else { |
Kent Hagerman | 4f355f5 | 2020-03-30 16:01:33 -0400 | [diff] [blame] | 383 | t.Logf("Added logical device : %s", TestProxyLogicalDevice.Id) |
sbarbari | 17d7e22 | 2019-11-05 10:02:29 -0500 | [diff] [blame] | 384 | } |
| 385 | |
Kent Hagerman | 4f355f5 | 2020-03-30 16:01:33 -0400 | [diff] [blame] | 386 | ld := &voltha.LogicalDevice{} |
| 387 | if have, err := TestProxyRootLogicalDevice.Get(context.Background(), "logical_devices/"+TestProxyLogicalDeviceID, ld); err != nil { |
npujar | 9a30c70 | 2019-11-14 17:06:39 +0530 | [diff] [blame] | 388 | BenchmarkProxyLogger.Errorf("Failed to get logical device info from logical device proxy due to error: %v", err) |
Thomas Lee S | e5a4401 | 2019-11-07 20:32:24 +0530 | [diff] [blame] | 389 | assert.NotNil(t, err) |
Kent Hagerman | 4f355f5 | 2020-03-30 16:01:33 -0400 | [diff] [blame] | 390 | } else if !have { |
sbarbari | 17d7e22 | 2019-11-05 10:02:29 -0500 | [diff] [blame] | 391 | t.Error("Failed to find added logical device") |
| 392 | } else { |
| 393 | ldJSON, _ := json.Marshal(ld) |
| 394 | t.Logf("Found logical device: %s", string(ldJSON)) |
| 395 | } |
sbarbari | 17d7e22 | 2019-11-05 10:02:29 -0500 | [diff] [blame] | 396 | } |
| 397 | |
| 398 | func TestProxy_2_1_2_Add_ExistingLogicalDevice(t *testing.T) { |
npujar | 9a30c70 | 2019-11-14 17:06:39 +0530 | [diff] [blame] | 399 | TestProxyLogicalDevice.Id = TestProxyLogicalDeviceID |
sbarbari | 17d7e22 | 2019-11-05 10:02:29 -0500 | [diff] [blame] | 400 | |
Kent Hagerman | 4f355f5 | 2020-03-30 16:01:33 -0400 | [diff] [blame] | 401 | if err := TestProxyRootLogicalDevice.add(context.Background(), "logical_devices", TestProxyLogicalDevice); err != nil { |
npujar | 9a30c70 | 2019-11-14 17:06:39 +0530 | [diff] [blame] | 402 | BenchmarkProxyLogger.Errorf("Failed to add logical device due to error: %v", err) |
Thomas Lee S | e5a4401 | 2019-11-07 20:32:24 +0530 | [diff] [blame] | 403 | assert.NotNil(t, err) |
| 404 | } |
Kent Hagerman | 4f355f5 | 2020-03-30 16:01:33 -0400 | [diff] [blame] | 405 | |
| 406 | device := &voltha.LogicalDevice{} |
| 407 | if have, err := TestProxyRootLogicalDevice.Get(context.Background(), "logical_devices", device); err != nil { |
| 408 | BenchmarkProxyLogger.Errorf("Failed to get logical device info from logical device proxy due to error: %v", err) |
| 409 | assert.NotNil(t, err) |
| 410 | } else if !have { |
| 411 | t.Error("Failed to find added logical device") |
| 412 | } else { |
| 413 | if device.String() != TestProxyLogicalDevice.String() { |
| 414 | t.Errorf("Logical devices don't match - existing: %+v returned: %+v", TestProxyLogicalDevice, device) |
| 415 | } |
sbarbari | 17d7e22 | 2019-11-05 10:02:29 -0500 | [diff] [blame] | 416 | } |
| 417 | } |
| 418 | |
| 419 | func TestProxy_2_2_1_Get_AllLogicalDevices(t *testing.T) { |
Kent Hagerman | 4f355f5 | 2020-03-30 16:01:33 -0400 | [diff] [blame] | 420 | var logicalDevices []*voltha.LogicalDevice |
| 421 | if err := TestProxyRootLogicalDevice.List(context.Background(), "logical_devices", &logicalDevices); err != nil { |
npujar | 9a30c70 | 2019-11-14 17:06:39 +0530 | [diff] [blame] | 422 | BenchmarkProxyLogger.Errorf("Failed to get all logical devices from proxy due to error: %v", err) |
Thomas Lee S | e5a4401 | 2019-11-07 20:32:24 +0530 | [diff] [blame] | 423 | assert.NotNil(t, err) |
| 424 | } |
Kent Hagerman | 4f355f5 | 2020-03-30 16:01:33 -0400 | [diff] [blame] | 425 | if len(logicalDevices) == 0 { |
sbarbari | 17d7e22 | 2019-11-05 10:02:29 -0500 | [diff] [blame] | 426 | t.Error("there are no available logical devices to retrieve") |
| 427 | } else { |
| 428 | // Save the target device id for later tests |
Kent Hagerman | 4f355f5 | 2020-03-30 16:01:33 -0400 | [diff] [blame] | 429 | TestProxyTargetLogicalDeviceID = logicalDevices[0].Id |
sbarbari | 17d7e22 | 2019-11-05 10:02:29 -0500 | [diff] [blame] | 430 | t.Logf("retrieved all logical devices: %+v", logicalDevices) |
| 431 | } |
| 432 | } |
| 433 | |
| 434 | func TestProxy_2_2_2_Get_SingleLogicalDevice(t *testing.T) { |
Kent Hagerman | 4f355f5 | 2020-03-30 16:01:33 -0400 | [diff] [blame] | 435 | ld := &voltha.LogicalDevice{} |
| 436 | if have, err := TestProxyRootLogicalDevice.Get(context.Background(), "logical_devices/"+TestProxyTargetLogicalDeviceID, ld); err != nil { |
npujar | 9a30c70 | 2019-11-14 17:06:39 +0530 | [diff] [blame] | 437 | BenchmarkProxyLogger.Errorf("Failed to get single logical device from proxy due to error: %v", err) |
Thomas Lee S | e5a4401 | 2019-11-07 20:32:24 +0530 | [diff] [blame] | 438 | assert.NotNil(t, err) |
Kent Hagerman | 4f355f5 | 2020-03-30 16:01:33 -0400 | [diff] [blame] | 439 | } else if !have { |
npujar | 9a30c70 | 2019-11-14 17:06:39 +0530 | [diff] [blame] | 440 | t.Errorf("Failed to find logical device : %s", TestProxyTargetLogicalDeviceID) |
sbarbari | 17d7e22 | 2019-11-05 10:02:29 -0500 | [diff] [blame] | 441 | } else { |
| 442 | ldJSON, _ := json.Marshal(ld) |
| 443 | t.Logf("Found logical device: %s", string(ldJSON)) |
| 444 | } |
| 445 | |
| 446 | } |
| 447 | |
| 448 | func TestProxy_2_3_1_Update_LogicalDevice(t *testing.T) { |
| 449 | var fwVersion int |
sbarbari | 17d7e22 | 2019-11-05 10:02:29 -0500 | [diff] [blame] | 450 | |
Kent Hagerman | 4f355f5 | 2020-03-30 16:01:33 -0400 | [diff] [blame] | 451 | retrieved := &voltha.LogicalDevice{} |
| 452 | if have, err := TestProxyRootLogicalDevice.Get(context.Background(), "logical_devices/"+TestProxyTargetLogicalDeviceID, retrieved); err != nil { |
npujar | 9a30c70 | 2019-11-14 17:06:39 +0530 | [diff] [blame] | 453 | BenchmarkProxyLogger.Errorf("Failed to get logical devices due to error: %v", err) |
Thomas Lee S | e5a4401 | 2019-11-07 20:32:24 +0530 | [diff] [blame] | 454 | assert.NotNil(t, err) |
Kent Hagerman | 4f355f5 | 2020-03-30 16:01:33 -0400 | [diff] [blame] | 455 | } else if !have { |
sbarbari | 17d7e22 | 2019-11-05 10:02:29 -0500 | [diff] [blame] | 456 | t.Error("Failed to get logical device") |
| 457 | } else { |
| 458 | t.Logf("Found raw logical device (root proxy): %+v", retrieved) |
| 459 | |
Kent Hagerman | 4f355f5 | 2020-03-30 16:01:33 -0400 | [diff] [blame] | 460 | if retrieved.RootDeviceId == "" { |
sbarbari | 17d7e22 | 2019-11-05 10:02:29 -0500 | [diff] [blame] | 461 | fwVersion = 0 |
| 462 | } else { |
Kent Hagerman | 4f355f5 | 2020-03-30 16:01:33 -0400 | [diff] [blame] | 463 | fwVersion, _ = strconv.Atoi(retrieved.RootDeviceId) |
sbarbari | 17d7e22 | 2019-11-05 10:02:29 -0500 | [diff] [blame] | 464 | fwVersion++ |
| 465 | } |
| 466 | |
Kent Hagerman | 4f355f5 | 2020-03-30 16:01:33 -0400 | [diff] [blame] | 467 | retrieved.RootDeviceId = strconv.Itoa(fwVersion) |
sbarbari | 17d7e22 | 2019-11-05 10:02:29 -0500 | [diff] [blame] | 468 | |
Kent Hagerman | 4f355f5 | 2020-03-30 16:01:33 -0400 | [diff] [blame] | 469 | if err := TestProxyRootLogicalDevice.Update(context.Background(), "logical_devices/"+TestProxyTargetLogicalDeviceID, retrieved); err != nil { |
npujar | 9a30c70 | 2019-11-14 17:06:39 +0530 | [diff] [blame] | 470 | BenchmarkProxyLogger.Errorf("Faield to update logical device info due to error: %v", err) |
Thomas Lee S | e5a4401 | 2019-11-07 20:32:24 +0530 | [diff] [blame] | 471 | assert.NotNil(t, err) |
sbarbari | 17d7e22 | 2019-11-05 10:02:29 -0500 | [diff] [blame] | 472 | } else { |
Kent Hagerman | 4f355f5 | 2020-03-30 16:01:33 -0400 | [diff] [blame] | 473 | t.Log("Updated logical device") |
sbarbari | 17d7e22 | 2019-11-05 10:02:29 -0500 | [diff] [blame] | 474 | } |
| 475 | |
Kent Hagerman | 4f355f5 | 2020-03-30 16:01:33 -0400 | [diff] [blame] | 476 | d := &voltha.LogicalDevice{} |
| 477 | if have, err := TestProxyRootLogicalDevice.Get(context.Background(), "logical_devices/"+TestProxyTargetLogicalDeviceID, d); err != nil { |
npujar | 9a30c70 | 2019-11-14 17:06:39 +0530 | [diff] [blame] | 478 | BenchmarkProxyLogger.Errorf("Failed to get logical device info due to error: %v", err) |
Thomas Lee S | e5a4401 | 2019-11-07 20:32:24 +0530 | [diff] [blame] | 479 | assert.NotNil(t, err) |
Kent Hagerman | 4f355f5 | 2020-03-30 16:01:33 -0400 | [diff] [blame] | 480 | } else if !have { |
sbarbari | 17d7e22 | 2019-11-05 10:02:29 -0500 | [diff] [blame] | 481 | t.Error("Failed to find updated logical device (root proxy)") |
| 482 | } else { |
| 483 | djson, _ := json.Marshal(d) |
sbarbari | 17d7e22 | 2019-11-05 10:02:29 -0500 | [diff] [blame] | 484 | t.Logf("Found logical device (root proxy): %s raw: %+v", string(djson), d) |
| 485 | } |
| 486 | } |
| 487 | } |
| 488 | |
sbarbari | 17d7e22 | 2019-11-05 10:02:29 -0500 | [diff] [blame] | 489 | func TestProxy_2_4_1_Remove_Device(t *testing.T) { |
Kent Hagerman | 4f355f5 | 2020-03-30 16:01:33 -0400 | [diff] [blame] | 490 | if err := TestProxyRootLogicalDevice.Remove(context.Background(), "logical_devices/"+TestProxyLogicalDeviceID); err != nil { |
npujar | 9a30c70 | 2019-11-14 17:06:39 +0530 | [diff] [blame] | 491 | BenchmarkProxyLogger.Errorf("Failed to remove device from logical devices proxy due to error: %v", err) |
Kent Hagerman | 4f355f5 | 2020-03-30 16:01:33 -0400 | [diff] [blame] | 492 | t.Errorf("Failed to remove logical device: %s", err) |
sbarbari | 17d7e22 | 2019-11-05 10:02:29 -0500 | [diff] [blame] | 493 | } else { |
Kent Hagerman | 4f355f5 | 2020-03-30 16:01:33 -0400 | [diff] [blame] | 494 | t.Logf("Removed device : %+v", TestProxyLogicalDeviceID) |
sbarbari | 17d7e22 | 2019-11-05 10:02:29 -0500 | [diff] [blame] | 495 | } |
| 496 | |
Kent Hagerman | 4f355f5 | 2020-03-30 16:01:33 -0400 | [diff] [blame] | 497 | d := &voltha.LogicalDevice{} |
| 498 | if have, err := TestProxyRootLogicalDevice.Get(context.Background(), "logical_devices/"+TestProxyLogicalDeviceID, d); err != nil { |
npujar | 9a30c70 | 2019-11-14 17:06:39 +0530 | [diff] [blame] | 499 | BenchmarkProxyLogger.Errorf("Failed to get logical device info due to error: %v", err) |
Thomas Lee S | e5a4401 | 2019-11-07 20:32:24 +0530 | [diff] [blame] | 500 | assert.NotNil(t, err) |
Kent Hagerman | 4f355f5 | 2020-03-30 16:01:33 -0400 | [diff] [blame] | 501 | } else if have { |
sbarbari | 17d7e22 | 2019-11-05 10:02:29 -0500 | [diff] [blame] | 502 | djson, _ := json.Marshal(d) |
| 503 | t.Errorf("Device was not removed - %s", djson) |
| 504 | } else { |
npujar | 9a30c70 | 2019-11-14 17:06:39 +0530 | [diff] [blame] | 505 | t.Logf("Device was removed: %s", TestProxyLogicalDeviceID) |
sbarbari | 17d7e22 | 2019-11-05 10:02:29 -0500 | [diff] [blame] | 506 | } |
| 507 | } |