You cannot select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
star/net/scan_test.go

34 lines
507 B
Go

package net
import (
"testing"
)
func TestScan(t *testing.T) {
s := ScanPort{
Host: "192.168.2.109",
Timeout: 2000,
Threads: 5000,
}
if err := s.Parse("1-65535"); err != nil {
t.Error(err)
}
if err := s.Run(); err != nil {
t.Error(err)
}
}
func TestScanIP(t *testing.T) {
s := ScanIP{
Host: "192.168.2.1",
CIDR: 23,
Timeout: 2000,
Threads: 5000,
ScanType: "icmp",
WithHostname: true,
}
if err := s.ICMP(); err != nil {
t.Error(err)
}
}