diff options
author | Lukas Fleischer <lfleischer@archlinux.org> | 2017-03-03 20:30:57 +0100 |
---|---|---|
committer | Lukas Fleischer <lfleischer@archlinux.org> | 2017-03-03 20:30:57 +0100 |
commit | 9de633b1f2b5c9462624e00d2d17d947436bc83f (patch) | |
tree | 40c828be1ffcdc999df908807c01ff94cc257464 | |
parent | 7ee97933de51ace985a732f63906a6f8c8102d34 (diff) | |
download | aur-9de633b1f2b5c9462624e00d2d17d947436bc83f.tar.gz aur-9de633b1f2b5c9462624e00d2d17d947436bc83f.tar.xz |
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>
-rw-r--r-- | test/setup.sh | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/test/setup.sh b/test/setup.sh index 64ba88f2..b71e73e8 100644 --- a/test/setup.sh +++ b/test/setup.sh @@ -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 |