#!/bin/sh
#
# Copyright (C) Internet Systems Consortium, Inc. ("ISC")
#
# This Source Code Form is subject to the terms of the Mozilla Public
# License, v. 2.0. If a copy of the MPL was not distributed with this
# file, you can obtain one at https://mozilla.org/MPL/2.0/.
#
# See the COPYRIGHT file distributed with this work for additional
# information regarding copyright ownership.

#
# Common configuration data for system tests, to be sourced into
# other shell scripts.
#

# Find the top of the BIND9 tree.
TOP_BUILDDIR=@abs_top_builddir@
TOP_SRCDIR=@abs_top_srcdir@

# This is the windows build. This disables certain tests cases
# and changes some specific behaviors where necessary.
CYGWIN=1

# Load common values shared between windows and unix/linux.
. $TOP_BUILDDIR/bin/tests/system/conf.sh.common

# Visual Studio build configurations are Release and Debug
VSCONF=${VSCONF:-Debug}

ARPANAME=$TOP_BUILDDIR/Build/$VSCONF/arpaname@EXEEXT@
CDS=$TOP_BUILDDIR/Build/$VSCONF/dnssec-cds@EXEEXT@
CHECKCONF=$TOP_BUILDDIR/Build/$VSCONF/named-checkconf@EXEEXT@
CHECKZONE=$TOP_BUILDDIR/Build/$VSCONF/named-checkzone@EXEEXT@
DELV=$TOP_BUILDDIR/Build/$VSCONF/delv@EXEEXT@
DIG=$TOP_BUILDDIR/Build/$VSCONF/dig@EXEEXT@
DNSTAPREAD=$TOP_BUILDDIR/Build/$VSCONF/dnstap-read@EXEEXT@
DSFROMKEY=$TOP_BUILDDIR/Build/$VSCONF/dnssec-dsfromkey@EXEEXT@
FEATURETEST=$TOP_BUILDDIR/Build/$VSCONF/feature-test@EXEEXT@
FSTRM_CAPTURE=@FSTRM_CAPTURE@
IMPORTKEY=$TOP_BUILDDIR/Build/$VSCONF/dnssec-importkey@EXEEXT@
JOURNALPRINT=$TOP_BUILDDIR/Build/$VSCONF/named-journalprint@EXEEXT@
KEYFRLAB=$TOP_BUILDDIR/Build/$VSCONF/dnssec-keyfromlabel@EXEEXT@
KEYGEN=$TOP_BUILDDIR/Build/$VSCONF/dnssec-keygen@EXEEXT@
MDIG=$TOP_BUILDDIR/Build/$VSCONF/mdig@EXEEXT@
NAMED=$TOP_BUILDDIR/Build/$VSCONF/named@EXEEXT@
NSEC3HASH=$TOP_BUILDDIR/Build/$VSCONF/nsec3hash@EXEEXT@
NSLOOKUP=$TOP_BUILDDIR/Build/$VSCONF/nslookup@EXEEXT@
NSUPDATE=$TOP_BUILDDIR/Build/$VSCONF/nsupdate@EXEEXT@
NZD2NZF=$TOP_BUILDDIR/Build/$VSCONF/named-nzd2nzf@EXEEXT@
PK11DEL="$TOP_BUILDDIR/Build/$VSCONF/pkcs11-destroy@EXEEXT@ -s ${SLOT:-0} -p ${HSMPIN:-1234} -w 0"
PK11GEN="$TOP_BUILDDIR/Build/$VSCONF/pkcs11-keygen@EXEEXT@ -q -s ${SLOT:-0} -p ${HSMPIN:-1234}"
PK11LIST="$TOP_BUILDDIR/Build/$VSCONF/pkcs11-list@EXEEXT@ -s ${SLOT:-0} -p ${HSMPIN:-1234}"
REVOKE=$TOP_BUILDDIR/Build/$VSCONF/dnssec-revoke@EXEEXT@
RNDC=$TOP_BUILDDIR/Build/$VSCONF/rndc@EXEEXT@
RNDCCONFGEN=$TOP_BUILDDIR/Build/$VSCONF/rndc-confgen@EXEEXT@
RRCHECKER=$TOP_BUILDDIR/Build/$VSCONF/named-rrchecker@EXEEXT@
SETTIME=$TOP_BUILDDIR/Build/$VSCONF/dnssec-settime@EXEEXT@
SIGNER=$TOP_BUILDDIR/Build/$VSCONF/dnssec-signzone@EXEEXT@
TSIGKEYGEN=$TOP_BUILDDIR/Build/$VSCONF/tsig-keygen@EXEEXT@
VERIFY=$TOP_BUILDDIR/Build/$VSCONF/dnssec-verify@EXEEXT@

# to port WIRETEST=$TOP_BUILDDIR/Build/$VSCONF/wire_test@EXEEXT@
WIRETEST=

BIGKEY=$TOP_BUILDDIR/Build/$VSCONF/bigkey@EXEEXT@
GENCHECK=$TOP_BUILDDIR/Build/$VSCONF/gencheck@EXEEXT@
KEYCREATE=$TOP_BUILDDIR/Build/$VSCONF/keycreate@EXEEXT@
KEYDELETE=$TOP_BUILDDIR/Build/$VSCONF/keydelete@EXEEXT@
MAKEJOURNAL=$TOP_BUILDDIR/Build/$VSCONF/makejournal@EXEEXT@
PIPEQUERIES=$TOP_BUILDDIR/Build/$VSCONF/pipequeries@EXEEXT@
RESOLVE=$TOP_BUILDDIR/Build/$VSCONF/resolve@EXEEXT@

# we don't want a KRB5_CONFIG setting breaking the tests
KRB5_CONFIG=NUL

#
# Construct the lists of tests to run
#
SEQUENTIAL_WINDOWS=""
SEQUENTIALDIRS="$SEQUENTIAL_COMMON $SEQUENTIAL_WINDOWS"

PARALLEL_WINDOWS="@DNSTAP@"
PARALLELDIRS="$PARALLEL_COMMON $PARALLEL_WINDOWS"

SUBDIRS="$SEQUENTIALDIRS $PARALLELDIRS"

# Things that are different on Windows
KILL="/bin/kill -f"
DIFF="diff --strip-trailing-cr"
DOS2UNIX=dos2unix
# No trailing period
TP=

# Configure is launched from native environment, but tests are run in Cygwin -
# so any detection is unreliable.
SHELL="/bin/bash -o igncr"
CURL=/usr/bin/curl
XMLLINT=/usr/bin/xmllint
PERL=/usr/bin/perl

#
# PsSuspend is part of PSTools and can be downloaded from
# https://download.sysinternals.com/files/PSTools.zip
#
PSSUSPEND=@PSSUSPEND@

PYTHON=@PYTHON@

#
# Determine if we support various optional features.
#
HAVEXMLSTATS=@XMLSTATS@
HAVEJSONSTATS=@JSONSTATS@
HAVEZLIB=@ZLIB@
NZD=@NZD_TOOLS@
CRYPTO=@CRYPTO@
