test_install.sh 1.01 KB
Newer Older
1
2
#!/bin/bash -e

3
4
5
LOG_FILE="./tests/files/_log/install.log"
mkdir -p $(dirname "$LOG_FILE")

6
7
# Execute install
bin/console glpi:database:install \
8
  --config-dir=./tests/config --ansi --no-interaction \
Cédric Anne's avatar
Cédric Anne committed
9
  --force \
Cédric Anne's avatar
Cédric Anne committed
10
11
  --reconfigure --db-name=glpi --db-host=db --db-user=root \
  --log-deprecation-warnings \
Cédric Anne's avatar
Cédric Anne committed
12
13
  | tee $LOG_FILE
if [[ -n $(grep "Warning" $LOG_FILE) ]];
Cédric Anne's avatar
Cédric Anne committed
14
15
16
17
  then echo "glpi:database:install command FAILED" && exit 1;
fi

# Check DB
18
19
20
bin/console glpi:database:check_schema_integrity --config-dir=./tests/config --ansi --no-interaction --strict
bin/console glpi:tools:check_database_keys --config-dir=./tests/config --ansi --no-interaction --detect-useless-keys
bin/console glpi:tools:check_database_schema_consistency --config-dir=./tests/config --ansi --no-interaction
21
22
23

# Execute update
## Should do nothing.
24
25
bin/console glpi:database:update --config-dir=./tests/config --ansi --no-interaction | tee $LOG_FILE
if [[ -z $(grep "No migration needed." $LOG_FILE) ]];
26
27
  then echo "glpi:database:update command FAILED" && exit 1;
fi