#!/bin/bash

function cleanup_from_previous_test() {
    VMS=$( sudo virsh list|grep running|awk '{print $2}' )
    for VM in $VMS
    do
	sudo uvt-kvm destroy $VM
    done

    rm -rf ~/.juju
    rm -f ~/.ssh/known_hosts
    rm -rf ~/openstack-cluster-setup

    sudo rm -f /var/lib/libvirt/dnsmasq/default.leases
    sudo killall -HUP dnsmasq
}

function bootstrap() {
    cd ~
    sudo apt-get update
    sudo apt-get -y install git
    git clone https://github.com/open-cloud/openstack-cluster-setup.git
    cd ~/openstack-cluster-setup
    ./bootstrap.sh

    # Log into the local node once to get host key
    ssh -o StrictHostKeyChecking=no localhost "ls > /dev/null"
}

function setup_openstack() {
    # Run the playbook
    ansible-playbook -i cord-test-hosts cord-setup.yml
}

function pull_docker_images() {
    # Pull down the Docker images
    echo ""
    echo "Pull down the Docker images for ONOS and XOS"
    echo "This can take 20 minutes or more, be patient!"
    ssh ubuntu@onos-cord "cd cord; sudo docker-compose up -d"
    ssh ubuntu@xos "cd xos/xos/configurations/cord-pod; sudo docker-compose pull"
}

function wait_for_openstack() {
    # Need to wait for OpenStack services to come up before running any XOS "make" commands
    echo "Waiting for the OpenStack services to fully come up."
    echo "This can take 30 minutes or more, be patient!"
    i=0
    until juju status --format=summary|grep "started:  23" > /dev/null
    do
	sleep 60
	(( i += 1 ))
	echo "Waited $i minutes"
    done

    echo "All OpenStack services are up."
}

function simulate_fabric() {
    echo ""
    echo "Setting up simulated fabric on nova-compute node"
    ssh ubuntu@nova-compute "wget https://raw.githubusercontent.com/open-cloud/openstack-cluster-setup/master/scripts/compute-ext-net.sh; sudo bash compute-ext-net.sh"
}

function setup_xos() {
    echo ""
    echo "Setting up XOS, will take a few minutes"
    ssh ubuntu@xos "cd xos/xos/configurations/cord-pod; make"
    echo ""
    echo "Pause 2 minutes"
    sleep 120

    ssh ubuntu@xos "cd xos/xos/configurations/cord-pod; make vtn"
    echo ""
    echo "Pause 30 seconds"
    sleep 30

    ssh ubuntu@xos "cd xos/xos/configurations/cord-pod; make cord"
}

function setup_test_client() {
    ssh ubuntu@nova-compute "sudo apt-get -y install lxc"

    # Change default bridge
    ssh ubuntu@nova-compute "sudo sed -i 's/lxcbr0/databr/' /etc/lxc/default.conf"

    # Create test client
    ssh ubuntu@nova-compute "sudo lxc-create -t ubuntu -n testclient"
    ssh ubuntu@nova-compute "sudo lxc-start -n testclient"

    # Configure network interface inside of test client with s-tag and c-tag
    ssh ubuntu@nova-compute "sudo lxc-attach -n testclient -- ip link add link eth0 name eth0.222 type vlan id 222"
    ssh ubuntu@nova-compute "sudo lxc-attach -n testclient -- ip link add link eth0.222 name eth0.222.111 type vlan id 111"
    ssh ubuntu@nova-compute "sudo lxc-attach -n testclient -- ifconfig eth0.222 up"
    ssh ubuntu@nova-compute "sudo lxc-attach -n testclient -- ifconfig eth0.222.111 up"
}

function run_e2e_test() {
    source ~/admin-openrc.sh

    echo "*** Wait for vSG VM to come up"
    i=0
    until nova list --all-tenants|grep ACTIVE > /dev/null
    do
	sleep 60
	(( i += 1 ))
	echo "Waited $i minutes"
    done

    # get mgmt IP address
    ID=$( nova list --all-tenants|grep mysite_vsg|awk '{print $2}' )
    MGMTIP=$( nova interface-list $ID|grep 172.27|awk '{print $8}' )

    echo ""
    echo "*** ssh into vsg VM, wait for Docker container to come up"
    i=0
    until ssh -o ProxyCommand="ssh -W %h:%p ubuntu@nova-compute" ubuntu@$MGMTIP "sudo docker ps|grep vcpe" > /dev/null
    do
	sleep 60
	(( i += 1 ))
	echo "Waited $i minutes"
    done

    echo ""
    echo "*** Run dhclient in test client"
    ssh ubuntu@nova-compute "sudo lxc-attach -n testclient -- dhclient eth0.222.111" > /dev/null

    echo ""
    echo "*** Routes in test client"
    ssh ubuntu@nova-compute "sudo lxc-attach -n testclient -- route -n"


    echo ""
    echo "*** Test external connectivity in test client"
    ssh ubuntu@nova-compute "sudo lxc-attach -n testclient -- ping -c 3 8.8.8.8"

    echo ""
    if [ $? -eq 0 ]
    then
	echo "*** [PASSED] End-to-end connectivity test"
	exit 0
    else
	echo "*** [FAILED] End-to-end connectivity test"
	exit 1
    fi
}

# Parse options
RUN_TEST=0
while getopts ":ht" opt; do
  case ${opt} in
    h ) "echo Usage:"
      echo "    $0            install OpenStack and prep XOS and ONOS VMs [default]"
      echo "    $0 -h         display this help message"
      echo "    $0 -t         do install, bring up cord-pod configuration, run E2E test"
      exit 0
      ;;
    t ) RUN_TEST=1
      ;;
    \? ) echo "Invalid option"
      exit 1
      ;;
  esac
done

# What to do
if [[ $RUN_TEST -eq 1 ]]
then
  cleanup_from_previous_test
fi

bootstrap
setup_openstack
pull_docker_images
wait_for_openstack
simulate_fabric

if [[ $RUN_TEST -eq 1 ]]
then
  setup_xos
  setup_test_client
  run_e2e_test
fi
