mirror of
https://gitlab.archlinux.org/archlinux/aurweb.git
synced 2025-02-03 10:43:03 +01:00
test/setup.sh: Error out on missing SQLite schema
Instead of making all tests fail, error out during initialization if the SQLite schema has not been generated. Signed-off-by: Lukas Fleischer <lfleischer@archlinux.org>
This commit is contained in:
parent
7ee97933de
commit
9de633b1f2
1 changed files with 3 additions and 1 deletions
|
@ -105,8 +105,10 @@ SSH_TTY=/dev/pts/0
|
|||
export SSH_CLIENT SSH_CONNECTION SSH_TTY
|
||||
|
||||
# Initialize the test database.
|
||||
DBSCHEMA="$TOPLEVEL/schema/aur-schema-sqlite.sql"
|
||||
[ -f "$DBSCHEMA" ] || error 'SQLite database schema not found'
|
||||
rm -f aur.db
|
||||
sqlite3 aur.db <"$TOPLEVEL/schema/aur-schema-sqlite.sql"
|
||||
sqlite3 aur.db <"$DBSCHEMA"
|
||||
|
||||
echo "INSERT INTO Users (ID, UserName, Passwd, Email, AccountTypeID) VALUES (1, 'user', '!', 'user@localhost', 1);" | sqlite3 aur.db
|
||||
echo "INSERT INTO Users (ID, UserName, Passwd, Email, AccountTypeID) VALUES (2, 'tu', '!', 'tu@localhost', 2);" | sqlite3 aur.db
|
||||
|
|
Loading…
Add table
Reference in a new issue