Compare commits

..

2 Commits

5 changed files with 31 additions and 28 deletions

6
Jenkinsfile vendored
View File

@ -105,9 +105,9 @@ pipeline {
stage('Integration Tests') { stage('Integration Tests') {
steps { steps {
sh 'mkdir -p test/results/integration' sh 'mkdir -p test/results/integration'
sh 'bats -F junit test/integration/dns/thelinux.pro/*.bat test/integration/dns/thelinux.pro/**/*.bat > test/results/integration/TEST-Integration-dns-thelinux_pro.xml' sh 'bats -F junit --gather-test-outputs-in test/results/integration test/integration/dns/thelinux.pro/*.bat test/integration/dns/thelinux.pro/**/*.bat
sh 'bats -F junit test/integration/dns/kameronkenny.com/*.bat test/integration/dns/kameronkenny.com/**/*.bat > test/results/integration/TEST-Integration-dns-kameronkenny_com.xml' sh 'bats -F junit --gather-test-outputs-in test/results/integration test/integration/dns/kameronkenny.com/*.bat test/integration/dns/kameronkenny.com/**/*.bat
sh 'bats -F junit test/integration/dns/in.thelinuxpro.net/*.bat test/integration/dns/in.thelinuxpro.net/**/*.bat > test/results/integration/TEST-Integration-dns-in_thelinuxpro_net.xml' sh 'bats -F junit --gather-test-outputs-in test/results/integration test/integration/dns/in.thelinuxpro.net/*.bat test/integration/dns/in.thelinuxpro.net/**/*.bat
} }
} }
} }

View File

@ -1,12 +0,0 @@
#!/usr/bin/env bats
load 'local-setup'
_local_setup
load 'helper'
@test "Test A Record: ${domain}" {
run dig -t A ${domain} +noall +answer
assert_output --partial "${ip}"
}

View File

@ -2,9 +2,10 @@
_local_setup() { _local_setup() {
DIR="$( cd "$( dirname "$BATS_TEST_FILENAME" )" >/dev/null 2>&1 && pwd)" DIR="$( cd "$( dirname "$BATS_TEST_FILENAME" )" >/dev/null 2>&1 && pwd)"
TEST_ROOT="$( cd "$( dirname "$DIR/../../" )" >/dev/null 2>&1 && pwd)" TEST_ROOT="$( cd "$( dirname "$DIR/../../../" )" >/dev/null 2>&1 && pwd)"
bats_load_library bats-support bats_load_library bats-support
bats_load_library bats-assert bats_load_library bats-assert
load "$TEST_ROOT/test_helper/dns-functions"
source "$DIR/helper.bash" source "$DIR/helper.bash"
} }

View File

@ -1,12 +0,0 @@
#!/usr/bin/env bats
load 'local-setup'
_local_setup
load 'helper'
@test "Test SOA Record: ${domain}" {
run dig -t SOA ${domain} +noall +answer +multi
assert_output --partial "${serial}"
}

View File

@ -0,0 +1,26 @@
#!/usr/bin/env bats
load 'local-setup'
_local_setup
load 'helper'
@test "Test A Record: ${domain}" {
run _check_a_record
assert_output --partial "${ip}"
}
@test "Test SOA Record: ${domain}" {
run _check_soa_record
assert_output --partial "${serial}"
}
@test "Test SOA Record @ns1: ${domain}" {
run _check_soa_record_at_ns1
assert_output --partial "${serial}"
}
@test "Test SOA Record @ns2: ${domain}" {
run _check_soa_record_at_ns2
assert_output --partial "${serial}"
}