mirror of
https://github.com/pi-hole/FTL.git
synced 2024-10-26 16:52:18 +02:00
Use special socket file on Travis
Signed-off-by: DL6ER <dl6er@dl6er.de>
This commit is contained in:
+4
-1
@@ -36,7 +36,10 @@ int main (int argc, char **argv) {
|
||||
printf ("Socket created\n");
|
||||
|
||||
address.sun_family = AF_LOCAL;
|
||||
strcpy(address.sun_path, UDS_FILE);
|
||||
if(argc == 2 && strcmp(argv[1], "travis") == 0)
|
||||
strcpy(address.sun_path,"pihole-FTL.sock");
|
||||
else
|
||||
strcpy(address.sun_path,"/var/run/pihole/FTL.sock");
|
||||
ret = connect(socketfd, (struct sockaddr *) &address, sizeof (address));
|
||||
if (ret != 0)
|
||||
{
|
||||
|
||||
@@ -196,6 +196,12 @@ load 'libs/bats-support/load'
|
||||
[[ ${lines[0]} == "pihole-FTL - The Pi-hole FTL engine" ]]
|
||||
}
|
||||
|
||||
@test "Unix socket returning data" {
|
||||
run bash -c './pihole-FTL help'
|
||||
echo "output: ${lines[@]}"
|
||||
[[ ${lines[0]} == "pihole-FTL - The Pi-hole FTL engine" ]]
|
||||
}
|
||||
|
||||
@test "Final part of the tests: Killing pihole-FTL process" {
|
||||
run bash -c 'echo ">kill" | nc -v 127.0.0.1 4711'
|
||||
echo "output: ${lines[@]}"
|
||||
|
||||
Reference in New Issue
Block a user