// 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.

pod_config = null
deployment_config = null

node ('master') {
    stage ("Parse configuration file") {
        sh returnStdout: true, script: 'rm -rf ${configRepoBaseDir}'
        sh returnStdout: true, script: 'git clone -b ${branch} ${configRepoUrl}'
        deployment_config = readYaml file: "${configRepoBaseDir}${configRepoFile}"
        pod_config = readYaml file: "${configRepoBaseDir}${deployment_config.pod_config.file_name}"
    }
}

node ("${deployment_config.dev_node.name}") {
    stage('Prerequisites') {
        runHeadNodeCmd("""
        cd /opt/cord/test/cord-tester/src/test/setup
        sudo ./prerequisites.sh --cord
        """)
    }
    stage('Bring up Cord-Test Container') {
        runHeadNodeCmd("""
        cd /opt/cord/test/cord-tester/src/test/setup
        sudo ./cord-test.py setup -m manifest-onf-cord.json
        """)
    }
    stage('Configure Fabric for E2E testing') {
        //FIXME: this only works for PODs with 2 leaf switches
        fabricIpPrefix = pod_config.fabric_ip.split(/\.\d+\.\d+\/24/)[0]
        runHeadNodeCmd("sudo ip route add ${fabricIpPrefix}.2.0/24 via ${fabricIpPrefix}.1.254 || echo route already exists")
        runHeadNodeCmd("sudo route add -net 10.7.1.0/24 gw 10.6.1.254 || echo route already exists")
        runHeadNodeCmd("sudo route add -net 10.8.1.0/24 gw 10.6.1.254 || echo route already exists")
        runHeadNodeCmd("ping -c 1 ${fabricIpPrefix}.1.254", "-qftn")
        runOnosCliCmd("onos-fabric", "8101", "onos", "rocks", "route-add 0.0.0.0/0 ${fabricIpPrefix}.1.1")
        // Verify ONOS has recognized the hosts
        timeout(time: 5) {
            waitUntil {
                try {
                    num = runHeadNodeCmd("\"sshpass -p rocks ssh -q -oStrictHostKeyChecking=no -l onos -p 8101 onos-fabric hosts | grep id= | wc -l\"").trim()
                    return num.toInteger() == deployment_config.compute_nodes.size() + 1
                } catch (exception) {
                    return false
                }
            }
        }
        // Generate network configuration
        runHeadNodeCmd("""
                       cd /opt/cord_profile/
                       cp fabric-network-cfg.json fabric-network-cfg.json.\$(date +%Y%m%d-%H%M%S)
                       cord generate > fabric-network-cfg.json
                       """)
        // Delete old ONOS netcfg
        runHeadNodeCmd("http -a onos:rocks DELETE http://onos-fabric:8181/onos/v1/network/configuration/")
        // Load new configuration
        runHeadNodeCmd("http -a onos:rocks POST http://onos-fabric:8181/onos/v1/network/configuration/ < /opt/cord_profile/fabric-network-cfg.json")
        // Restart ONOS apps
        runHeadNodeCmd("""
                       http -a onos:rocks DELETE http://onos-fabric:8181/onos/v1/applications/org.onosproject.segmentrouting/active; sleep 5
                       http -a onos:rocks POST http://onos-fabric:8181/onos/v1/applications/org.onosproject.segmentrouting/active; sleep 5
                       """)
    }
    stage('Verify Collect Diag') {
        timeout(10) {
            try {
                runHeadNodeCmd("""
                rm -rf ~/diag-*
                cd /opt/cord/build; make collect-diag
                cd /opt/cord/test/cord-tester/src/test/diag/
                rm -r Log/ || true
                rm -r TestDoc/ || true
                mkdir TestDoc || true
                pybot -v CORD_PROFILE:${pod_config.cord_profile} -d Log -T verifyCollectDiag.robot
                python -m robot.testdoc verifyCollectDiag.robot TestDoc/verifyCollectDiag.html
                """)
            } catch(error) { currentBuild.result = 'FAILURE' }
        }
    }
    stage('Sanity Test') {
        timeout(10) {
            try {
                runHeadNodeCmd("""
                cd /opt/cord/test/cord-tester/src/test/robot/
                rm -r Log/ || true
                rm -r TestDoc/ || true
                mkdir TestDoc
                """)
                if (deployment_config.fabric_switches != null) {
                    runHeadNodeCmd("""
                    cd /opt/cord/test/cord-tester/src/test/robot/
                    pybot --exclude notready -v FABRIC:on -v PUBLIC_IFACE:${pod_config.external_iface} -v CORD_PROFILE:${pod_config.cord_profile} -d Log -T SanityPhyPOD.robot
                    python -m robot.testdoc SanityPhyPOD.robot TestDoc/SanityPhyPOD.html
                    """)
                }
                else {
                    // Exclude fabric related tests
                    runHeadNodeCmd("""
                    cd /opt/cord/test/cord-tester/src/test/robot/
                    pybot --exclude notready --exclude fabric -v FABRIC:off -v PUBLIC_IFACE:${pod_config.external_iface} -v CORD_PROFILE:${pod_config.cord_profile} -d Log -T SanityPhyPOD.robot
                    python -m robot.testdoc SanityPhyPOD.robot TestDoc/SanityPhyPOD.html
                    """)
                }
            } catch(error) { currentBuild.result = 'FAILURE' }
        }
    }
    stage('XOS API Tests') {
        timeout(10) {
            try {
                runHeadNodeCmd("""
                cd /opt/cord/test/cord-tester/src/test/cord-api/Properties/
                sed -i s/^SERVER_IP\\ =\\ .*/SERVER_IP\\ =\\ \\'localhost\\'/ RestApiProperties.py
                sed -i s/^SERVER_PORT\\ =\\ .*/SERVER_PORT\\ =\\ \\'9101\\'/ RestApiProperties.py
                sed -i s/^PASSWD\\ =\\ .*/PASSWD\\ =\\ \\'\\\$(cat /opt/credentials/xosadmin@opencord.org)\\'/ RestApiProperties.py
                all_passed=true
                cd /opt/cord/test/cord-tester/src/test/cord-api/
                rm -r Log/ || true
                rm -r TestDoc/ || true
                mkdir TestDoc || true
                pybot -d Log -T Tests/Ch_defaultImagesCheck.txt || all_passed=false
                pybot -d Log -T -v PROFILE:${pod_config.cord_profile} Tests/Ch_DefaultServiceCheck.txt || all_passed=false
                pybot -d Log -T Tests/Ch_SubscriberTest.txt || all_passed=false
                pybot -d Log -T Tests/Ch_VoltTenant.txt || all_passed=false
                pybot -d Log -T Tests/Ch_ServiceTest.txt || all_passed=false
                pybot -d Log -T Tests/Ch_UsersTest.txt || all_passed=false
                pybot -d Log -T Tests/Ch_DeploymentTest.txt || all_passed=false
                pybot -d Log -T Tests/Ch_NodeTest.txt || all_passed=false
                pybot -d Log -T Tests/Ch_SliceTest.txt || all_passed=false
                pybot -d Log -T Tests/Ch_SanityInstance.txt || all_passed=false
                pybot -d Log -T Tests/Ch_SanityFlavors.txt || all_passed=false
                pybot -d Log -T Tests/Ch_SiteTest.txt || all_passed=false
                python -m robot.testdoc Tests/Ch_*.txt TestDoc/XOSApiTests.html
                if [ "\\\$all_passed" = true ]; then exit 0; else exit 1; fi
                """)
            } catch(error) { currentBuild.result = 'FAILURE' }
        }
    }
    stage('Dataplane Test') {
        timeout(10) {
            try {
                runHeadNodeCmd("""
                cd /opt/cord/test/cord-tester/src/test/vsg/
                rm -r Log/ || true
                rm -r TestDoc/ || true
                mkdir TestDoc || true
                ssh-agent bash
                ssh-add
                pybot -L TRACE -d Log -T vsg_dataplane_test.robot
                python -m robot.testdoc vsg_dataplane_test.robot TestDoc/vsg_dataplane_test.html
                """)
            } catch(error) { currentBuild.result = 'FAILURE' }
        }
    }
    stage('Publish') {
        try {
            sh """
            if [ -d RobotLogs ]; then rm -r RobotLogs; fi; mkdir RobotLogs
            scp -r ${deployment_config.head.user}@${deployment_config.head.ip}:/opt/cord/test/cord-tester/src/test/cord-api/Log/* ./RobotLogs || true
            scp -r ${deployment_config.head.user}@${deployment_config.head.ip}:/opt/cord/test/cord-tester/src/test/robot/Log/* ./RobotLogs || true
            scp -r ${deployment_config.head.user}@${deployment_config.head.ip}:/opt/cord/test/cord-tester/src/test/diag/Log/* ./RobotLogs || true
            scp -r ${deployment_config.head.user}@${deployment_config.head.ip}:/opt/cord/test/cord-tester/src/test/vsg/Log/* ./RobotLogs || true
            scp -r ${deployment_config.head.user}@${deployment_config.head.ip}:/opt/cord/test/cord-tester/src/test/cord-api/TestDoc/* ./RobotLogs/TestDocs || true
            scp -r ${deployment_config.head.user}@${deployment_config.head.ip}:/opt/cord/test/cord-tester/src/test/robot/TestDoc/* ./RobotLogs/TestDocs || true
            scp -r ${deployment_config.head.user}@${deployment_config.head.ip}:/opt/cord/test/cord-tester/src/test/diag/TestDoc/* ./RobotLogs/TestDocs || true
            scp -r ${deployment_config.head.user}@${deployment_config.head.ip}:/opt/cord/test/cord-tester/src/test/vsg/TestDoc/* ./RobotLogs/TestDocs || true
            """
            step([$class: 'RobotPublisher',
                disableArchiveOutput: false,
                logFileName: 'RobotLogs/log*.html',
                otherFiles: 'RobotLogs/TestDocs/*.html',
                outputFileName: 'RobotLogs/output*.xml',
                outputPath: '.',
                passThreshold: 100,
                reportFileName: 'RobotLogs/report*.html',
                unstableThreshold: 0])
        } catch(error) {}
    }
    step([$class: 'Mailer', notifyEveryUnstableBuild: true, recipients: "${notificationEmail}", sendToIndividuals: false])
}

/**
 * Runs a command on the head node.
 *
 * @param command the command to run
 * @param sshArgs arguments for the ssh command
 * @return the output of the command
 */
def runHeadNodeCmd(command, sshArgs="") {
    return sh(returnStdout: true, script: "sshpass -p ${deployment_config.head.pass} ssh ${sshArgs} -oStrictHostKeyChecking=no -l ${deployment_config.head.user} ${deployment_config.head.ip} \"${command}\"")
}

/**
 * Runs an ONOS CLI command
 *
 * @param name    the onos node name, reachable from the head node
 * @param port    the port used to login to ONOS CLI
 * @param user    the user name to login to ONOS CLI
 * @param pass    the password to login to ONOS CLI
 * @param command the command to run in ONOS CLI
 * @return the output of the command
 */
def runOnosCliCmd(name, port, user, pass, command) {
    return sh(returnStdout: true, script: "sshpass -p ${deployment_config.head.pass} ssh -oStrictHostKeyChecking=no -l ${deployment_config.head.user} ${deployment_config.head.ip} \"sshpass -p ${pass} ssh -oStrictHostKeyChecking=no -l ${user} -p ${port} ${name} ${command}\"")
}
