diff --git a/docker-compose/setup-script/tests/configure/scale.bats b/docker-compose/setup-script/tests/configure/scale.bats index 89da5a308f..d4b8c672cc 100755 --- a/docker-compose/setup-script/tests/configure/scale.bats +++ b/docker-compose/setup-script/tests/configure/scale.bats @@ -16,6 +16,10 @@ teardown() { } @test "Check NocoDB is scaled to 3 instances" { + nproc() { + echo 4 + } + ../expects/configure/scale.sh cd "${NOCO_HOME}" || exit 1 diff --git a/docker-compose/setup-script/tests/expects/install/ssl.sh b/docker-compose/setup-script/tests/expects/install/ssl.sh new file mode 100755 index 0000000000..f8b4769701 --- /dev/null +++ b/docker-compose/setup-script/tests/expects/install/ssl.sh @@ -0,0 +1,36 @@ +#!/usr/bin/expect -f + +# Configure timeout for each expect command +set timeout 10 + +set random_number [lindex $argv 0] + +# Start your main script +spawn bash ../../noco.sh + +# Respond to script prompts +expect "Enter the IP address or domain name for the NocoDB instance (default: localhost):" +send "${random_number}.ssl.nocodb.dev\r" + +expect "Show Advanced Options*" +send "y\r" + +expect "Do you want to configure SSL*" +send "y\r" + +expect "Choose Community or Enterprise Edition*" +send "\r" + +expect "Do you want to enabled Redis for caching*" +send "Y\r" + +expect "Do you want to enabled Watchtower for automatic updates*" +send "\r" + +expect "How many instances of NocoDB do you want to run*" +send "\r" + +expect "Do you want to start the management menu*" +send "N\r" + +expect eof diff --git a/docker-compose/setup-script/tests/install/ssl.bats b/docker-compose/setup-script/tests/install/ssl.bats new file mode 100644 index 0000000000..d82f222d71 --- /dev/null +++ b/docker-compose/setup-script/tests/install/ssl.bats @@ -0,0 +1,21 @@ +#!/usr/bin/env bats + +WORKING_DIR="$(pwd)" + +RANDOM_NUMBER=$RANDOM + +setup() { + cd "${WORKING_DIR}" || exit 1 + ./setup.sh +} + +teardown() { + cd "${WORKING_DIR}" || exit 1 + ./setup.sh +} + +@test "Should create SSL certificates" { + ../expects/install/ssl.sh "$RANDOM_NUMBER" + + curl -ksS --head "https://${RANDOM_NUMBER}.ssl.nocodb.dev" > /dev/null +}