Browse Source

test: test for configure/stop

pull/8373/head
Rohit T P 2 months ago
parent
commit
6610f30213
  1. 27
      docker-compose/setup-script/tests/configure/stop.bats
  2. 0
      docker-compose/setup-script/tests/expects/configure/start.sh
  3. 18
      docker-compose/setup-script/tests/expects/configure/stop.sh

27
docker-compose/setup-script/tests/configure/stop.bats

@ -0,0 +1,27 @@
#!/usr/bin/env bats
NOCO_HOME="${HOME}/.nocodb"
export NOCO_HOME
WORKING_DIR="$(pwd)"
setup() {
cd "${WORKING_DIR}" || exit 1
./setup.sh
}
teardown() {
cd "${WORKING_DIR}" || exit 1
./setup.sh
}
@test "Check Redis, WatchTower and NocoDB are down" {
../expects/configure/stop.sh
cd "${NOCO_HOME}" || exit 1
# Verify container is not running
docker compose ps | grep -q 'redis' && fail "Redis is running"
docker compose ps | grep -q 'watchtower' && fail "WatchTower is running"
docker compose ps | grep -q 'nocodb' && fail "NocoDB is running"
}

0
docker-compose/setup-script/tests/expects/configure/start.sh

18
docker-compose/setup-script/tests/expects/configure/stop.sh

@ -0,0 +1,18 @@
#!/usr/bin/expect -f
# Configure timeout for each expect command
set timeout 10
# Start your main script
spawn bash ../../noco.sh
expect "Do you want to reinstall NocoDB*"
send "N\r"
expect "Enter your choice: "
send "2\r"
expect "Enter your choice: "
send "0\r"
expect EOF
Loading…
Cancel
Save