diff --git a/postgresql93/plan.sh b/postgresql93/plan.sh index 0d0b7218d5..d020eb1f0b 100644 --- a/postgresql93/plan.sh +++ b/postgresql93/plan.sh @@ -1,5 +1,6 @@ # shellcheck disable=SC2148,SC1091 -source ../postgresql/plan.sh +PLANDIR=$(dirname "${BASH_SOURCE[0]}") +source "${PLANDIR}/../postgresql/plan.sh" pkg_name=postgresql93 pkg_version=9.3.23 diff --git a/postgresql94/plan.sh b/postgresql94/plan.sh index 999341fcf8..ff71fc093b 100644 --- a/postgresql94/plan.sh +++ b/postgresql94/plan.sh @@ -1,5 +1,6 @@ # shellcheck disable=SC2148,SC1091 -source ../postgresql/plan.sh +PLANDIR=$(dirname "${BASH_SOURCE[0]}") +source "${PLANDIR}/../postgresql/plan.sh" pkg_name=postgresql94 pkg_version=9.4.18 diff --git a/postgresql95/plan.sh b/postgresql95/plan.sh index ec80fe46fc..9221bcf04b 100644 --- a/postgresql95/plan.sh +++ b/postgresql95/plan.sh @@ -1,5 +1,6 @@ # shellcheck disable=SC2148,SC1091 -source ../postgresql/plan.sh +PLANDIR=$(dirname "${BASH_SOURCE[0]}") +source "${PLANDIR}/../postgresql/plan.sh" pkg_name=postgresql95 pkg_version=9.5.13 diff --git a/postgresql96/plan.sh b/postgresql96/plan.sh index eececdca03..a5b2265dcb 100644 --- a/postgresql96/plan.sh +++ b/postgresql96/plan.sh @@ -1,5 +1,6 @@ # shellcheck disable=SC2148,SC1091 -source ../postgresql/plan.sh +PLANDIR=$(dirname "${BASH_SOURCE[0]}") +source "${PLANDIR}/../postgresql/plan.sh" pkg_name=postgresql96 pkg_version=9.6.9 diff --git a/postgresql96/tests/extra_data_files.bats b/postgresql96/tests/extra_data_files.bats index 07608410c0..125754dbd2 100644 --- a/postgresql96/tests/extra_data_files.bats +++ b/postgresql96/tests/extra_data_files.bats @@ -1,4 +1,6 @@ -NONHAB_FILE="/hab/svc/postgresql96/data/lost+found" +source "${BATS_TEST_DIRNAME}/../plan.sh" + +NONHAB_FILE="/hab/svc/${pkg_name}/data/lost+found" function setup() { touch "${NONHAB_FILE}" @@ -11,10 +13,10 @@ function teardown() { } @test "Non-hab owned files in /data are allowed" { - ORIGIN=$(hab svc status |grep postgresql96| cut -f1 -d'/') - hab svc stop "${ORIGIN}/postgresql96" + ORIGIN=$(hab svc status |grep ${pkg_name}| cut -f1 -d'/') + hab svc stop "${ORIGIN}/${pkg_name}" - hab svc start "${ORIGIN}/postgresql96" + hab svc start "${ORIGIN}/${pkg_name}" # Wait for service to start sleep 1 @@ -25,5 +27,5 @@ function teardown() { [ "root" == $(stat -c %G "${NONHAB_FILE}") ] [ "-rw-------" == $(stat -c %A "${NONHAB_FILE}") ] - [ "$(hab svc status | grep "postgresql96.default" | awk '{print $4}' | grep up)" ] + [ "$(hab svc status | grep "${pkg_name}.default" | awk '{print $4}' | grep up)" ] } diff --git a/postgresql96/tests/test.bats b/postgresql96/tests/test.bats index ee0090f0d9..c00e6baf83 100644 --- a/postgresql96/tests/test.bats +++ b/postgresql96/tests/test.bats @@ -12,7 +12,7 @@ source "${BATS_TEST_DIRNAME}/../plan.sh" } @test "Service is running" { - [ "$(hab svc status | grep "postgresql96\.default" | awk '{print $4}' | grep up)" ] + [ "$(hab svc status | grep "${pkg_name}\.default" | awk '{print $4}' | grep up)" ] } @test "A single process" {