[VOL-3603][SEBA-1000]: Support OLT image upgrade
- patchset on ONL source code (applied when ONL built in inband mode)
- scripts to support image upgrade procedure
- README to test the procedure.
- increased BAL READY TIME before enabling inband channel on BAL.
Change-Id: I069fc1309dd13d504af03552c1709a6b3ba42232
diff --git a/olt-sw-upgrade/test/ansible/inventory/hosts b/olt-sw-upgrade/test/ansible/inventory/hosts
new file mode 100644
index 0000000..ffe62eb
--- /dev/null
+++ b/olt-sw-upgrade/test/ansible/inventory/hosts
@@ -0,0 +1,2 @@
+[device-olt]
+192.168.50.150 ansible_ssh_user=root ansible_ssh_pass=onl ansible_sudo_pass=onl ansible_ssh_common_args='-o StrictHostKeyChecking=no -o UserKnownHostsFile=/dev/null'
diff --git a/olt-sw-upgrade/test/ansible/roles/upgrade/tasks/main.yml b/olt-sw-upgrade/test/ansible/roles/upgrade/tasks/main.yml
new file mode 100644
index 0000000..42bb2ae
--- /dev/null
+++ b/olt-sw-upgrade/test/ansible/roles/upgrade/tasks/main.yml
@@ -0,0 +1,38 @@
+# Copyright (c) 2020 Open Networking Foundation
+#
+# 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.
+
+### BEGIN INIT INFO
+# Description:
+# This script executes the main list of tasks,
+# 1. Copies install_onl.sh, an utility file for upgrade procedure to /tmp directory.
+# 2. Copied ONL image to /tmp directory.
+# 3. Upgrade OLT tasks is executed which executes install_onl.sh file on OLT by taking ONL
+# image as an argument.
+### END INIT INFO
+
+
+---
+# Copy install_onl.sh script amd ONL image files to /root and provide executable permission
+ - name: copying install_onl.sh file to /tmp
+ copy: src='/etc/ansible/roles/upgrade/files/install_onl.sh' dest='/tmp' mode=0777
+
+ - name: copying ONL image to /tmp
+ copy: src='/etc/ansible/roles/upgrade/files/ONL_INSTALLED_INSTALLER' dest='/tmp' mode=0777
+
+# Updgrade OLT
+ - name: Upgrade OLT ...
+ command: sh /tmp/install_onl.sh /tmp/ONL_INSTALLED_INSTALLER
+ register: verify_upgrade
+ failed_when: verify_upgrade.rc != 0
+
diff --git a/olt-sw-upgrade/test/ansible/upgrade_olt.yml b/olt-sw-upgrade/test/ansible/upgrade_olt.yml
new file mode 100644
index 0000000..80f5dca
--- /dev/null
+++ b/olt-sw-upgrade/test/ansible/upgrade_olt.yml
@@ -0,0 +1,23 @@
+# Copyright (c) 2020 Open Networking Foundation
+#
+# 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.
+
+### BEGIN INIT INFO
+# Description:
+# This is a ansible-playbook defines the role for a given hosts.
+### END INIT INFO
+---
+ - hosts: device-olt
+ roles:
+ - upgrade
+