restic-scheduler/itest/bootstrap-tests.sh
Ian Fijolek 28f081c8d0
All checks were successful
continuous-integration/drone/push Build is passing
Add integration testing to verify backup and restoration
Including databases
2023-08-02 14:55:14 -07:00

32 lines
672 B
Bash
Executable File

#! /bin/sh
set -ex
# Create flat file
echo "Hello" > /data/test.txt
# Create Sqlite database
touch /data/test_database.db
sqlite3 /data/test_database.db <<-EOF
CREATE TABLE test_table (
id integer PRIMARY KEY,
data text NOT NULL
);
INSERT INTO test_table(data)
VALUES ("Test row");
EOF
# Create MySql database
until mysql --host "$MYSQL_HOST" --user "$MYSQL_USER" --password="$MYSQL_PWD" --execute "SHOW DATABASES;"; do
sleep 1
done
mysql --host "$MYSQL_HOST" --user "$MYSQL_USER" --password="$MYSQL_PWD" main <<EOF
CREATE TABLE test_table (
id integer AUTO_INCREMENT PRIMARY KEY,
data text NOT NULL
);
INSERT INTO test_table(data)
VALUES ("Test row");
EOF