-
Notifications
You must be signed in to change notification settings - Fork 353
Open
Milestone
Description
I reflexively ran go test ./... today, and found out that we aren't running all tests, and some existing tests fail.
Not all tests in lib are not currently being run, as the Makefile states:
test:
cd lib/output/test && go test -v ./...
cd modules && go test -v ./...
Since a lot of logic for http/ssh/etc is in those folders, was this a deliberate decision or an accidental oversight?
In particular, SSH seems to have some failures
panic: runtime error: invalid memory address or nil pointer dereference
[signal SIGSEGV: segmentation violation code=0x2 addr=0x68 pc=0x102e82b9c]
goroutine 415 [running]:
github.com/zmap/zgrab2/lib/ssh.(*dhGroup).Client(0x1400010b200, {0x102fdf8f0, 0x1400032a840}, {0x102fde8c0, 0x14000152000}, 0x14000564f00, 0x0)
/Users/ssmith/code/zgrab2/lib/ssh/kex.go:223 +0xbc
github.com/zmap/zgrab2/lib/ssh.TestKexes.func1()
/Users/ssmith/code/zgrab2/lib/ssh/kex_test.go:28 +0x60
created by github.com/zmap/zgrab2/lib/ssh.TestKexes in goroutine 414
/Users/ssmith/code/zgrab2/lib/ssh/kex_test.go:27 +0x260
FAIL github.com/zmap/zgrab2/lib/ssh 1.247s
--- FAIL: TestLockClient (0.03s)
client_test.go:256: Add: agent: unsupported key type *dsa.PrivateKey
client_test.go:261: Want 2 keys, got [ssh-rsa AAAAB3NzaC1yc2EAAAADAQABAAAAgQC8A6FGHDiWCSREAXCq6yBfNVr0xCVG2CzvktFNRpue+RXrGs/2a6ySEJQb3IYquw7HlJgu6fg3WIWhOmHCjfpG0PrL4CRwbqQ2LaPPXhJErWYejcD8Di00cF3677+G10KMZk9RXbmHtuBFZT98wxg8j+ZsBMqGM1+7yrWUvynswQ== comment 1]
client_test.go:302: Want 1 keys, got []
--- FAIL: TestAgentLifetime (0.03s)
client_test.go:318: add: agent: unsupported key type *dsa.PrivateKey
--- FAIL: TestKeyTypes (0.01s)
server_test.go:154: error adding key type dsa, add: agent: unsupported key type *dsa.PrivateKey
--- FAIL: TestCertTypes (0.00s)
server_test.go:204: add: agent: unsupported key type *dsa.PrivateKey
FAIL
FAIL github.com/zmap/zgrab2/lib/ssh/agent 2.494s
phillip-stephens