Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -62,6 +62,8 @@ script:
coverage run --branch --source tlsfuzzer -m unittest discover;
fi
- coverage report -m
# check if all the scripts are included in the json file
- python tests/verify-scripts-json.py tests/tlslite-ng-random-subset.json
- travis_wait 30 python tests/scripts_retention.py tests/tlslite-ng-random-subset.json `which tls.py`
# pylint doesn't work on 2.6: https://bitbucket.org/logilab/pylint/issue/390/py26-compatiblity-broken
# diff-quality doesn't work on 3.2: https://github.com/edx/diff-cover/issues/94
Expand Down
37 changes: 37 additions & 0 deletions tests/verify-scripts-json.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@
#!/usr/bin/python

import os
from os import listdir, path
import json
from os.path import isfile, join, dirname, abspath
from sys import argv

parent_dir = dirname(dirname(abspath(__file__)))
scriptlist = [f for f in listdir(os.path.join(parent_dir,'scripts')) if isfile(join(os.path.join(parent_dir,'scripts'), f))]
status = 0
for arg in argv[1:]:
missing = []
try:
jsonfile = json.load(open(arg))
except IOError:
print("Please check the input file name, it doesn't appear to exist")
status =1
continue
except ValueError:
print("Wrong file type: The input must be a json file")
status =1
continue
except IndexError:
print("No input file was provided")
status =1
continue
for f in scriptlist:
if f not in str(jsonfile):
missing.append(f)
if not missing:
print(" All scripts are in the json file")
else:
print("There are {0} scripts that are missing from {1}:".format(str(len(missing)), str(arg)))
print("\n".join(missing))
status = 1
exit(status)