Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
S
scapy
Manage
Activity
Members
Plan
Wiki
Code
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Deploy
Releases
Package Registry
Model registry
Operate
Terraform modules
Analyze
Contributor analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
CodeLinaro
public-release-test-restored
platform
external
scapy
Commits
58baae8d
Commit
58baae8d
authored
7 years ago
by
Pierre LALET
Browse files
Options
Downloads
Patches
Plain Diff
Python 3: fix Nmap module tests
parent
c5e1b99e
No related branches found
No related tags found
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
test/nmap.uts
+9
-4
9 additions, 4 deletions
test/nmap.uts
with
9 additions
and
4 deletions
test/nmap.uts
+
9
−
4
View file @
58baae8d
...
@@ -10,8 +10,13 @@
...
@@ -10,8 +10,13 @@
load_module('nmap')
load_module('nmap')
= Fetch database
= Fetch database
import urllib
from __future__ import print_function
open('nmap-os-fingerprints', 'wb').write(urllib.urlopen('https://raw.githubusercontent.com/nmap/nmap/9efe1892/nmap-os-fingerprints').read())
try:
from urllib.request import urlopen
except ImportError:
from urllib2 import urlopen
open('nmap-os-fingerprints', 'wb').write(urlopen('https://raw.githubusercontent.com/nmap/nmap/9efe1892/nmap-os-fingerprints').read())
conf.nmap_base = 'nmap-os-fingerprints'
conf.nmap_base = 'nmap-os-fingerprints'
= Database loading
= Database loading
...
@@ -20,14 +25,14 @@ assert len(nmap_kdb.get_base()) > 100
...
@@ -20,14 +25,14 @@ assert len(nmap_kdb.get_base()) > 100
= fingerprint test: www.secdev.org
= fingerprint test: www.secdev.org
~ netaccess
~ netaccess
score, fprint = nmap_fp('www.secdev.org')
score, fprint = nmap_fp('www.secdev.org')
print
score, fprint
print
(
score, fprint
)
assert score > 0.5
assert score > 0.5
assert fprint
assert fprint
= fingerprint test: gateway
= fingerprint test: gateway
~ netaccess
~ netaccess
score, fprint = nmap_fp(conf.route.route('0.0.0.0')[2])
score, fprint = nmap_fp(conf.route.route('0.0.0.0')[2])
print
score, fprint
print
(
score, fprint
)
assert score > 0.5
assert score > 0.5
assert fprint
assert fprint
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment