Voltha test framework and tests to enable olt device
Change-Id: Iecdd6465c107b8d8726826a85cbb71139ff509f4
diff --git a/src/test/voltha/__init__.py b/src/test/voltha/__init__.py
new file mode 100644
index 0000000..db4ad9c
--- /dev/null
+++ b/src/test/voltha/__init__.py
@@ -0,0 +1,26 @@
+#
+# 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.
+# See the License for the specific language governing permissions and
+# limitations under the License.
+#
+import os,sys
+##add the python path to lookup the utils
+working_dir = os.path.dirname(os.path.realpath(sys.argv[-1]))
+utils_dir = os.path.join(working_dir, '../utils')
+fsm_dir = os.path.join(working_dir, '../fsm')
+subscriber_dir = os.path.join(working_dir, '../subscriber')
+__path__.append(utils_dir)
+__path__.append(fsm_dir)
+__path__.append(subscriber_dir)
+cli_dir = os.path.join(working_dir, '../cli')
+__path__.append(cli_dir)
diff --git a/src/test/voltha/volthaTest.json b/src/test/voltha/volthaTest.json
new file mode 100644
index 0000000..8ad1319
--- /dev/null
+++ b/src/test/voltha/volthaTest.json
@@ -0,0 +1,6 @@
+{
+ "OLT_TYPE" : "tibit_olt",
+ "OLT_MAC" : "00:0c:e2:31:12:00",
+ "VOLTHA_HOST" : "172.17.0.1",
+ "VOLTHA_REST_PORT" : 8881
+}
diff --git a/src/test/voltha/volthaTest.py b/src/test/voltha/volthaTest.py
new file mode 100644
index 0000000..d7a6892
--- /dev/null
+++ b/src/test/voltha/volthaTest.py
@@ -0,0 +1,24 @@
+import os
+import sys
+import unittest
+from nose.tools import *
+from CordTestConfig import setup_module
+from CordTestUtils import log_test
+from VolthaCtrl import VolthaCtrl
+
+class voltha_exchange(unittest.TestCase):
+
+ OLT_TYPE = 'tibit_olt'
+ OLT_MAC = '00:0c:e2:31:12:00'
+ VOLTHA_HOST = 'localhost'
+ VOLTHA_REST_PORT = 8881
+ voltha = None
+
+ @classmethod
+ def setUpClass(cls):
+ cls.voltha = VolthaCtrl(cls.VOLTHA_HOST, rest_port = cls.VOLTHA_REST_PORT)
+
+ def test_olt_enable(self):
+ log_test.info('Enabling OLT type %s, MAC %s' %(self.OLT_TYPE, self.OLT_MAC))
+ status = self.voltha.enable_device(self.OLT_TYPE, self.OLT_MAC)
+ assert_equal(status, True)