Skip to content

Commit

Permalink
fix tests
Browse files Browse the repository at this point in the history
  • Loading branch information
clowwindy committed Feb 1, 2015
1 parent 35e6300 commit c7744f1
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 3 deletions.
1 change: 1 addition & 0 deletions .jenkins.sh
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,7 @@ function run_test {
rm src/*.gc*
run_test ./autogen.sh
run_test ./configure --enable-debug
make clean
run_test make
run_test tests/test.py -a '-c chnroute.txt -l iplist.txt' -t tests/google.com
run_test tests/test.py -a '-c chnroute.txt -l iplist.txt' -t tests/facebook.com
Expand Down
1 change: 0 additions & 1 deletion src/chinadns.c
Original file line number Diff line number Diff line change
Expand Up @@ -250,7 +250,6 @@ static int setnonblock(int sock) {
static int parse_args(int argc, char **argv) {
int ch;
dns_servers = strdup(default_dns_servers);
ip_list_file = NULL;
listen_addr = strdup(default_listen_addr);
listen_port = strdup(default_listen_port);
while ((ch = getopt(argc, argv, "hb:p:s:l:c:y:dmv")) != -1) {
Expand Down
5 changes: 3 additions & 2 deletions tests/test.py
Original file line number Diff line number Diff line change
Expand Up @@ -9,14 +9,15 @@
from subprocess import Popen

parser = argparse.ArgumentParser(description='test ChinaDNS')
parser.add_argument('-a', '--arguments', type=list, default=[])
parser.add_argument('-a', '--arguments', type=str, default=[])
parser.add_argument('-t', '--test-command', type=str, default=None)

config = parser.parse_args()

arguments = config.arguments
chinadns = ['src/chinadns', '-p', '15353', '-v'] + arguments
chinadns = ['src/chinadns', '-p', '15353', '-v'] + arguments.split()

print chinadns
p1 = Popen(chinadns, shell=False, bufsize=0, close_fds=True)
try:

Expand Down

0 comments on commit c7744f1

Please sign in to comment.