#!/usr/bin/env bash
defaultIdentity=
repoDir="test-repo"
repoConf="$repoDir/test.conf"
repoDataPrefix='ndn:/Z'
repoHost='localhost'
repoPort='9527'
nfdConf='host.nfd.conf'
systemNfdConf='/usr/local/etc/ndn/nfd.conf'
testLog='host.test.log'
nfdLog='host.nfd.log'

LOG() {
    echo "[A] $1"
    echo "[A] $1" >>$testLog
}

kill_process() {
    # $1: name of process
    if [[ $# -lt 1 ]]; then
        echo "require name of process"
        exit 1
    fi

    if pgrep -x $1 > /dev/null; then
        sudo -b killall -w "$1" >>$testLog 2>&1
    fi
}

delete_identity() {
    # $1: name of identity
    identity=$1 && identity=${identity#ndn:}
    if [[ $(ndnsec-list | grep -c "$identity$") -gt 0 ]]; then
        LOG " deleting identity $1"
        ndnsec-delete $identity >>$testLog 2>&1
    else
        LOG " identity $identity does not exist"
    fi
}

clean_up() {
    LOG "Killing processeses"
    kill_process "ndn-repo-ng"
    kill_process "nfd"
    kill_process "ndnpingserver"

    LOG "Deleting repo data"
    [[ -d $repoDir ]] && rm -rf $repoDir

    LOG "Deleting identities"
    delete_identity ndn:/Z
    delete_identity ndn:/Z/A
    delete_identity ndn:/Z/A/rib
    delete_identity ndn:/Z/A/B/C
    delete_identity ndn:/Z/A/B/C/D/E/rib
    delete_identity ndn:/Z/F

    if [[ -n "$defaultIdentity" ]]; then
        if [[ $(ndnsec-list | grep -c "$defaultIdentity$") -gt 0 ]]; then
            ndnsec-set-default $defaultIdentity
        fi
    else
        r=$(ndnsec-list)
        if [[ -n "$r" ]]; then
            r=`echo "$r" | tr "\n" "-"`
            r=${r%%-*} && r=${r#*/} && r="/$r"
            ndnsec-set-default $r
        fi
    fi
}

create_identity() {
    # $1: creating identity
    # $2: signing identity
    if [[ $# -gt 1 ]]; then
        ndnsec-key-gen -n $1 > tmp.req
        ndnsec-cert-gen -N "tmp" -s $2 -r tmp.req > tmp.cert; rm tmp.req
        ndnsec-cert-install tmp.cert >>$testLog 2>&1
        [[ -f tmp.cert ]] && rm tmp.cert
    elif [[ $# -gt 0 ]]; then
        ndnsec-key-gen -n $1 | ndnsec-cert-install - >>$testLog 2>&1
    else
        echo "require input identity"
        exit 1
    fi
}

publish_default_cert() {
    # $1: name of identity
    if [[ $# -lt 1 ]]; then
        echo "require identity to publish cert"
        exit 1
    fi

    if [[ "$1"x = "${1#${repoDataPrefix}}"x ]]; then
        echo "can not publish $1 under $repoDataPrefix"
        exit 1
    fi

    ndnsec-cert-dump -r -H $repoHost -P $repoPort -i $1
}

start_repo() {
    LOG "create repo dir config file for repo"
    [[ -d $repoDir ]] || mkdir -p $repoDir

    echo "" > $repoConf # create repo conf file

    infoedit -f $repoConf -s repo.data.prefix -v $repoDataPrefix
    infoedit -f $repoConf -s repo.command.prefix -v ""
    infoedit -f $repoConf -s repo.storage.method -v sqlite
    infoedit -f $repoConf -s repo.storage.path -v $repoDir
    infoedit -f $repoConf -s repo.storage.max-packets -v 100
    infoedit -f $repoConf -s repo.tcp_bulk_insert.host -v $repoHost
    infoedit -f $repoConf -s repo.tcp_bulk_insert.port -v $repoPort
    infoedit -f $repoConf -s repo.validator.trust-anchor.type -v any

    kill_process ndn-repo-ng
    LOG "start repo-ng"
    nohup ndn-repo-ng -c $repoConf >>$testLog 2>&1 &
}

start_nfd() {
    LOG "create nfd conf file with auto_prefix_propagate section specified for test"
    [[ ! -f $systemNfdConf ]] && LOG "can not find nfd config file" && exit 1

    cp $systemNfdConf $nfdConf
    infoedit -f $nfdConf -s rib.auto_prefix_propagate.cost -v 15
    infoedit -f $nfdConf -s rib.auto_prefix_propagate.timeout -v 10000
    infoedit -f $nfdConf -s rib.auto_prefix_propagate.base_retry_wait -v 50
    infoedit -f $nfdConf -s rib.auto_prefix_propagate.max_retry_wait -v 3600
    infoedit -f $nfdConf -s rib.auto_prefix_propagate.refresh_interval -v 15

    kill_process nfd
    LOG "start NFD"
    sudo nohup nfd --config $nfdConf >>$nfdLog 2>&1 &
}

prepare_for_test() {
    echo "Start test log on end host" >$testLog
    echo "Start nfd log on end host" >$nfdLog

    start_nfd && sleep 2

    start_repo && sleep 2

    defaultIdentity=$(ndnsec-get-default)

    # create identities and publish their certificates
    LOG "create identity /Z/A and publish its cert"
    create_identity ndn:/Z/A
    publish_default_cert ndn:/Z/A

    LOG "create identity /Z/A/nrd and publish its cert"
    create_identity ndn:/Z/A/rib ndn:/Z/A
    publish_default_cert ndn:/Z/A/rib

    LOG "create identity /Z/A/B/C and publish its cert"
    create_identity ndn:/Z/A/B/C ndn:/Z/A
    publish_default_cert ndn:/Z/A/B/C

    LOG "create identity /Z/F and publish its cert"
    create_identity ndn:/Z/F
    publish_default_cert ndn:/Z/F
}

generate_anchor() {
    certFile='auto-propagate.anchor.cert'
    ndnsec-export -o $certFile $1 >>$testLog 2>&1
    cert=$(cat $certFile) && rm $certFile
    echo $cert
}

while getopts "a:cp" arg
    do
        case $arg in
             a)
                 generate_anchor $OPTARG
                 ;;
             c)
                 clean_up
                 ;;
             p)
                 prepare_for_test
                 ;;
             ?)
                 echo "unknown argument"
        exit 1
        ;;
        esac
done
