Skip to content
Snippets Groups Projects
Commit 911f1d6c authored by gpotter2's avatar gpotter2
Browse files

Better tests + fixes

parent 8666c131
No related branches found
No related tags found
No related merge requests found
...@@ -31,7 +31,7 @@ test_script: ...@@ -31,7 +31,7 @@ test_script:
- 'del test\bpf.uts' # Don't bother with BPF regression tests - 'del test\bpf.uts' # Don't bother with BPF regression tests
- "%PYTHON%\\python -m coverage run --parallel-mode bin\\UTscapy -c test\\configs\\windows.utsc || exit /b 42" - "%PYTHON%\\python -m coverage run --parallel-mode bin\\UTscapy -c test\\configs\\windows.utsc || exit /b 42"
# Tls unit tests # TLS unit tests
# Note: due to a multiprocessing bug, we got to be in the UTscapy.py folder and call it directly # Note: due to a multiprocessing bug, we got to be in the UTscapy.py folder and call it directly
- 'cd scapy/tools' - 'cd scapy/tools'
- "%PYTHON%\\python -m coverage run --concurrency=multiprocessing UTscapy.py -f text -t ..\\..\\test\\tls\\tests_tls_netaccess.uts -F -P \"sys.path.append(os.path.abspath('../../test/tls'))\" -K open_ssl_client || exit /b 42" - "%PYTHON%\\python -m coverage run --concurrency=multiprocessing UTscapy.py -f text -t ..\\..\\test\\tls\\tests_tls_netaccess.uts -F -P \"sys.path.append(os.path.abspath('../../test/tls'))\" -K open_ssl_client || exit /b 42"
......
...@@ -209,9 +209,27 @@ assert _correct ...@@ -209,9 +209,27 @@ assert _correct
= show_interfaces = show_interfaces
from scapy.arch import * from scapy.arch import show_interfaces
show_interfaces() from StringIO import StringIO
@mock.patch('sys.stdout', new_callable=StringIO)
def test_show_interfaces(mock_stdout):
show_interfaces()
lines = mock_stdout.getvalue().split("\n")[1:]
for l in lines:
if not l.strip():
continue
try:
int(l[0])
except:
sys.stderr.write(l)
return False
return True
assert test_show_interfaces()
= dev_from_pcapname = dev_from_pcapname
from scapy.config import conf
assert dev_from_pcapname(conf.iface.pcap_name).guid == conf.iface.guid assert dev_from_pcapname(conf.iface.pcap_name).guid == conf.iface.guid
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment