diff --git a/images/fluentd/tests/01-test.sh b/images/fluentd/tests/01-test.sh index 24a090031b..8302b0b119 100755 --- a/images/fluentd/tests/01-test.sh +++ b/images/fluentd/tests/01-test.sh @@ -15,10 +15,11 @@ fi # operate on the container further. # start_fluentd_detached() { + SCRIPT_PATH="$(dirname -- "${BASH_SOURCE[0]}")" docker run \ --detach --rm \ --publish 127.0.0.1:${FREE_PORT}:24224 \ - --volume "$(pwd)/images/fluentd/tests/configs/basic_docker.conf:/etc/fluent/fluent.conf" \ + --volume "$(pwd)/configs/basic_docker.conf:/etc/fluent/fluent.conf" \ "${IMAGE_NAME}" sleep 2 } diff --git a/images/fluentd/tests/main.tf b/images/fluentd/tests/main.tf index 164af0512d..cb0a93d72c 100644 --- a/images/fluentd/tests/main.tf +++ b/images/fluentd/tests/main.tf @@ -9,6 +9,7 @@ variable "digest" { } data "oci_exec_test" "test" { - digest = var.digest - script = "${path.module}/01-test.sh" + digest = var.digest + script = "./01-test.sh" + working_dir = path.module } diff --git a/images/fluentd/tests/splunk/01-test.sh b/images/fluentd/tests/splunk/01-test.sh index 1a616fd2c4..1a84d83e89 100755 --- a/images/fluentd/tests/splunk/01-test.sh +++ b/images/fluentd/tests/splunk/01-test.sh @@ -18,7 +18,7 @@ start_fluentd_detached() { docker run \ --detach --rm \ --publish 127.0.0.1:${FREE_PORT}:24224 \ - --volume "$(pwd)/images/fluentd/tests/configs/basic_splunk.conf:/etc/fluent/fluent.conf" \ + --volume "$(pwd)/configs/basic_splunk.conf:/etc/fluent/fluent.conf" \ "${IMAGE_NAME}" sleep 15 } diff --git a/images/fluentd/tests/configs/basic_splunk.conf b/images/fluentd/tests/splunk/configs/basic_splunk.conf similarity index 100% rename from images/fluentd/tests/configs/basic_splunk.conf rename to images/fluentd/tests/splunk/configs/basic_splunk.conf diff --git a/images/fluentd/tests/splunk/main.tf b/images/fluentd/tests/splunk/main.tf index 164af0512d..cb0a93d72c 100644 --- a/images/fluentd/tests/splunk/main.tf +++ b/images/fluentd/tests/splunk/main.tf @@ -9,6 +9,7 @@ variable "digest" { } data "oci_exec_test" "test" { - digest = var.digest - script = "${path.module}/01-test.sh" + digest = var.digest + script = "./01-test.sh" + working_dir = path.module }