-
Notifications
You must be signed in to change notification settings - Fork 1.3k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
11 changed files
with
107 additions
and
2 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 |
---|---|---|
|
@@ -10,6 +10,10 @@ | |
*.sdf | ||
*.status | ||
*.tar.* | ||
*.gcov | ||
*.gcda | ||
*.gcno | ||
*.html | ||
*~ | ||
.DS_Store | ||
.deps | ||
|
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,37 @@ | ||
#!/bin/bash | ||
|
||
result=0 | ||
|
||
function run_test { | ||
printf '\e[0;36m' | ||
echo "running test: $command $@" | ||
printf '\e[0m' | ||
|
||
$command "$@" | ||
status=$? | ||
if [ $status -ne 0 ]; then | ||
printf '\e[0;31m' | ||
echo "test failed: $command $@" | ||
printf '\e[0m' | ||
echo | ||
result=1 | ||
else | ||
printf '\e[0;32m' | ||
echo OK | ||
printf '\e[0m' | ||
echo | ||
fi | ||
return 0 | ||
} | ||
|
||
run_test ./autogen.sh | ||
run_test ./configure --enable-debug | ||
run_test make | ||
run_test tests/test.py tests/google.com | ||
run_test tests/test.py tests/facebook.com | ||
run_test tests/test.py tests/twitter.com | ||
|
||
gcov src/*.c | ||
cd src && gcovr -r . --html --html-details -o index.html | ||
|
||
exit $result |
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 |
---|---|---|
|
@@ -9,8 +9,9 @@ compiler: | |
- gcc | ||
|
||
before_script: | ||
- pip install gcovr | ||
- ./autogen.sh | ||
- ./configure | ||
|
||
script: | ||
- make | ||
- ./.jenkins.sh |
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 |
---|---|---|
@@ -0,0 +1 @@ | ||
dig @127.0.0.1 a facebook.com |
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 @@ | ||
dig @127.0.0.1 a google.com |
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,15 @@ | ||
#!/usr/bin/python | ||
|
||
from subprocess import Popen, PIPE | ||
|
||
if __name__ == '__main__': | ||
result = set() | ||
for i in range(400, 1400): | ||
p = Popen((('dig +short @114.114.114.114 a ' | ||
'r%d-1.googlevideo.com') % i).split(), | ||
stdin=PIPE, stdout=PIPE, stderr=PIPE, close_fds=True) | ||
output = p.stdout.read() | ||
if output: | ||
result.add(output.strip()) | ||
for r in result: | ||
print r |
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,34 @@ | ||
#!/usr/bin/python | ||
# -*- coding: utf-8 -*- | ||
|
||
import sys | ||
import os | ||
import signal | ||
import time | ||
from subprocess import Popen | ||
|
||
chinadns = ['src/chinadns', '-l', 'iplist.txt', '-c', 'chnroute.txt', | ||
'-p', '15353', '-v'] | ||
|
||
p1 = Popen(chinadns, shell=False, bufsize=0, close_fds=True) | ||
|
||
with open(sys.argv[-1]) as f: | ||
dig_cmd = f.read() | ||
|
||
time.sleep(1) | ||
|
||
p2 = Popen(dig_cmd.split() + ['-p', '15353'], shell=False, | ||
bufsize=0, close_fds=True) | ||
|
||
if p2 is not None: | ||
r = p2.wait() | ||
if r == 0: | ||
print 'test passed' | ||
|
||
for p in [p1]: | ||
try: | ||
os.kill(p.pid, signal.SIGTERM) | ||
except OSError: | ||
pass | ||
|
||
sys.exit(r) |
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 @@ | ||
dig @127.0.0.1 a twitter.com |
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 @@ | ||
dig @127.0.0.1 a www.facebook.com |