#!/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.sample'
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='anchor.cert'
    ndnsec-export -o $certFile $1 >>$testLog 2>&1
    echo $certFile
}

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
