Add CI tests

Signed-off-by: DL6ER <dl6er@dl6er.de>
This commit is contained in:
DL6ER
2023-12-09 19:34:27 +01:00
parent 3ab4082326
commit 284ff72f9c
2 changed files with 15 additions and 0 deletions

3
test/sqliterc Normal file
View File

@@ -0,0 +1,3 @@
.mode column
.headers on
.tables

View File

@@ -1169,6 +1169,18 @@
[[ ${lines[0]} == "Pi-hole FTL"* ]]
}
@test "Embedded SQLite3 shell ignores .sqliterc \"-ni\"" {
# Install .sqliterc file at current home directory
cp test/sqliterc ~/.sqliterc
run bash -c "./pihole-FTL sqlite3 /etc/pihole/gravity.db \"SELECT value FROM info WHERE property = 'abp_domains';\""
printf "%s\n" "${lines[@]}"
[[ ${lines[0]} != "1" ]]
run bash -c "./pihole-FTL sqlite3 -ni /etc/pihole/gravity.db \"SELECT value FROM info WHERE property = 'abp_domains';\""
printf "%s\n" "${lines[@]}"
[[ ${lines[0]} == "1" ]]
rm ~/.sqliterc
}
@test "Embedded LUA engine is called for .lua file" {
echo 'print("Hello from LUA")' > abc.lua
run bash -c './pihole-FTL abc.lua'