Fix: Allow test state machine users to override next state.
And fail the tls state machine gracefully while supporting negative test cases.
Change-Id: I4f5dcd6dfd81ec9e3e36d2929b3b10ae40acb851
diff --git a/src/test/utils/CordTestBase.py b/src/test/utils/CordTestBase.py
index 038751f..1402ffc 100644
--- a/src/test/utils/CordTestBase.py
+++ b/src/test/utils/CordTestBase.py
@@ -1,12 +1,12 @@
-#
+#
# Copyright 2016-present Ciena Corporation
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
-#
+#
# http://www.apache.org/licenses/LICENSE-2.0
-#
+#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
@@ -35,5 +35,5 @@
if actions:
for a in actions:
a()
- self.currentState = nextState
+ self.currentState = nextState if self.nextState is None else self.nextState
self.currentEvent = self.nextEvent