-
-
Notifications
You must be signed in to change notification settings - Fork 1.1k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #62 from diginc/dev
Dev Test additions
- Loading branch information
Showing
8 changed files
with
39 additions
and
23 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -7,4 +7,4 @@ python: | |
install: | ||
- pip install -r requirements.txt | ||
|
||
script: py.test -v | ||
script: py.test -vv |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1 +1 @@ | ||
py.test -v -f test/ | ||
py.test -f ./test -v $@ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,11 +1,11 @@ | ||
#!/bin/bash | ||
IMAGE=${1:-'diginc/pi-hole:alpine'} | ||
NIC=${2:-'eth0'} | ||
IP=$(ip addr show $NIC | grep "inet\b" | awk '{print $2}' | cut -d/ -f1) | ||
IP=$(ip addr show "$NIC" | grep "inet\b" | awk '{print $2}' | cut -d/ -f1) | ||
|
||
# Default ports + daemonized docker container | ||
docker run -p 53:53/tcp -p 53:53/udp -p 80:80 \ | ||
--cap-add=NET_ADMIN \ | ||
-e ServerIP="$IP" \ | ||
--name pihole \ | ||
-d $IMAGE | ||
-d "$IMAGE" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,11 +1,11 @@ | ||
#!/bin/sh -e | ||
supportedTags='^(alpine|debian)$' | ||
if ! (echo $1 | grep -Pq "$supportedTags") ; then | ||
if ! (echo "$1" | grep -Pq "$supportedTags") ; then | ||
echo "$1 is not a supported tag"; exit 1; | ||
fi | ||
|
||
unlink docker-compose.yml | ||
unlink Dockerfile | ||
|
||
ln -s doco-${1}.yml docker-compose.yml | ||
ln -s ${1}.docker Dockerfile | ||
ln -s "doco-${1}.yml" docker-compose.yml | ||
ln -s "${1}.docker" Dockerfile |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
import pytest | ||
import testinfra | ||
|
||
run_local = testinfra.get_backend( | ||
"local://" | ||
).get_module("Command").run | ||
|
||
def test_scripts_pass_shellcheck(): | ||
''' Make sure shellcheck does not find anything wrong with our shell scripts ''' | ||
shellcheck = "find . ! -path './pi-hole/*' -name '*.sh' -a ! -name 'gravity.sh' | while read file; do shellcheck $file; done;" | ||
results = run_local(shellcheck) | ||
print results.stdout | ||
assert '' == results.stdout |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters