blob: 33171ee134c816e27239fb87c4abad3fe61e7f6a [file] [log] [blame]
khenaidoo0a822f92019-05-08 15:15:57 -04001/*
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 */
16package core
17
18import (
khenaidoo0a822f92019-05-08 15:15:57 -040019 "github.com/opencord/voltha-go/rw_core/coreIf"
Scott Baker807addd2019-10-24 15:16:21 -070020 "github.com/opencord/voltha-lib-go/v2/pkg/log"
Scott Baker555307d2019-11-04 08:58:01 -080021 "github.com/opencord/voltha-protos/v2/go/voltha"
khenaidoo0a822f92019-05-08 15:15:57 -040022 "github.com/stretchr/testify/assert"
23 "reflect"
24 "testing"
25)
26
27var transitionMap *TransitionMap
28var tdm coreIf.DeviceManager
29
30type testDeviceManager struct {
31}
32
33func newTestDeviceManager() *testDeviceManager {
34 return &testDeviceManager{}
35}
36
37func (tdm *testDeviceManager) GetDevice(string) (*voltha.Device, error) {
38 return nil, nil
39}
40
41func (tdm *testDeviceManager) IsRootDevice(string) (bool, error) {
42 return false, nil
43}
44
45func (tdm *testDeviceManager) NotifyInvalidTransition(pto *voltha.Device) error {
46 return nil
47}
48
49func (tdm *testDeviceManager) SetAdminStateToEnable(to *voltha.Device) error {
50 return nil
51}
52
53func (tdm *testDeviceManager) CreateLogicalDevice(to *voltha.Device) error {
54 return nil
55}
56
57func (tdm *testDeviceManager) SetupUNILogicalPorts(to *voltha.Device) error {
58 return nil
59}
60
61func (tdm *testDeviceManager) DisableAllChildDevices(to *voltha.Device) error {
62 return nil
63}
64
65func (tdm *testDeviceManager) DeleteLogicalDevice(to *voltha.Device) error {
66 return nil
67}
68
69func (tdm *testDeviceManager) DeleteLogicalPorts(to *voltha.Device) error {
70 return nil
71}
72
73func (tdm *testDeviceManager) DeleteAllChildDevices(to *voltha.Device) error {
74 return nil
75}
76
77func (tdm *testDeviceManager) RunPostDeviceDelete(to *voltha.Device) error {
78 return nil
79}
80
81func init() {
82 log.AddPackage(log.JSON, log.WarnLevel, nil)
83 //log.UpdateAllLoggers(log.Fields{"instanceId": "device-state-transition"})
84 //log.SetAllLogLevel(log.DebugLevel)
85 tdm = newTestDeviceManager()
86 transitionMap = NewTransitionMap(tdm)
87}
88
89func getDevice(root bool, admin voltha.AdminState_AdminState, conn voltha.ConnectStatus_ConnectStatus, oper voltha.OperStatus_OperStatus) *voltha.Device {
90 return &voltha.Device{
91 Id: "test",
92 Root: root,
93 AdminState: admin,
94 ConnectStatus: conn,
95 OperStatus: oper,
96 }
97}
98
99func assertInvalidTransition(t *testing.T, from *voltha.Device, to *voltha.Device) {
100 handlers := transitionMap.GetTransitionHandler(from, to)
101 assert.Equal(t, 1, len(handlers))
102 assert.True(t, reflect.ValueOf(tdm.NotifyInvalidTransition).Pointer() == reflect.ValueOf(handlers[0]).Pointer())
103}
104
105func assertNoOpTransition(t *testing.T, from *voltha.Device, to *voltha.Device) {
106 handlers := transitionMap.GetTransitionHandler(from, to)
107 assert.Equal(t, 0, len(handlers))
108}
109
110func TestValidTransitions(t *testing.T) {
khenaidoo59ef7be2019-06-21 12:40:28 -0400111 from := getDevice(true, voltha.AdminState_ENABLED, voltha.ConnectStatus_UNKNOWN, voltha.OperStatus_ACTIVATING)
112 to := getDevice(true, voltha.AdminState_ENABLED, voltha.ConnectStatus_UNKNOWN, voltha.OperStatus_ACTIVE)
khenaidoo0a822f92019-05-08 15:15:57 -0400113 handlers := transitionMap.GetTransitionHandler(from, to)
114 assert.Equal(t, 1, len(handlers))
khenaidoo59ef7be2019-06-21 12:40:28 -0400115 assert.True(t, reflect.ValueOf(tdm.CreateLogicalDevice).Pointer() == reflect.ValueOf(handlers[0]).Pointer())
khenaidoo0a822f92019-05-08 15:15:57 -0400116
khenaidoo59ef7be2019-06-21 12:40:28 -0400117 from = getDevice(true, voltha.AdminState_ENABLED, voltha.ConnectStatus_UNKNOWN, voltha.OperStatus_ACTIVATING)
118 to = getDevice(true, voltha.AdminState_ENABLED, voltha.ConnectStatus_REACHABLE, voltha.OperStatus_ACTIVE)
119 handlers = transitionMap.GetTransitionHandler(from, to)
120 assert.Equal(t, 1, len(handlers))
121 assert.True(t, reflect.ValueOf(tdm.CreateLogicalDevice).Pointer() == reflect.ValueOf(handlers[0]).Pointer())
122
123 from = getDevice(true, voltha.AdminState_ENABLED, voltha.ConnectStatus_UNKNOWN, voltha.OperStatus_ACTIVATING)
124 to = getDevice(true, voltha.AdminState_ENABLED, voltha.ConnectStatus_UNREACHABLE, voltha.OperStatus_ACTIVE)
125 handlers = transitionMap.GetTransitionHandler(from, to)
126 assert.Equal(t, 1, len(handlers))
127 assert.True(t, reflect.ValueOf(tdm.CreateLogicalDevice).Pointer() == reflect.ValueOf(handlers[0]).Pointer())
128
129 from = getDevice(true, voltha.AdminState_ENABLED, voltha.ConnectStatus_UNREACHABLE, voltha.OperStatus_ACTIVATING)
130 to = getDevice(true, voltha.AdminState_ENABLED, voltha.ConnectStatus_UNREACHABLE, voltha.OperStatus_ACTIVE)
131 handlers = transitionMap.GetTransitionHandler(from, to)
132 assert.Equal(t, 1, len(handlers))
133 assert.True(t, reflect.ValueOf(tdm.CreateLogicalDevice).Pointer() == reflect.ValueOf(handlers[0]).Pointer())
134
135 from = getDevice(true, voltha.AdminState_ENABLED, voltha.ConnectStatus_UNREACHABLE, voltha.OperStatus_ACTIVATING)
khenaidoo0a822f92019-05-08 15:15:57 -0400136 to = getDevice(true, voltha.AdminState_ENABLED, voltha.ConnectStatus_UNKNOWN, voltha.OperStatus_ACTIVE)
137 handlers = transitionMap.GetTransitionHandler(from, to)
138 assert.Equal(t, 1, len(handlers))
139 assert.True(t, reflect.ValueOf(tdm.CreateLogicalDevice).Pointer() == reflect.ValueOf(handlers[0]).Pointer())
140
khenaidoo59ef7be2019-06-21 12:40:28 -0400141 from = getDevice(false, voltha.AdminState_ENABLED, voltha.ConnectStatus_UNKNOWN, voltha.OperStatus_DISCOVERED)
khenaidoo0a822f92019-05-08 15:15:57 -0400142 to = getDevice(false, voltha.AdminState_ENABLED, voltha.ConnectStatus_UNKNOWN, voltha.OperStatus_ACTIVE)
143 handlers = transitionMap.GetTransitionHandler(from, to)
144 assert.Equal(t, 1, len(handlers))
145 assert.True(t, reflect.ValueOf(tdm.SetupUNILogicalPorts).Pointer() == reflect.ValueOf(handlers[0]).Pointer())
146
khenaidoo59ef7be2019-06-21 12:40:28 -0400147 from = getDevice(false, voltha.AdminState_ENABLED, voltha.ConnectStatus_UNKNOWN, voltha.OperStatus_DISCOVERED)
148 to = getDevice(false, voltha.AdminState_ENABLED, voltha.ConnectStatus_UNREACHABLE, voltha.OperStatus_ACTIVE)
149 handlers = transitionMap.GetTransitionHandler(from, to)
150 assert.Equal(t, 1, len(handlers))
151 assert.True(t, reflect.ValueOf(tdm.SetupUNILogicalPorts).Pointer() == reflect.ValueOf(handlers[0]).Pointer())
152
153 from = getDevice(false, voltha.AdminState_ENABLED, voltha.ConnectStatus_UNKNOWN, voltha.OperStatus_DISCOVERED)
154 to = getDevice(false, voltha.AdminState_ENABLED, voltha.ConnectStatus_REACHABLE, voltha.OperStatus_ACTIVE)
155 handlers = transitionMap.GetTransitionHandler(from, to)
156 assert.Equal(t, 1, len(handlers))
157 assert.True(t, reflect.ValueOf(tdm.SetupUNILogicalPorts).Pointer() == reflect.ValueOf(handlers[0]).Pointer())
158
159 from = getDevice(false, voltha.AdminState_ENABLED, voltha.ConnectStatus_REACHABLE, voltha.OperStatus_DISCOVERED)
160 to = getDevice(false, voltha.AdminState_ENABLED, voltha.ConnectStatus_REACHABLE, voltha.OperStatus_ACTIVE)
161 handlers = transitionMap.GetTransitionHandler(from, to)
162 assert.Equal(t, 1, len(handlers))
163 assert.True(t, reflect.ValueOf(tdm.SetupUNILogicalPorts).Pointer() == reflect.ValueOf(handlers[0]).Pointer())
164
165 from = getDevice(false, voltha.AdminState_ENABLED, voltha.ConnectStatus_UNREACHABLE, voltha.OperStatus_DISCOVERED)
166 to = getDevice(false, voltha.AdminState_ENABLED, voltha.ConnectStatus_REACHABLE, voltha.OperStatus_ACTIVE)
167 handlers = transitionMap.GetTransitionHandler(from, to)
168 assert.Equal(t, 1, len(handlers))
169 assert.True(t, reflect.ValueOf(tdm.SetupUNILogicalPorts).Pointer() == reflect.ValueOf(handlers[0]).Pointer())
170
171 from = getDevice(false, voltha.AdminState_ENABLED, voltha.ConnectStatus_UNKNOWN, voltha.OperStatus_ACTIVATING)
172 to = getDevice(false, voltha.AdminState_ENABLED, voltha.ConnectStatus_UNKNOWN, voltha.OperStatus_ACTIVE)
173 handlers = transitionMap.GetTransitionHandler(from, to)
174 assert.Equal(t, 1, len(handlers))
175 assert.True(t, reflect.ValueOf(tdm.SetupUNILogicalPorts).Pointer() == reflect.ValueOf(handlers[0]).Pointer())
176
177 from = getDevice(false, voltha.AdminState_ENABLED, voltha.ConnectStatus_UNKNOWN, voltha.OperStatus_ACTIVATING)
178 to = getDevice(false, voltha.AdminState_ENABLED, voltha.ConnectStatus_UNREACHABLE, voltha.OperStatus_ACTIVE)
179 handlers = transitionMap.GetTransitionHandler(from, to)
180 assert.Equal(t, 1, len(handlers))
181 assert.True(t, reflect.ValueOf(tdm.SetupUNILogicalPorts).Pointer() == reflect.ValueOf(handlers[0]).Pointer())
182
183 from = getDevice(false, voltha.AdminState_ENABLED, voltha.ConnectStatus_UNKNOWN, voltha.OperStatus_ACTIVATING)
184 to = getDevice(false, voltha.AdminState_ENABLED, voltha.ConnectStatus_REACHABLE, voltha.OperStatus_ACTIVE)
185 handlers = transitionMap.GetTransitionHandler(from, to)
186 assert.Equal(t, 1, len(handlers))
187 assert.True(t, reflect.ValueOf(tdm.SetupUNILogicalPorts).Pointer() == reflect.ValueOf(handlers[0]).Pointer())
188
189 from = getDevice(false, voltha.AdminState_ENABLED, voltha.ConnectStatus_REACHABLE, voltha.OperStatus_ACTIVATING)
190 to = getDevice(false, voltha.AdminState_ENABLED, voltha.ConnectStatus_UNREACHABLE, voltha.OperStatus_ACTIVE)
191 handlers = transitionMap.GetTransitionHandler(from, to)
192 assert.Equal(t, 1, len(handlers))
193 assert.True(t, reflect.ValueOf(tdm.SetupUNILogicalPorts).Pointer() == reflect.ValueOf(handlers[0]).Pointer())
194
195 from = getDevice(false, voltha.AdminState_ENABLED, voltha.ConnectStatus_UNREACHABLE, voltha.OperStatus_ACTIVATING)
196 to = getDevice(false, voltha.AdminState_ENABLED, voltha.ConnectStatus_UNREACHABLE, voltha.OperStatus_ACTIVE)
197 handlers = transitionMap.GetTransitionHandler(from, to)
198 assert.Equal(t, 1, len(handlers))
199 assert.True(t, reflect.ValueOf(tdm.SetupUNILogicalPorts).Pointer() == reflect.ValueOf(handlers[0]).Pointer())
200
khenaidoo59ef7be2019-06-21 12:40:28 -0400201 from = getDevice(true, voltha.AdminState_PREPROVISIONED, voltha.ConnectStatus_UNKNOWN, voltha.OperStatus_UNKNOWN)
202 to = getDevice(true, voltha.AdminState_DELETED, voltha.ConnectStatus_UNKNOWN, voltha.OperStatus_UNKNOWN)
203 handlers = transitionMap.GetTransitionHandler(from, to)
204 assert.Equal(t, 1, len(handlers))
205 assert.True(t, reflect.ValueOf(tdm.RunPostDeviceDelete).Pointer() == reflect.ValueOf(handlers[0]).Pointer())
206
207 from = getDevice(false, voltha.AdminState_PREPROVISIONED, voltha.ConnectStatus_UNKNOWN, voltha.OperStatus_UNKNOWN)
208 to = getDevice(false, voltha.AdminState_DELETED, voltha.ConnectStatus_UNKNOWN, voltha.OperStatus_UNKNOWN)
209 handlers = transitionMap.GetTransitionHandler(from, to)
210 assert.Equal(t, 1, len(handlers))
211 assert.True(t, reflect.ValueOf(tdm.RunPostDeviceDelete).Pointer() == reflect.ValueOf(handlers[0]).Pointer())
khenaidoo0a822f92019-05-08 15:15:57 -0400212
213 from = getDevice(true, voltha.AdminState_DISABLED, voltha.ConnectStatus_UNKNOWN, voltha.OperStatus_UNKNOWN)
214 to = getDevice(true, voltha.AdminState_DELETED, voltha.ConnectStatus_UNKNOWN, voltha.OperStatus_UNKNOWN)
215 handlers = transitionMap.GetTransitionHandler(from, to)
Devmalya Paul84169b52019-08-27 19:31:44 -0400216 assert.Equal(t, 4, len(handlers))
217 assert.True(t, reflect.ValueOf(tdm.DisableAllChildDevices).Pointer() == reflect.ValueOf(handlers[0]).Pointer())
218 assert.True(t, reflect.ValueOf(tdm.DeleteAllChildDevices).Pointer() == reflect.ValueOf(handlers[1]).Pointer())
219 assert.True(t, reflect.ValueOf(tdm.DeleteLogicalDevice).Pointer() == reflect.ValueOf(handlers[2]).Pointer())
220 assert.True(t, reflect.ValueOf(tdm.RunPostDeviceDelete).Pointer() == reflect.ValueOf(handlers[3]).Pointer())
khenaidoo0a822f92019-05-08 15:15:57 -0400221
khenaidoo59ef7be2019-06-21 12:40:28 -0400222 from = getDevice(true, voltha.AdminState_DISABLED, voltha.ConnectStatus_REACHABLE, voltha.OperStatus_UNKNOWN)
223 to = getDevice(true, voltha.AdminState_DELETED, voltha.ConnectStatus_UNREACHABLE, voltha.OperStatus_UNKNOWN)
224 handlers = transitionMap.GetTransitionHandler(from, to)
Devmalya Paul84169b52019-08-27 19:31:44 -0400225 assert.Equal(t, 4, len(handlers))
226 assert.True(t, reflect.ValueOf(tdm.DisableAllChildDevices).Pointer() == reflect.ValueOf(handlers[0]).Pointer())
227 assert.True(t, reflect.ValueOf(tdm.DeleteAllChildDevices).Pointer() == reflect.ValueOf(handlers[1]).Pointer())
228 assert.True(t, reflect.ValueOf(tdm.DeleteLogicalDevice).Pointer() == reflect.ValueOf(handlers[2]).Pointer())
229 assert.True(t, reflect.ValueOf(tdm.RunPostDeviceDelete).Pointer() == reflect.ValueOf(handlers[3]).Pointer())
khenaidoo59ef7be2019-06-21 12:40:28 -0400230
231 from = getDevice(true, voltha.AdminState_DISABLED, voltha.ConnectStatus_UNREACHABLE, voltha.OperStatus_UNKNOWN)
232 to = getDevice(true, voltha.AdminState_DELETED, voltha.ConnectStatus_UNREACHABLE, voltha.OperStatus_FAILED)
233 handlers = transitionMap.GetTransitionHandler(from, to)
Devmalya Paul84169b52019-08-27 19:31:44 -0400234 assert.Equal(t, 4, len(handlers))
235 assert.True(t, reflect.ValueOf(tdm.DisableAllChildDevices).Pointer() == reflect.ValueOf(handlers[0]).Pointer())
236 assert.True(t, reflect.ValueOf(tdm.DeleteAllChildDevices).Pointer() == reflect.ValueOf(handlers[1]).Pointer())
237 assert.True(t, reflect.ValueOf(tdm.DeleteLogicalDevice).Pointer() == reflect.ValueOf(handlers[2]).Pointer())
238 assert.True(t, reflect.ValueOf(tdm.RunPostDeviceDelete).Pointer() == reflect.ValueOf(handlers[3]).Pointer())
khenaidoo59ef7be2019-06-21 12:40:28 -0400239
khenaidoo0a822f92019-05-08 15:15:57 -0400240 from = getDevice(false, voltha.AdminState_DISABLED, voltha.ConnectStatus_UNKNOWN, voltha.OperStatus_UNKNOWN)
241 to = getDevice(false, voltha.AdminState_DELETED, voltha.ConnectStatus_UNKNOWN, voltha.OperStatus_UNKNOWN)
242 handlers = transitionMap.GetTransitionHandler(from, to)
243 assert.Equal(t, 2, len(handlers))
244 assert.True(t, reflect.ValueOf(tdm.DeleteLogicalPorts).Pointer() == reflect.ValueOf(handlers[0]).Pointer())
245 assert.True(t, reflect.ValueOf(tdm.RunPostDeviceDelete).Pointer() == reflect.ValueOf(handlers[1]).Pointer())
khenaidoo59ef7be2019-06-21 12:40:28 -0400246
247 from = getDevice(false, voltha.AdminState_DISABLED, voltha.ConnectStatus_REACHABLE, voltha.OperStatus_UNKNOWN)
248 to = getDevice(false, voltha.AdminState_DELETED, voltha.ConnectStatus_UNREACHABLE, voltha.OperStatus_UNKNOWN)
249 handlers = transitionMap.GetTransitionHandler(from, to)
250 assert.Equal(t, 2, len(handlers))
251 assert.True(t, reflect.ValueOf(tdm.DeleteLogicalPorts).Pointer() == reflect.ValueOf(handlers[0]).Pointer())
252 assert.True(t, reflect.ValueOf(tdm.RunPostDeviceDelete).Pointer() == reflect.ValueOf(handlers[1]).Pointer())
253
254 from = getDevice(false, voltha.AdminState_DISABLED, voltha.ConnectStatus_UNKNOWN, voltha.OperStatus_ACTIVE)
255 to = getDevice(false, voltha.AdminState_DELETED, voltha.ConnectStatus_UNKNOWN, voltha.OperStatus_FAILED)
256 handlers = transitionMap.GetTransitionHandler(from, to)
257 assert.Equal(t, 2, len(handlers))
258 assert.True(t, reflect.ValueOf(tdm.DeleteLogicalPorts).Pointer() == reflect.ValueOf(handlers[0]).Pointer())
259 assert.True(t, reflect.ValueOf(tdm.RunPostDeviceDelete).Pointer() == reflect.ValueOf(handlers[1]).Pointer())
khenaidoo0a822f92019-05-08 15:15:57 -0400260}
261
262func TestInvalidTransitions(t *testing.T) {
khenaidoo59ef7be2019-06-21 12:40:28 -0400263 from := getDevice(true, voltha.AdminState_ENABLED, voltha.ConnectStatus_UNKNOWN, voltha.OperStatus_ACTIVE)
264 to := getDevice(true, voltha.AdminState_ENABLED, voltha.ConnectStatus_UNKNOWN, voltha.OperStatus_ACTIVATING)
khenaidoo0a822f92019-05-08 15:15:57 -0400265 assertInvalidTransition(t, from, to)
266
khenaidoo59ef7be2019-06-21 12:40:28 -0400267 from = getDevice(true, voltha.AdminState_ENABLED, voltha.ConnectStatus_UNKNOWN, voltha.OperStatus_ACTIVATING)
268 to = getDevice(true, voltha.AdminState_ENABLED, voltha.ConnectStatus_UNKNOWN, voltha.OperStatus_UNKNOWN)
khenaidoo0a822f92019-05-08 15:15:57 -0400269 assertInvalidTransition(t, from, to)
270
khenaidoo59ef7be2019-06-21 12:40:28 -0400271 from = getDevice(true, voltha.AdminState_ENABLED, voltha.ConnectStatus_UNKNOWN, voltha.OperStatus_UNKNOWN)
khenaidoo0a822f92019-05-08 15:15:57 -0400272 to = getDevice(true, voltha.AdminState_UNKNOWN, voltha.ConnectStatus_UNKNOWN, voltha.OperStatus_UNKNOWN)
273 assertInvalidTransition(t, from, to)
274
khenaidoo59ef7be2019-06-21 12:40:28 -0400275 from = getDevice(true, voltha.AdminState_ENABLED, voltha.ConnectStatus_UNKNOWN, voltha.OperStatus_UNKNOWN)
khenaidoo0a822f92019-05-08 15:15:57 -0400276 to = getDevice(true, voltha.AdminState_DOWNLOADING_IMAGE, voltha.ConnectStatus_UNKNOWN, voltha.OperStatus_UNKNOWN)
277 assertInvalidTransition(t, from, to)
278
279 from = getDevice(true, voltha.AdminState_ENABLED, voltha.ConnectStatus_UNKNOWN, voltha.OperStatus_UNKNOWN)
280 to = getDevice(true, voltha.AdminState_UNKNOWN, voltha.ConnectStatus_UNKNOWN, voltha.OperStatus_UNKNOWN)
281 assertInvalidTransition(t, from, to)
282
283 from = getDevice(true, voltha.AdminState_DISABLED, voltha.ConnectStatus_UNKNOWN, voltha.OperStatus_UNKNOWN)
284 to = getDevice(true, voltha.AdminState_PREPROVISIONED, voltha.ConnectStatus_UNKNOWN, voltha.OperStatus_UNKNOWN)
285 assertInvalidTransition(t, from, to)
286
287 from = getDevice(true, voltha.AdminState_DOWNLOADING_IMAGE, voltha.ConnectStatus_UNKNOWN, voltha.OperStatus_UNKNOWN)
288 to = getDevice(true, voltha.AdminState_DISABLED, voltha.ConnectStatus_UNKNOWN, voltha.OperStatus_UNKNOWN)
289 assertInvalidTransition(t, from, to)
290}
291
292func TestNoOpTransitions(t *testing.T) {
293 from := getDevice(true, voltha.AdminState_ENABLED, voltha.ConnectStatus_UNKNOWN, voltha.OperStatus_UNKNOWN)
294 to := getDevice(true, voltha.AdminState_ENABLED, voltha.ConnectStatus_UNKNOWN, voltha.OperStatus_UNKNOWN)
295 assertNoOpTransition(t, from, to)
296
297 from = getDevice(true, voltha.AdminState_PREPROVISIONED, voltha.ConnectStatus_UNKNOWN, voltha.OperStatus_UNKNOWN)
298 to = getDevice(true, voltha.AdminState_PREPROVISIONED, voltha.ConnectStatus_UNKNOWN, voltha.OperStatus_UNKNOWN)
299 assertNoOpTransition(t, from, to)
300
301 from = getDevice(true, voltha.AdminState_DISABLED, voltha.ConnectStatus_UNKNOWN, voltha.OperStatus_UNKNOWN)
302 to = getDevice(true, voltha.AdminState_DISABLED, voltha.ConnectStatus_UNKNOWN, voltha.OperStatus_UNKNOWN)
303 assertNoOpTransition(t, from, to)
304
305 from = getDevice(false, voltha.AdminState_ENABLED, voltha.ConnectStatus_UNKNOWN, voltha.OperStatus_UNKNOWN)
306 to = getDevice(false, voltha.AdminState_DISABLED, voltha.ConnectStatus_UNKNOWN, voltha.OperStatus_UNKNOWN)
307 assertNoOpTransition(t, from, to)
308
309 from = getDevice(false, voltha.AdminState_PREPROVISIONED, voltha.ConnectStatus_UNKNOWN, voltha.OperStatus_ACTIVATING)
310 to = getDevice(false, voltha.AdminState_PREPROVISIONED, voltha.ConnectStatus_REACHABLE, voltha.OperStatus_DISCOVERED)
311 assertNoOpTransition(t, from, to)
312
313 from = getDevice(false, voltha.AdminState_PREPROVISIONED, voltha.ConnectStatus_REACHABLE, voltha.OperStatus_DISCOVERED)
314 to = getDevice(false, voltha.AdminState_PREPROVISIONED, voltha.ConnectStatus_REACHABLE, voltha.OperStatus_ACTIVATING)
315 assertNoOpTransition(t, from, to)
316}