// Copyright 2017-present 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.

node ("${TestNodeName}") {
    timeout (100) {
        try {
            stage ("Parse deployment configuration file") {
                sh returnStdout: true, script: 'rm -rf ${configRepoBaseDir}'
                sh returnStdout: true, script: 'git clone -b ${branch} ${configRepoUrl}'
                deployment_config = readYaml file: "${configRepoBaseDir}${configRepoFile}"
            }
            stage('Clean up') {
                timeout(10) {
                    sh returnStdout: true, script: """
                    export KUBECONFIG=$WORKSPACE/pod-configs/kubernetes-configs/${deployment_config.kube_config}
                    for hchart in \$(helm list -q);
                    do
                        echo "Purging chart: \${hchart}"
                        helm delete --purge "\${hchart}"
                    done
                    rm -rf helm-charts cord-tester
                    git clone -b ${branch} https://gerrit.opencord.org/helm-charts
                    """
                    timeout(5) {
                        waitUntil {
                            helm_deleted = sh returnStdout: true, script: """
                            export KUBECONFIG=$WORKSPACE/pod-configs/kubernetes-configs/${deployment_config.kube_config} &&
                            helm ls | wc -l
                            """
                            return helm_deleted.toInteger() == 0
                        }
                    }
                    timeout(5) {
                        waitUntil {
                            kubectl_deleted = sh returnStdout: true, script: """
                            export KUBECONFIG=$WORKSPACE/pod-configs/kubernetes-configs/${deployment_config.kube_config} &&
                            kubectl get pods --all-namespaces --no-headers | grep -v kube-system | wc -l
                            """
                            return kubectl_deleted.toInteger() == 0
                        }
                    }
                }
            }
            dir ("helm-charts") {
                stage('Install Voltha Kafka') {
                    timeout(10) {
                        sh returnStdout: true, script: """
                        export KUBECONFIG=$WORKSPACE/pod-configs/kubernetes-configs/${deployment_config.kube_config}
                        helm install --name voltha-kafka --set replicas=1 --set persistence.enabled=false --set zookeeper.replicaCount=1 --set zookeeper.persistence.enabled=false incubator/kafka
                        """
                    }
                    timeout(10) {
                        waitUntil {
                            kafka_instances_running = sh returnStdout: true, script: """
                            export KUBECONFIG=$WORKSPACE/pod-configs/kubernetes-configs/${deployment_config.kube_config} &&
                            kubectl get pods | grep voltha-kafka | grep -i running | grep 1/1 | wc -l
                            """
                            return kafka_instances_running.toInteger() == 2
                        }
                    }
                }
                stage('Install voltha') {
                    timeout(10) {
                        sh returnStdout: true, script: """
                        export KUBECONFIG=$WORKSPACE/pod-configs/kubernetes-configs/${deployment_config.kube_config}
                        helm repo add incubator https://kubernetes-charts-incubator.storage.googleapis.com/
                        helm dep build voltha
                        helm install -n voltha --set etcd-operator.customResources.createEtcdClusterCRD=false voltha
                        helm upgrade --set etcd-operator.customResources.createEtcdClusterCRD=true voltha ./voltha
                        """
                    }
                    timeout(10) {
                        waitUntil {
                            voltha_completed = sh returnStdout: true, script: """
                            export KUBECONFIG=$WORKSPACE/pod-configs/kubernetes-configs/${deployment_config.kube_config} &&
                            kubectl get pods -n voltha | grep -i running | grep 1/1 | wc -l
                            """
                            return voltha_completed.toInteger() == 11
                        }
                    }
                }
                stage('Install CORD Kafka') {
                    timeout(10) {
                        sh returnStdout: true, script: """
                        export KUBECONFIG=$WORKSPACE/pod-configs/kubernetes-configs/${deployment_config.kube_config}
                        helm install --name cord-kafka --set replicas=1 --set persistence.enabled=false --set zookeeper.replicaCount=1 --set zookeeper.persistence.enabled=false incubator/kafka
                        """
                    }
                    timeout(10) {
                        waitUntil {
                            kafka_instances_running = sh returnStdout: true, script: """
                            export KUBECONFIG=$WORKSPACE/pod-configs/kubernetes-configs/${deployment_config.kube_config} &&
                            kubectl get pods | grep cord-kafka | grep -i running | grep 1/1 | wc -l
                            """
                            return kafka_instances_running.toInteger() == 2
                        }
                    }
                }
                stage('Install ONOS-Voltha') {
                    timeout(10) {
                        sh returnStdout: true, script: """
                        export KUBECONFIG=$WORKSPACE/pod-configs/kubernetes-configs/${deployment_config.kube_config}
                        helm install -n onos-voltha -f configs/onos-voltha.yaml onos
                        """
                    }
                    timeout(10) {
                        waitUntil {
                            onos_voltha_completed = sh returnStdout: true, script: """
                            export KUBECONFIG=$WORKSPACE/pod-configs/kubernetes-configs/${deployment_config.kube_config} &&
                            kubectl get pods -n voltha | grep -i onos-voltha | grep -i running | grep 1/1 | wc -l
                            """
                            return onos_voltha_completed.toInteger() == 1
                        }
                    }
                }
                stage('Install ONOS-Fabric') {
                    timeout(10) {
                        sh returnStdout: true, script: """
                        export KUBECONFIG=$WORKSPACE/pod-configs/kubernetes-configs/${deployment_config.kube_config}
                        helm install -n onos-fabric -f configs/onos-fabric.yaml onos
                        """
                    }
                    timeout(10) {
                        waitUntil {
                            onos_fabric_completed = sh returnStdout: true, script: """
                            export KUBECONFIG=$WORKSPACE/pod-configs/kubernetes-configs/${deployment_config.kube_config} &&
                            kubectl get pods | grep -i onos-fabric | grep -i running | grep 1/1 | wc -l
                            """
                            return onos_fabric_completed.toInteger() == 1
                        }
                    }
                }
                stage('Install xos-core') {
                    timeout(10) {
                        sh returnStdout: true, script: """
                        export KUBECONFIG=$WORKSPACE/pod-configs/kubernetes-configs/${deployment_config.kube_config}
                        helm dep update xos-core
                        helm install -n xos-core xos-core
                        """
                    }
                    timeout(10) {
                        waitUntil {
                            xos_core_completed = sh returnStdout: true, script: """
                            export KUBECONFIG=$WORKSPACE/pod-configs/kubernetes-configs/${deployment_config.kube_config} &&
                            kubectl get pods | grep -i xos | grep -i running | grep 1/1 | wc -l
                            """
                            return xos_core_completed.toInteger() == 7
                        }
                    }
                }
                stage('Install rcord-lite') {
                    timeout(10) {
                        sh returnStdout: true, script: """
                        export KUBECONFIG=$WORKSPACE/pod-configs/kubernetes-configs/${deployment_config.kube_config}
                        helm dep update xos-profiles/rcord-lite
                        helm install -n rcord-lite xos-profiles/rcord-lite
                        """
                    }
                    timeout(10) {
                        waitUntil {
                            rcord_tosca_completed = sh returnStdout: true, script: """
                            export KUBECONFIG=$WORKSPACE/pod-configs/kubernetes-configs/${deployment_config.kube_config} &&
                            kubectl get pods | grep -i tosca-loader | grep -i completed | wc -l
                            """
                            return rcord_tosca_completed.toInteger() == 1
                        }
                    }
                }
                stage('Install hippie-oss') {
                    timeout(10) {
                        sh returnStdout: true, script: """
                        export KUBECONFIG=$WORKSPACE/pod-configs/kubernetes-configs/${deployment_config.kube_config}
                        helm install -n hippie-oss xos-services/hippie-oss
                        """
                    }
                    timeout(10) {
                        waitUntil {
                            hippie_oss_running = sh returnStdout: true, script: """
                            export KUBECONFIG=$WORKSPACE/pod-configs/kubernetes-configs/${deployment_config.kube_config} &&
                            kubectl get pods | grep -i hippie-oss | grep -i running | grep 1/1 | wc -l
                            """
                            return hippie_oss_running.toInteger() == 1
                        }
                    }
                }
            }
            stage('Reinstall OLT software') {
                for(int i=0; i < deployment_config.olts.size(); i++) {
                    sh returnStdout: true, script: """
                    sshpass -p ${deployment_config.olts[i].pass} ssh -l ${deployment_config.olts[i].user} ${deployment_config.olts[i].ip} 'dpkg --remove asfvolt16 && dpkg --purge asfvolt16'
                    """
                    timeout(5) {
                        waitUntil {
                            olt_sw_present = sh returnStdout: true, script: """
                            sshpass -p ${deployment_config.olts[i].pass} ssh -l ${deployment_config.olts[i].user} ${deployment_config.olts[i].ip} 'dpkg --list | grep asfvolt16 | wc -l'
                            """
                            return olt_sw_present.toInteger() == 0
                        }
                    }
                    sh returnStdout: true, script: """
                    sshpass -p ${deployment_config.olts[i].pass} ssh -l ${deployment_config.olts[i].user} ${deployment_config.olts[i].ip} "dpkg --install ${oltDebVersion}"
                    """
                    timeout(5) {
                        waitUntil {
                            olt_sw_present = sh returnStdout: true, script: """
                            sshpass -p ${deployment_config.olts[i].pass} ssh -l ${deployment_config.olts[i].user} ${deployment_config.olts[i].ip} 'dpkg --list | grep asfvolt16 | wc -l'
                            """
                            return olt_sw_present.toInteger() == 1
                        }
                    }
                    // If the OLT is connected to a 40G switch interface, set the NNI port to be downgraded
                    if ("${deployment_config.olts[i].fortygig}" != null && "${deployment_config.olts[i].fortygig}" == 'true') {
                        sh returnStdout: true, script: """
                        sshpass -p ${deployment_config.olts[i].pass} ssh -l ${deployment_config.olts[i].user} ${deployment_config.olts[i].ip} 'echo "port ce128 sp=40000" >> /broadcom/qax.soc'
                        sshpass -p ${deployment_config.olts[i].pass} ssh -l ${deployment_config.olts[i].user} ${deployment_config.olts[i].ip} '/opt/bcm68620/svk_init.sh'
                        """
                    }
                }
            }
            stage('Restart OLT processes') {
                for(int i=0; i < deployment_config.olts.size(); i++) {
                    timeout(5) {
                        sh returnStdout: true, script: """
                        ssh-keyscan -H ${deployment_config.olts[i].ip} >> ~/.ssh/known_hosts
                        sshpass -p ${deployment_config.olts[i].pass} ssh -l ${deployment_config.olts[i].user} ${deployment_config.olts[i].ip} 'pkill bal_core_dist' || true
                        sshpass -p ${deployment_config.olts[i].pass} ssh -l ${deployment_config.olts[i].user} ${deployment_config.olts[i].ip} 'pkill openolt' || true
                        sshpass -p ${deployment_config.olts[i].pass} ssh -l ${deployment_config.olts[i].user} ${deployment_config.olts[i].ip} '> /broadcom/bal.log'
                        sshpass -p ${deployment_config.olts[i].pass} ssh -l ${deployment_config.olts[i].user} ${deployment_config.olts[i].ip} '> /broadcom/openolt.log'
                        sshpass -p ${deployment_config.olts[i].pass} ssh -l ${deployment_config.olts[i].user} ${deployment_config.olts[i].ip} 'cd /broadcom; ./bal_core_dist -C :55001 < /dev/tty1 > ./bal.log 2>&1 &'
                        sleep 5
                        sshpass -p ${deployment_config.olts[i].pass} ssh -l ${deployment_config.olts[i].user} ${deployment_config.olts[i].ip} 'cd /broadcom; ./openolt -C 127.0.0.1:55001 < /dev/tty1 > ./openolt.log 2>&1 &'
                        """
                    }
                    timeout(15) {
                        waitUntil {
                            onu_discovered = sh returnStdout: true, script: "sshpass -p ${deployment_config.olts[i].pass} ssh -l ${deployment_config.olts[i].user} ${deployment_config.olts[i].ip} 'cat /broadcom/openolt.log | grep \"oper_state:up\" | wc -l'"
                            return onu_discovered.toInteger() > 0
                        }
                    }
                }
            }
            stage('Download cord-tester repo') {
                timeout(2) {
                    sh returnStdout: true, script: """
                    git clone -b ${branch} https://gerrit.opencord.org/cord-tester
                    """
                }
            }
            stage('Validate installed PODs') {
                timeout(10) {
                    sh """
                    export KUBECONFIG=$WORKSPACE/pod-configs/kubernetes-configs/${deployment_config.kube_config}
                    cd $WORKSPACE/cord-tester/src/test/robot/
                    rm -rf Log/ || true
                    pybot -d Log -T SanityK8POD.robot || true
                    """
                }
            }
            stage('Configurations and Tests') {
                timeout(10) {
                    sh """
                    export KUBECONFIG=$WORKSPACE/pod-configs/kubernetes-configs/${deployment_config.kube_config}
                    cd $WORKSPACE/cord-tester/src/test/cord-api/Properties/
                    sed -i \"s/^\\(SERVER_IP = \\).*/\\1\'${deployment_config.nodes[0].ip}\'/\" RestApiProperties.py
                    sed -i \"s/^\\(SERVER_PORT = \\).*/\\1\'30006\'/\" RestApiProperties.py
                    sed -i \"s/^\\(XOS_USER = \\).*/\\1\'admin@opencord.org\'/\" RestApiProperties.py
                    sed -i \"s/^\\(XOS_PASSWD = \\).*/\\1\'letmein\'/\" RestApiProperties.py
                    cd $WORKSPACE/cord-tester/src/test/cord-api/Tests/
                    rm -rf Log/ || true
                    pybot -d Log -T FabricConfig.txt || true
                    pybot -d Log -T HippieOSS.txt || true
                    sleep 5
                    pybot -d Log -T OSSVolt.txt || true
                    pybot -d Log -T RealOLT_Test.txt || true
                    """
                }
            }
            stage('Subscriber Validation and Ping Tests') {
                timeout(30) {
                    sh """
                    export KUBECONFIG=$WORKSPACE/pod-configs/kubernetes-configs/${deployment_config.kube_config}
                    cd $WORKSPACE/cord-tester/src/test/cord-api/Tests/
                    pybot -d Log -T HippieOSS_instances.txt || true
                    pybot -d Log -T -v src_ip:${deployment_config.srcHost.ip} -v src_user:${deployment_config.srcHost.user} -v src_pass:${deployment_config.srcHost.pass} -v dst_user:${deployment_config.dstHost.user} -v dst_pass:${deployment_config.dstHost.pass} -v dst_ip:${deployment_config.dstHost.ip} -v dst_host_ip:${deployment_config.dstHost.hostIp} -v src_gateway:${deployment_config.srcHost.gateway} -v dst_gateway:${deployment_config.dstHost.gateway} -v init_state:awaiting-auth -v INITIAL_STATUS:FAIL -v ENABLE_STATUS:FAIL -v MACIP_STATUS:PASS Subscriber_StatusChecks.txt || true
                    """
                }
            }
            stage('Publish test results') {
                sh returnStdout: true, script: """
                if [ -d RobotLogs ]; then rm -r RobotLogs; fi; mkdir RobotLogs;
                mkdir RobotLogs/TestDoc || true
                cp -r $WORKSPACE/cord-tester/src/test/robot/Log/* $WORKSPACE//RobotLogs || true
                cp -r $WORKSPACE/cord-tester/src/test/cord-api/Tests/Log/* $WORKSPACE/RobotLogs || true
                """
                step([$class: 'RobotPublisher',
                    disableArchiveOutput: false,
                    logFileName: 'RobotLogs/log*.html',
                    otherFiles: '',
                    outputFileName: 'RobotLogs/output*.xml',
                    outputPath: '.',
                    passThreshold: 100,
                    reportFileName: 'RobotLogs/report*.html',
                    unstableThreshold: 0
                ])
            }
            currentBuild.result = 'SUCCESS'
        } catch (err) {
            currentBuild.result = 'FAILURE'
            step([$class: 'Mailer', notifyEveryUnstableBuild: true, recipients: "${notificationEmail}", sendToIndividuals: false])
        }
        echo "RESULT: ${currentBuild.result}"
    }
}
