Replies: 1 comment 1 reply
-
@knakul853 Sounds good to me! If you’re open to it, feel free to take this on. Thank you! |
Beta Was this translation helpful? Give feedback.
1 reply
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
Issue Description
The
pkg/runner/runner.go
file, which contains the core scanning functionality of Naabu, currently lacks comprehensive unit tests. Adding tests would significantly improve code reliability, ensure safer future modifications, and make the codebase more maintainable.Current Status
runner.go
file handles:Proposed Test Coverage
Core Functionality Tests
Runner Initialization
NewRunner
with valid and invalid configurations.Scan Execution
RunEnumeration
with different scan types (SYN, CONNECT, UDP).Result Handling
OnResult
,OnReceive
).Error Handling
Close()
.Example Test Plan (Tabular Format)
Options{Host: "example.com", Ports: "80,443"}
Options{Host: "", Ports: ""}
Options{ScanType: "s"}
Options{Host: "example.com", Ports: "80", ScanType: "s"}
Options{Host: "example.com", Ports: "80", ScanType: "c"}
Options{Host: "example.com", Ports: "80"}
with canceled contextOptions{Host: "example.com", Ports: "80", Rate: 100}
Options{Host: "example.com", Ports: "80", OnResult: callbackFunc}
Options{Host: "example.com", Ports: "80", Output: "output.json"}
Options{Host: "example.com", Ports: "80,80"}
Options{Host: "invalid.host", Ports: "80"}
Options{Host: "example.com", Ports: "99999"}
Options{Host: "example.com", Ports: "80"}
with simulated packet dropsOptions{Resume: true}
with a partially completed scanresume.cfg
file.Options{Host: "example.com", Ports: "80"}
Close()
is called.Benefits of Adding Tests
Next Steps
Beta Was this translation helpful? Give feedback.
All reactions