mirror of
https://github.com/nmap/nmap.git
synced 2026-08-27 03:48:14 +00:00
Allow make nse_check to pass when configured --without-openssl
This commit is contained in:
parent
4aeabca374
commit
f846e7c818
2 changed files with 16 additions and 7 deletions
|
|
@ -921,6 +921,7 @@ if not unittest.testing() then
|
|||
end
|
||||
|
||||
test_suite = unittest.TestSuite:new()
|
||||
if have_ssl then
|
||||
test_suite:add_test(unittest.equal(
|
||||
stdnse.tohex(select(-1, lm_create_hash("passphrase"))),
|
||||
"855c3697d9979e78ac404c4ba2c66533"
|
||||
|
|
@ -945,5 +946,9 @@ test_suite:add_test(unittest.equal(
|
|||
),
|
||||
"ntlm_create_hash"
|
||||
)
|
||||
else
|
||||
test_suite:add_test(unittest.is_false(lm_create_hash("a"), "lm_create_hash"))
|
||||
test_suite:add_test(unittest.is_false(ntlm_create_hash("a"), "ntlm_create_hash"))
|
||||
end
|
||||
|
||||
return _ENV;
|
||||
|
|
|
|||
|
|
@ -159,13 +159,17 @@ run_tests = function(to_test)
|
|||
local fails = stdnse.output_table()
|
||||
for _,lib in ipairs(to_test) do
|
||||
stdnse.debug1("Testing %s", lib)
|
||||
local thelib = require(lib)
|
||||
local failed = 0
|
||||
if rawget(thelib,"test_suite") ~= nil then
|
||||
failed = thelib.test_suite()
|
||||
end
|
||||
if failed ~= 0 then
|
||||
fails[lib] = failed
|
||||
local status, thelib = pcall(require, lib)
|
||||
if not status then
|
||||
stdnse.debug1("Failed to load %s", lib)
|
||||
else
|
||||
local failed = 0
|
||||
if rawget(thelib,"test_suite") ~= nil then
|
||||
failed = thelib.test_suite()
|
||||
end
|
||||
if failed ~= 0 then
|
||||
fails[lib] = failed
|
||||
end
|
||||
end
|
||||
end
|
||||
return fails
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue